I'm trying to open the following model in MATLAB R2012a and Cobra 2.0.5
but I get the following error:
Too many outputs requested. Most likely cause is missing around
left hand side that has a comma separated list expansion.
Error in convertSBMLToCobra (line 122)
parameters = modelSBML.reaction(i).kineticLaw.parameter;
Error in readCbModel>readSBMLCbModel (line 182)
model = convertSBMLToCobra(modelSBML,defaultBound,compSymbolList,compNameList);
Error in readCbModel (line 134)
model = readSBMLCbModel(fileName,defaultBound,compSymbolList,compNameList);
Error: Unbalanced or unexpected parenthesis or bracket.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hope you can help me on this.
thanks in advance.
There's a known bug with processing some sbml files through the cobra toolbox for matlab.
The fastest way to resolve the problem is to read the sbml in cobra for python and then write the sbml file or use cobrapy for the basic analysis.
from cobra.io import read_sbml_model, write_sbml_model
tmp_model = read_sbml_model('1752-0509-2-85-S5.xml')
then in matlab you can now read the model:
clean_model = readCbModel('model_for_cobra_toolbox.xml')
COBRA for Python
Supporting Installers including spyder ide, scipy, numpy, pyglpk, …
Thanks, I'll try that.
Sorry but which version of cobra for python are you referring to?
I'm using 0.2.0 but I can't import read_sbml_model and write_sbml_model. It seems they are not present within cobra.io.
Am I using the proper version?
thanks in advance.
There's a good chance that you don't have libsbml installed or if you're using Mac OS X or GNU/Linux the libsbml python module's not in your python path or for MS windows you didn't select the python bindings when installing libsbml. see install instructions: http://opencobra.sourceforge.net/openCOBRA/Install.html
to check if you've got libsbml installed, in python type: import libsbml
to make sure you've got cobra py 0.2.0 installed:
to see what's in the io package:
from cobra import io
from cobra.io import sbml
one thing to note about the cobra toolbox for matlab is that you might have problems writing sbml files because the ids used in the toolbox are not necessarily sbml-compliant.
Thanks a million!
I didn't have the libsbml python module in my python path. Now I can read the read the file with cobra py and correctly import it in cobra toolbox.