@@ -60,6 +60,7 @@ def bioFlux_check(model, sol=None, sol_dict=None, min_growth=0.1):
6060 return sol_dict
6161
6262def minimizeFlux_withGrowth (model_util , min_growth , obj ):
63+ print ("here" , model_util .model .slim_optimize ())
6364 model_util .add_minimal_objective_cons (min_growth , name = "min_growth" )
6465 model_util .add_objective (obj , "min" )
6566 sol = model_util .model .optimize ()
@@ -96,16 +97,20 @@ def _influx_objective(model_util, interacting, minExchanges=1e-5):
9697 def minimize_flux (org_model , min_growth = None , environment = None , interacting = True , pfba = True ,
9798 climit = None , o2limit = None , printing = True , minExchange = None ):
9899 """minimize the total in-flux of exchange reactions in the model"""
100+ print ("start" , org_model .slim_optimize ())
99101 if org_model .slim_optimize () == 0 :
100102 raise ObjectiveError (f"The model { org_model .id } possesses an objective value of 0 in complete media, "
101103 "which is incompatible with minimal media computations." )
102104 model_util = MSModelUtil (org_model , True , environment or org_model .medium , climit , o2limit )
103105 # define the MILP
106+ print ("beginning" , model_util .model .slim_optimize ())
104107 sol_growth = model_util .run_fba (None , pfba ).fluxes [model_util .biomass_objective ]
108+ print ("mid" , model_util .model .slim_optimize ())
105109 ## some models can't grow at min_growth and therefore are limited by their max_growth
106110 min_growth = sol_growth if min_growth is None else min (min_growth , sol_growth )
107111 minExchange = minExchange or min_growth / 1000
108112 media_exchanges , model_util = MSMinimalMedia ._influx_objective (model_util , interacting , minExchange )
113+ print ("towards end" , model_util .model .slim_optimize ())
109114 # for cons in model_util.model.constraints:
110115 # if "min" in cons.name and "EX_" in cons.name:
111116 # print(cons.name, cons.ub, cons.expression, cons.lb)
0 commit comments