Skip to content

Commit

Permalink
Update aa_synthesis_sensitivity variant for rev kcat parameter (#1211)
Browse files Browse the repository at this point in the history
* Include rev kcat parameter and update FACTORS in aa_synthesis_sensitivity variant
* Better check for if a variant needs to be run
  • Loading branch information
tahorst authored Oct 28, 2021
1 parent 0097ca8 commit 9b71bc3
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions models/ecoli/sim/variants/aa_synthesis_sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9b71bc3

Please sign in to comment.