Skip to content

Commit

Permalink
Strip '_kb' from exchange reaction IDs when accessing data from KB
Browse files Browse the repository at this point in the history
  • Loading branch information
YinHoon committed Mar 13, 2020
1 parent 618f698 commit 5025458
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wc_model_gen/eukaryote/metabolism.py
Expand Up @@ -462,13 +462,13 @@ def calibrate_submodel(self):
upper_bound_adjustable = []
for reaction in submodel.reactions:
# Block all exchange/demand/sink reactions
if reaction.id in exchange_reactions:
if reaction.id.rstrip('_kb') in exchange_reactions:
min_constr = 0.
max_constr = 0.
# Set the bounds of exchange reactions for media components to the measured fluxes
if reaction.id in media_fluxes:
min_constr = media_fluxes[reaction.id][0]*scale_factor
max_constr = media_fluxes[reaction.id][1]*scale_factor
if reaction.id.rstrip('_kb') in media_fluxes:
min_constr = media_fluxes[reaction.id.rstrip('_kb')][0]*scale_factor
max_constr = media_fluxes[reaction.id.rstrip('_kb')][1]*scale_factor
# Set the bounds of reactions with measured kinetic constants
elif reaction.rate_laws:

Expand Down Expand Up @@ -505,7 +505,7 @@ def calibrate_submodel(self):
min_constr = 0.
# Set other reactions to be unbounded
else:
if reaction.id not in exchange_reactions:
if reaction.id.rstrip('_kb') not in exchange_reactions:
max_constr = None
if reaction.reversible:
min_constr = None
Expand Down

0 comments on commit 5025458

Please sign in to comment.