From 5025458471a37e0c0dae957f4055121d4552086d Mon Sep 17 00:00:00 2001 From: Yin Hoon Chew Date: Fri, 13 Mar 2020 15:22:21 -0400 Subject: [PATCH] Strip '_kb' from exchange reaction IDs when accessing data from KB --- wc_model_gen/eukaryote/metabolism.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wc_model_gen/eukaryote/metabolism.py b/wc_model_gen/eukaryote/metabolism.py index 594bc3d..769d7d4 100644 --- a/wc_model_gen/eukaryote/metabolism.py +++ b/wc_model_gen/eukaryote/metabolism.py @@ -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: @@ -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