Closed matthiaskoenig closed 5 years ago
So there are a couple of things at play.
This is an issue with cobrapy. Both metabolite and reaction annotations turn up empty. This is a problem with the parser.
In [13]: for rxn in model.reactions:
...: print(rxn.id, rxn.annotation)
...:
GK {}
ATPASE {}
In [14]: for met in model.metabolites:
...: print(met.id, met.annotation)
...:
glc {}
g6p {}
atp {}
adp {}
If you look at charges, the glucose charge of 0
is wrongly parsed as None
.
In [15]: for met in model.metabolites:
...: print(met.id, met.charge)
...:
glc None
g6p -2
atp -4
adp -3
The metabolite formulae are parsed correctly but the reactions are actually mass unbalanced:
In [16]: for met, coef in model.reactions.ATPASE.metabolites.items():
...: print(met.id, met.elements, coef)
...:
atp {'C': 10, 'H': 12, 'N': 5, 'O': 13, 'P': 3} -1.0
adp {'C': 10, 'H': 12, 'N': 5, 'O': 10, 'P': 2} 1.0
In [17]: for met, coef in model.reactions.GK.metabolites.items():
...: print(met.id, met.elements, coef)
...:
glc {'C': 6, 'H': 12, 'O': 6} -1.0
atp {'C': 10, 'H': 12, 'N': 5, 'O': 13, 'P': 3} -1.0
g6p {'C': 6, 'H': 11, 'O': 9, 'P': 1} 1.0
adp {'C': 10, 'H': 12, 'N': 5, 'O': 10, 'P': 2} 1.0
Again this is a problem of the parser that wrongly parses the reactions. I think the problem here is that cobrapy is not yet compatible with SBML level 3 version 2.
So it is my own issue somehow. We have to fix the SBML parser in cobrapy. This will most likely also fix this issue. The reactions are mass balanced, the parser is just dropping metabolites from the reactions (I think constant metabolites). So SBML is mass balanced, the SBML parser in cobrapy is introducing the problems. I you look at the SBML you can see
<listOfReactants>
<speciesReference species="glc" stoichiometry="1" constant="true"/>
<speciesReference species="atp" stoichiometry="1" constant="true"/>
</listOfReactants>
<listOfProducts>
<speciesReference species="g6p" stoichiometry="1" constant="true"/>
<speciesReference species="adp" stoichiometry="1" constant="true"/>
<speciesReference species="hydron" stoichiometry="1" constant="true"/>
</listOfProducts>
Same for other reaction, where hydron, water and hydrogenphosphate are dropped from reaction equation.
What tool are you using to generate the model? Directly via libsbml?
Yes, model is directly written with libsbml.
Model is completely valid, no errors or warnings. I could imagine that the current cobrapy SBML parser is dropping constant boundarySpecies from the reaction equations.
On Thu, Feb 14, 2019 at 9:30 AM Moritz E. Beber notifications@github.com wrote:
What tool are you using to generate the model? Directly via libsbml?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/opencobra/memote/issues/612#issuecomment-463537848, or mute the thread https://github.com/notifications/unsubscribe-auth/AA29ugs3WtYPqKtVdaHRsyyIoaHBnrfyks5vNR6LgaJpZM4a550h .
-- Matthias König, PhD. Junior Group Leader LiSyM - Systems Medicine of the Liver Humboldt Universität zu Berlin, Institute of Biology, Institute for Theoretical Biology https://livermetabolism.com konigmatt@googlemail.com https://twitter.com/konigmatt https://github.com/matthiaskoenig Tel: +49 30 2093 98435
Actually, that has always been the case yes. I didn't pay attention to that.
I'll close this issue in favor of the one on cobrapy. Let's find a solution for this soon :wink:
Just for anybody running in the same issues. This is solved in
https://github.com/opencobra/cobrapy/pull/685
Just use the libsbml
branch of cobrapy with memote to make things work
https://github.com/opencobra/cobrapy/tree/libsbml
Problem description
With the minimal example attached the model report gives very incorrect results. All species are annotated to
chebi
andkegg.compound
; reactions are annotated to Uniprot. Everything has SBO terms. Nothing of this is detected in the report. In addition mass and charge balance should exist for all reactions but are not reported.Please explain:
memote report snapshot tiny_example_8.xml
Code Sample
Model and results are attached results.zip
Context
Please run the following code and paste the output inside the details block.