Closed Devlin-Moyer closed 1 year ago
@Devlin-Moyer Thanks for the detailed report. Yes, looks clearly like a bug. I will commit a fix asap. Best Matthias
@matthiaskoenig Has this been fixed? https://github.com/opencobra/cobrapy/issues/1300
This seems to have been fixed in #1300. Feel free to reopen if the problem persists.
Starting with the Recon3D model straight from BiGG, which has all reactions set to a default upper bound of 1000, I changed some reactions to have upper bounds larger than 1000 and noticed that, after writing the model to an SBML file and reading it back in, the upper bounds on all of the reactions I had left with the default upper bound of 1000 had much higher upper bounds. Following the documentation here, I verified that the default upper bound set in the global configuration object was 1000 even while this was happening. I then found this in the _model_to_sbml function:
which seems to show that the default lower and upper bounds specified in the global configuration object are only used when writing models that have no reactions in them. If the model being written has any reactions in it, the default upper bound of the generated SBML file is set to the largest upper bound of any reaction in the model instead of the default upper bound in the global configuration object, and I can't really imagine that being the behavior anyone wants or expects. Let me know if I'm missing something here.
A reproducible example using the Recon3D from BiGG:
Context