From 9b71bc35779d2b1e3adc245a2382e1b0556b195d Mon Sep 17 00:00:00 2001 From: Travis Ahn-Horst Date: Thu, 28 Oct 2021 05:54:28 -0400 Subject: [PATCH] Update aa_synthesis_sensitivity variant for rev kcat parameter (#1211) * Include rev kcat parameter and update FACTORS in aa_synthesis_sensitivity variant * Better check for if a variant needs to be run --- .../sim/variants/aa_synthesis_sensitivity.py | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/models/ecoli/sim/variants/aa_synthesis_sensitivity.py b/models/ecoli/sim/variants/aa_synthesis_sensitivity.py index d40db5ca34..89094a3e9a 100644 --- a/models/ecoli/sim/variants/aa_synthesis_sensitivity.py +++ b/models/ecoli/sim/variants/aa_synthesis_sensitivity.py @@ -10,11 +10,16 @@ sim_data.process.metabolism.aa_reverse_kms sim_data.process.metabolism.aa_degradation_kms -Expected variant indices (dependent on length of FACTORS and sim_data.molecule_groups.amino_acids): - 0-6: range of values for first parameter, first amino acid, first media condition - 0-34: range of parameters and values for first amino acid, first media condition - 0-734: range of parameters and values over all amino acids for first media condition - 0-1469: all changes +Expected variant indices (dependent on length of FACTORS, PARAMETERS, +sim_data.molecule_groups.amino_acids and MEDIA_IDS as noted below each group): + 0-5: range of values for first parameter, first amino acid, first media condition + # FACTORS + 0-35: range of parameters and values for first amino acid, first media condition + # FACTORS x # PARAMETERS + 0-755: range of parameters and values over all amino acids for first media condition + # FACTORS x # PARAMETERS x # amino acids + 0-1511: all changes + # FACTORS x # PARAMETERS x # amino acids x # MEDIA_IDS TODO: - Run this for all AA additions or just Glt and control? @@ -25,8 +30,8 @@ import numpy as np -FACTORS = [0, 0.1, 0.5, 1.5, 2, 5, 10] # TODO: run factor of 1 once for each media condition -PARAMETERS = ['aa_kcats', 'aa_kis', 'aa_upstream_kms', 'aa_reverse_kms', 'aa_degradation_kms'] +FACTORS = [0, 0.1, 0.5, 2, 5, 10] # TODO: run factor of 1 once for each media condition +PARAMETERS = ['aa_kcats_fwd', 'aa_kcats_rev', 'aa_kis', 'aa_upstream_kms', 'aa_reverse_kms', 'aa_degradation_kms'] N_PARAM_VALUES = len(FACTORS) * len(PARAMETERS) MEDIA_IDS = [5, 19] # Glt and control for now (need to update the analysis plot if changed) @@ -59,7 +64,7 @@ def aa_synthesis_sensitivity(sim_data, index): aa_idx = get_aa_index(index, sim_data) param, factor = get_adjustment(index) values = getattr(sim_data.process.metabolism, param) - if np.all(values[aa_idx] == values[aa_idx] * factor): + if np.all(~np.isfinite(values[aa_idx])) or np.all(values[aa_idx] == 0): # Skip sims for parameters that are 0 or inf and will not be updated raise ValueError('No change to params - not running variant sims.') values[aa_idx] *= factor