Hi, StrainDesign has worked very well for me when used on basic stoichiometric genome-scale models (e.g. iML1515). However, I am encountering problems when I try to use it on an enzyme-constrained model, specifically eciML1515 from this ECMpy study https://doi.org/10.3390/biom12010065. Unlike standard cobrapy library functions, StrainDesign seems to not be able to pick up on the additional enzyme constraints included in the model and, as a result, the sd.fba, sd.fva and sd.plot_flux_space functions simulate flux distributions identical to those obtained with the basic stoichiometric model, ignoring the enzyme constraints.
I have not been able to overcome this issue on my own. Looking into the source code, it seems to me these constraints get ignored during the "A_eq_base = sparse.csr_matrix(create_stoichiometric_matrix(model))" step within the fva, fba and yopt functions in the straindesign.lptools module, but I might be wrong.
I tried providing the enzyme constraints obtained from "model.constraints" directly into the constraints parameter within the "sd.fba(model, constraints=...)" function, all in a straindesign-friendly format (e.g. '0.00860581989817056 13PPDH2 + 0.00805572834477629 13PPDH2_reverse + 0.00134590026565838 23PDE2pp + ... <= 0.227'), but that didn't work either.
It would be great if there was a way to consider additional enzyme-constraints in straindesign simulations and strain optimization methods.
Below, I included a simple test to reproduce the different treatment of enzyme-constrained model eciML1515 by standard cobrapy and by straindesign, which can be launched from the ECMpy repository folder here https://github.com/tibbdc/ECMpy/tree/master.
import straindesign as sd
import cobra
import sys
sys.path.append(r'./code/')
from cobrapy_ec_model_function import *
#load enzyme-constrained model
json_model_path="./model/iML1515_irr_enz_constraint_adj_round2.json"
enz_model=get_enzyme_constraint_model(json_model_path)
#load stoichiometric model
norm_model=cobra.io.json.load_json_model(json_model_path)
#FBA via cobra - differentiates between enzyme-constrained and basic model
fba_sol__cobra_enz = enz_model.optimize()
print(fba_sol__cobra_enz.fluxes['BIOMASS_Ec_iML1515_core_75p37M'], fba_sol__cobra_enz.fluxes['EX_ac_e'])
fba_sol__cobra_norm = norm_model.optimize()
print(fba_sol__cobra_norm.fluxes['BIOMASS_Ec_iML1515_core_75p37M'], fba_sol__cobra_norm.fluxes['EX_ac_e'])
#0.6802441208853646 7.711579625195041
#0.8697726420320148 0.0
#FBA via straindesign - simulates enzyme-constrained model identically to basic model
fba_sol__sd_enz = sd.fba(enz_model)
print(fba_sol__sd_enz.fluxes['BIOMASS_Ec_iML1515_core_75p37M'], fba_sol__sd_enz.fluxes['EX_ac_e'])
fba_sol__sd_norm = sd.fba(norm_model)
print(fba_sol__sd_norm.fluxes['BIOMASS_Ec_iML1515_core_75p37M'], fba_sol__sd_norm.fluxes['EX_ac_e'])
#0.869772642032 0.0
#0.869772642032 0.0
#straindesign production envelopes also look identical for both enzyme-constrained and basic model
sd.plot_flux_space(enz_model,('BIOMASS_Ec_iML1515_core_75p37M','EX_ac_e'));
sd.plot_flux_space(norm_model,('BIOMASS_Ec_iML1515_core_75p37M','EX_ac_e'));
Hi, StrainDesign has worked very well for me when used on basic stoichiometric genome-scale models (e.g. iML1515). However, I am encountering problems when I try to use it on an enzyme-constrained model, specifically eciML1515 from this ECMpy study https://doi.org/10.3390/biom12010065. Unlike standard cobrapy library functions, StrainDesign seems to not be able to pick up on the additional enzyme constraints included in the model and, as a result, the sd.fba, sd.fva and sd.plot_flux_space functions simulate flux distributions identical to those obtained with the basic stoichiometric model, ignoring the enzyme constraints.
I have not been able to overcome this issue on my own. Looking into the source code, it seems to me these constraints get ignored during the "A_eq_base = sparse.csr_matrix(create_stoichiometric_matrix(model))" step within the fva, fba and yopt functions in the straindesign.lptools module, but I might be wrong.
I tried providing the enzyme constraints obtained from "model.constraints" directly into the constraints parameter within the "sd.fba(model, constraints=...)" function, all in a straindesign-friendly format (e.g. '0.00860581989817056 13PPDH2 + 0.00805572834477629 13PPDH2_reverse + 0.00134590026565838 23PDE2pp + ... <= 0.227'), but that didn't work either.
It would be great if there was a way to consider additional enzyme-constraints in straindesign simulations and strain optimization methods.
Below, I included a simple test to reproduce the different treatment of enzyme-constrained model eciML1515 by standard cobrapy and by straindesign, which can be launched from the ECMpy repository folder here https://github.com/tibbdc/ECMpy/tree/master.
import straindesign as sd
import cobra
import sys
sys.path.append(r'./code/')
from cobrapy_ec_model_function import *
#load enzyme-constrained model
json_model_path="./model/iML1515_irr_enz_constraint_adj_round2.json"
enz_model=get_enzyme_constraint_model(json_model_path)
#load stoichiometric model
norm_model=cobra.io.json.load_json_model(json_model_path)
#FBA via cobra - differentiates between enzyme-constrained and basic model
fba_sol__cobra_enz = enz_model.optimize()
print(fba_sol__cobra_enz.fluxes['BIOMASS_Ec_iML1515_core_75p37M'], fba_sol__cobra_enz.fluxes['EX_ac_e'])
fba_sol__cobra_norm = norm_model.optimize()
print(fba_sol__cobra_norm.fluxes['BIOMASS_Ec_iML1515_core_75p37M'], fba_sol__cobra_norm.fluxes['EX_ac_e'])
#0.6802441208853646 7.711579625195041
#0.8697726420320148 0.0
#FBA via straindesign - simulates enzyme-constrained model identically to basic model
fba_sol__sd_enz = sd.fba(enz_model)
print(fba_sol__sd_enz.fluxes['BIOMASS_Ec_iML1515_core_75p37M'], fba_sol__sd_enz.fluxes['EX_ac_e'])
fba_sol__sd_norm = sd.fba(norm_model)
print(fba_sol__sd_norm.fluxes['BIOMASS_Ec_iML1515_core_75p37M'], fba_sol__sd_norm.fluxes['EX_ac_e'])
#0.869772642032 0.0
#0.869772642032 0.0
#straindesign production envelopes also look identical for both enzyme-constrained and basic model
sd.plot_flux_space(enz_model,('BIOMASS_Ec_iML1515_core_75p37M','EX_ac_e'));
sd.plot_flux_space(norm_model,('BIOMASS_Ec_iML1515_core_75p37M','EX_ac_e'));