Hello everyone,
I have two lists of upper bound and lower bound values. I modified my reaction bounds like this.
for i, rxn in enumerate(model.reactions):
rxn.bounds = ( lwb[i], upb[i] )
But while saving the model, it shows the following error:
cobra.io.write_sbml_model(model, ''TPM_avg.xml'')
When I changed the bounds by manually writing like this, it showed no error while saving.
model.reactions.MAR08762.bounds = (-0.9730982564134064 , 0.9730982564134064)
model.reactions.MAR08764.bounds = (0.0 , 0.001)
model.reactions.MAR08766.bounds = (-0.15081222128094757 , 0.15081222128094757)
model.reactions.MAR08767.bounds = (0.0 , 0.05002992950568093)
model.reactions.MAR00454.bounds = (0.0 , 0.001)
model.reactions.MAR04297.bounds = (0.0 , 0.04643264517106)
model.reactions.MAR04310.bounds = (0.0 , 0.0009999927140217114)
model.reactions.MAR04315.bounds = (-0.02097143439726379 , 0.02097143439726379)
model.reactions.MAR04316.bounds = (-0.15081222128094704 , 0.15081222128094704)
.....
But writing this way is not feasible, because I have thousands of reactions for thousands of models to change bounds for. Any idea about how to rectify this error or any other way of doing this process.
Thanks,
Rakesh