opencobra / m_model_collection

A collection of M models downloaded from published studies
15 stars 15 forks source link

Reactions without reactants and products #2

Open matthiaskoenig opened 9 years ago

matthiaskoenig commented 9 years ago

The following models in the sbml3 model collection have reactions without any reactants or products. The best Matthias

[12:05:23,062 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/iOG654.xml [12:05:23,103 WARN SBMLCoreParser:485] - The reaction 'R_R00124' does not contain any reactants or products. [12:05:23,104 WARN SBMLCoreParser:485] - The reaction 'R_ER99999' does not contain any reactants or products.

[12:05:22,540 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/PpaMBEL1254.xml [12:05:22,598 WARN SBMLCoreParser:485] - The reaction 'R_R00033' does not contain any reactants or products. [12:05:22,598 WARN SBMLCoreParser:485] - The reaction 'R_R00139' does not contain any reactants or products. [12:05:22,599 WARN SBMLCoreParser:485] - The reaction 'R_R00250' does not contain any reactants or products. [12:05:22,599 WARN SBMLCoreParser:485] - The reaction 'R_R00444' does not contain any reactants or products. [12:05:22,600 WARN SBMLCoreParser:485] - The reaction 'R_R01147' does not contain any reactants or products. [12:05:22,600 WARN SBMLCoreParser:485] - The reaction 'R_R01150' does not contain any reactants or products. [12:05:22,600 WARN SBMLCoreParser:485] - The reaction 'R_R01264' does not contain any reactants or products.

[12:05:18,202 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/iHD666_fixed.xml [12:05:18,261 WARN SBMLCoreParser:485] - The reaction 'R_Dcm_H2O' does not contain any reactants or products. [12:05:18,261 WARN SBMLCoreParser:485] - The reaction 'R_Dmm_H2O' does not contain any reactants or products. [12:05:18,262 WARN SBMLCoreParser:485] - The reaction 'R_Dgm_H2O' does not contain any reactants or products.

[12:05:18,011 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/SpoMBEL1693.xml [12:05:18,096 WARN SBMLCoreParser:485] - The reaction 'R_RXN00017' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00019' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00022' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00044' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00066' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00071' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00084' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00116' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00127' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00161' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00258' does not contain any reactants or products. [12:05:18,099 WARN SBMLCoreParser:485] - The reaction 'R_RXN00404' does not contain any reactants or products. [12:05:18,100 WARN SBMLCoreParser:485] - The reaction 'R_RXN01347' does not contain any reactants or products. [12:05:18,100 WARN SBMLCoreParser:485] - The reaction 'R_RXN01349' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01457' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01547' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01564' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01567' does not contain any reactants or products.

[12:05:16,167 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/iCA1273.xml [12:05:16,335 WARN SBMLCoreParser:485] - The reaction 'R_METSOX1tex' does not contain any reactants or products. [12:05:16,336 WARN SBMLCoreParser:485] - The reaction 'R_METSOX2tex' does not contain any reactants or products.

aebrahim commented 9 years ago

Thanks for pointing this out. I'll look through all of them to make sure there are no errors.

However, in some cases, the original reaction is composed only of boundarycondition=True metabolites, which are ignored in the COBRA formulation (and should be left out of any cobra SBML model). What would the appropriate action be in this case? Leave out the reaction entirely, or leave it in but keep it empty?

-Ali

On Mon, Jul 27, 2015 at 4:25 AM, Matthias König notifications@github.com wrote:

The following models in the sbml3 model collection have reactions without any reactants or products. The best Matthias

[12:05:23,062 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/iOG654.xml [12:05:23,103 WARN SBMLCoreParser:485] - The reaction 'R_R00124' does not contain any reactants or products. [12:05:23,104 WARN SBMLCoreParser:485] - The reaction 'R_ER99999' does not contain any reactants or products.

[12:05:22,540 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/PpaMBEL1254.xml [12:05:22,598 WARN SBMLCoreParser:485] - The reaction 'R_R00033' does not contain any reactants or products. [12:05:22,598 WARN SBMLCoreParser:485] - The reaction 'R_R00139' does not contain any reactants or products. [12:05:22,599 WARN SBMLCoreParser:485] - The reaction 'R_R00250' does not contain any reactants or products. [12:05:22,599 WARN SBMLCoreParser:485] - The reaction 'R_R00444' does not contain any reactants or products. [12:05:22,600 WARN SBMLCoreParser:485] - The reaction 'R_R01147' does not contain any reactants or products. [12:05:22,600 WARN SBMLCoreParser:485] - The reaction 'R_R01150' does not contain any reactants or products. [12:05:22,600 WARN SBMLCoreParser:485] - The reaction 'R_R01264' does not contain any reactants or products.

[12:05:18,202 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/iHD666_fixed.xml [12:05:18,261 WARN SBMLCoreParser:485] - The reaction 'R_Dcm_H2O' does not contain any reactants or products. [12:05:18,261 WARN SBMLCoreParser:485] - The reaction 'R_Dmm_H2O' does not contain any reactants or products. [12:05:18,262 WARN SBMLCoreParser:485] - The reaction 'R_Dgm_H2O' does not contain any reactants or products.

[12:05:18,011 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/SpoMBEL1693.xml [12:05:18,096 WARN SBMLCoreParser:485] - The reaction 'R_RXN00017' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00019' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00022' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00044' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00066' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00071' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00084' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00116' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00127' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00161' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00258' does not contain any reactants or products. [12:05:18,099 WARN SBMLCoreParser:485] - The reaction 'R_RXN00404' does not contain any reactants or products. [12:05:18,100 WARN SBMLCoreParser:485] - The reaction 'R_RXN01347' does not contain any reactants or products. [12:05:18,100 WARN SBMLCoreParser:485] - The reaction 'R_RXN01349' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01457' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01547' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01564' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01567' does not contain any reactants or products.

[12:05:16,167 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/iCA1273.xml [12:05:16,335 WARN SBMLCoreParser:485] - The reaction 'R_METSOX1tex' does not contain any reactants or products. [12:05:16,336 WARN SBMLCoreParser:485] - The reaction 'R_METSOX2tex' does not contain any reactants or products.

— Reply to this email directly or view it on GitHub https://github.com/opencobra/m_model_collection/issues/2.

matthiaskoenig commented 9 years ago

Hi Ali, In my opinion these boundary metabolites have to be part of the SBML model to be able to check for mass and charge conservation. They are indeed dropped in the FBA formulation, but are nonetheless required to check the mass/charge balance of the solutions or model. Don't drop information if you not absolutely have to.

A side note: You should probably implement also the functions for charge balance in cobrapy. As far as I remember you only had the function to check for mass balance in their when I checked last time, but never found the time to report this.

Matthias

On Mon, Jul 27, 2015 at 8:50 PM, Ali Ebrahim notifications@github.com wrote:

Thanks for pointing this out. I'll look through all of them to make sure there are no errors.

However, in some cases, the original reaction is composed only of boundarycondition=True metabolites, which are ignored in the COBRA formulation (and should be left out of any cobra SBML model). What would the appropriate action be in this case? Leave out the reaction entirely, or leave it in but keep it empty?

-Ali

On Mon, Jul 27, 2015 at 4:25 AM, Matthias König notifications@github.com wrote:

The following models in the sbml3 model collection have reactions without any reactants or products. The best Matthias

[12:05:23,062 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/iOG654.xml [12:05:23,103 WARN SBMLCoreParser:485] - The reaction 'R_R00124' does not contain any reactants or products. [12:05:23,104 WARN SBMLCoreParser:485] - The reaction 'R_ER99999' does not contain any reactants or products.

[12:05:22,540 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/PpaMBEL1254.xml [12:05:22,598 WARN SBMLCoreParser:485] - The reaction 'R_R00033' does not contain any reactants or products. [12:05:22,598 WARN SBMLCoreParser:485] - The reaction 'R_R00139' does not contain any reactants or products. [12:05:22,599 WARN SBMLCoreParser:485] - The reaction 'R_R00250' does not contain any reactants or products. [12:05:22,599 WARN SBMLCoreParser:485] - The reaction 'R_R00444' does not contain any reactants or products. [12:05:22,600 WARN SBMLCoreParser:485] - The reaction 'R_R01147' does not contain any reactants or products. [12:05:22,600 WARN SBMLCoreParser:485] - The reaction 'R_R01150' does not contain any reactants or products. [12:05:22,600 WARN SBMLCoreParser:485] - The reaction 'R_R01264' does not contain any reactants or products.

[12:05:18,202 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/iHD666_fixed.xml [12:05:18,261 WARN SBMLCoreParser:485] - The reaction 'R_Dcm_H2O' does not contain any reactants or products. [12:05:18,261 WARN SBMLCoreParser:485] - The reaction 'R_Dmm_H2O' does not contain any reactants or products. [12:05:18,262 WARN SBMLCoreParser:485] - The reaction 'R_Dgm_H2O' does not contain any reactants or products.

[12:05:18,011 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/SpoMBEL1693.xml [12:05:18,096 WARN SBMLCoreParser:485] - The reaction 'R_RXN00017' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00019' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00022' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00044' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00066' does not contain any reactants or products. [12:05:18,097 WARN SBMLCoreParser:485] - The reaction 'R_RXN00071' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00084' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00116' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00127' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00161' does not contain any reactants or products. [12:05:18,098 WARN SBMLCoreParser:485] - The reaction 'R_RXN00258' does not contain any reactants or products. [12:05:18,099 WARN SBMLCoreParser:485] - The reaction 'R_RXN00404' does not contain any reactants or products. [12:05:18,100 WARN SBMLCoreParser:485] - The reaction 'R_RXN01347' does not contain any reactants or products. [12:05:18,100 WARN SBMLCoreParser:485] - The reaction 'R_RXN01349' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01457' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01547' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01564' does not contain any reactants or products. [12:05:18,101 WARN SBMLCoreParser:485] - The reaction 'R_RXN01567' does not contain any reactants or products.

[12:05:16,167 INFO CobraPyCollectionTest:145] - CobraPyTest: /models/m_model_collection/sbml3/iCA1273.xml [12:05:16,335 WARN SBMLCoreParser:485] - The reaction 'R_METSOX1tex' does not contain any reactants or products. [12:05:16,336 WARN SBMLCoreParser:485] - The reaction 'R_METSOX2tex' does not contain any reactants or products.

— Reply to this email directly or view it on GitHub https://github.com/opencobra/m_model_collection/issues/2.

— Reply to this email directly or view it on GitHub https://github.com/opencobra/m_model_collection/issues/2#issuecomment-125303559 .


Matthias König Computational Systems Biochemistry Institute of Biochemistry Charité - Universitätsmedizin Berlin http://www.charite.de/sysbio/people/koenig/ Tel: + 49 30 450528449

Tel: + 49 176 81168480

aebrahim commented 9 years ago

I actually have a fundamental disagreement with you on this. These are my thoughts about boundary metabolites vis a vis cobra models (I'm not really sure about other types of models).:

The only reactions which should not be mass balanced are the boundary reactions which bring mass into and out of the system. The thing is that those are actually NOT mass balanced, and I think it makes a lot more sense to annotate it as an exchange reaction which doesn't need to be balanced than to add a fake metabolite just to make it mass balanced. Boundary metabolites are what caused a lot of the issues with MONGOOSE study in the first place.

Every other reaction in a well-curated model needs to be mass balanced without using boundary metabolites. I tried to push for the specification to not even allow boundary metabolites in strict fbcv2 models, but some people really wanted the feature precisely because some draft models are not mass balanced for metabolites like hydrogen and water, and they want to be able to include them in the reconstruction even though they are not modeled.

You are right that charge balancing needs to be taken into account as well in cobrapy. If you have time, I would greatly appreciate it if you filed a bug here.

matthiaskoenig commented 9 years ago

Hi Ali, I think I got your point. Thanks for the explanation.

So what is a boundary reaction for you exactly? And how is your ideal way to write down the boundary conditions (mass exchanges for the system) in SBML? For instance you have m_glc (glucose) as metabolite you do not want to balance, because it is used for instance in glycolysis. I could imagine different encodings for that, with different issues.

variant 1: m_glc (boundaryCondition=true) Just set the boundary condition of the metabolite to true. The FBA formulating algorithm, for instance cobrapy, should add the necessary exchange reaction so that the boundary conditions is transferred into a reaction r1: Null -> m_glc so that the FBA can be formulated. This creates the issue of setting fluxBounds on the boundaryCondition (Import?, Export?, how much?). Without additional annotations this does not work.

variant 2: m_glc (boundaryCondition=false) + r1: Null -> m_glc The modeller has to add unbalanced exchange reactions for all "boundary species" + suitable flux bounds during modeling. There is no boundaryCondition=true any more, this is shifted to the exchange reaction (mass exchange).

variant 3: m_glc (boundaryCondition=false), m_glc_ex (boundaryCondition=true) + r1: m_glc_ex -> m_glc The whole boundaryCondition was just put one level further and artificial metabolites _ex were added to the model. For the formulation of the FBA problem the m_glc_ex have to be handled and removed. Variant 3 is somehow more biological, stating that some external unspecificed m_glc_ex from somewhere in the system is transferred in the pool of m_glc (keeping mass and charge balance for the individual reaction). But of course one has to invent some additional metabolite and the problem is somehow shifted one level further. This is ugly encoding for the sake of some biological meaning which is implicitly there.

I understood you favour variant 2. This is the variant closest to the FBA problem. I do not like so much that something is generated out of nothing (Null -> m_glc_ex), just for the sake of FBA. But writing this down I would also prefer variant 2 with a nice SBO annotation of the reaction, i.e. writing something like variant 4: m_glc (boundaryCondition=false) + r1 (SBO:exchangeFlux, importFlux, exportFlux): Null -> m_glc i.e. it should be clearly stated in the model annotation that the reaction is only there as exchange, import or export (depending on the fluxbounds of the reaction). This seems the cleanest way. Can you comment on that? Are there any FBA annotations for the reactions (SBO, ..?)

The best Matthias

On Tue, Jul 28, 2015 at 8:31 PM, Ali Ebrahim notifications@github.com wrote:

I actually have a fundamental disagreement with you on this. These are my thoughts about boundary metabolites vis a vis cobra models (I'm not really sure about other types of models).:

The only reactions which should not be mass balanced are the boundary reactions which bring mass into and out of the system. The thing is that those are actually NOT mass balanced, and I think it makes a lot more sense to annotate it as an exchange reaction which doesn't need to be balanced than to add a fake metabolite just to make it mass balanced. Boundary metabolites are what caused a lot of the issues with MONGOOSE study in the first place.

Every other reaction in a well-curated model needs to be mass balanced without using boundary metabolites. I tried to push for the specification to not even allow boundary metabolites in strict fbcv2 models, but some people really wanted the feature precisely because some draft models are not mass balanced for metabolites like hydrogen and water, and they want to be able to include them in the reconstruction even though they are not modeled.

You are right that charge balancing needs to be taken into account as well in cobrapy. If you have time, I would greatly appreciate it if you filed a bug here https://github.com/opencobra/cobrapy/issues/new.

— Reply to this email directly or view it on GitHub https://github.com/opencobra/m_model_collection/issues/2#issuecomment-125705285 .


Matthias König Computational Systems Biochemistry Institute of Biochemistry Charité - Universitätsmedizin Berlin http://www.charite.de/sysbio/people/koenig/ Tel: + 49 30 450528449

Tel: + 49 176 81168480

aebrahim commented 9 years ago

As far as something out of nothing goes... that's the reality of both the model and the biological system. You are actively adding something to the system that wasn't there (adding glucose to the media), and the model is actively bringing mass into the system. I don't think there is really a way around it.

I don't see anything wrong with an SBO annotation of the reaction as well. In fact, that would probably be the best "SBML" way to do this. We generally follow the convention of reactions with ID's that start with EX_ or DM, and have only a single metabolite. It would be pretty easy for a tool to detect these reaction and add the requisite SBO term.

I'm not really an expert on SBO terms. I'll bring in @draeger

draeger commented 9 years ago

For the annotation of reaction types we have already requested the following SBO terms that should be used:

Here we even distinguish between internal and external artificial metabolites by discriminating exchange reactions from demand reactions.

From Matthias' list variant #3 looks most intuitive for biologists (we just need to add a similar case for internal metabolites and demands) and I would favor it, too.

matthiaskoenig commented 9 years ago

Yes, these SBO terms should be used on the respective reactions.

For me the important thing is that the SBML based FBA software solutions supports the simulation of the SBML out of the box. Using the variant 2/4, i.e. NULL -> m_glc most of the software should work without modification (just writing the stoichiometric matrix as constraint-based problem). In case of the added m_glc_ex the software solutions have to deal somehow with this boundary metabolites, i.e. write some additional code to handle these reactions for the FBA problem.

I prefer the solution most software can work with. By providing the SBO annotation (exchange) on the exchange reactions the biological meaning is preserved. The definition states clearly what is happening: "A modeling process to provide matter influx or efflux to a model, for example to replenish a metabolic network with raw materials (eg carbon / energy sources). Such reactions are conceptual, created solely for modeling purposes, and do not have a physical correspondence." People have to be aware that mass- & charge balance are not conserved on the exchange reactions, which like Ali mentioned is exactly what happens.