running a sample model using COBRApy

386 views
Skip to first unread message

Varada Anirudhan

unread,
Jul 11, 2015, 7:47:19 AM7/11/15
to cobr...@googlegroups.com
Hello

I have downloaded the .xml file of a model from the BiGG database. My first step would be to read the model
In this line of code (available at the COBRApy documentation webpage), I am not quite sure which term I should replace with the new .xml filename
cobra.io.read_sbml_model(cobra.test.salmonella_sbml)


thanks in advance
Varada

Varada Anirudhan

unread,
Jul 11, 2015, 8:04:45 AM7/11/15
to cobr...@googlegroups.com
I used this command:

>>> from cobra.io.sbml import create_cobra_model_from_sbml_file
>>> cobra_model = create_cobra_model_from_sbml_file('RECON1.xml')

and it says: Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    cobra_model = create_cobra_model_from_sbml_file('RECON1.xml')
  File "/usr/local/lib/python2.7/dist-packages/cobra/io/sbml.py", line 75, in create_cobra_model_from_sbml_file
    raise IOError('Your SBML file is not found: %s'%sbml_filename)
IOError: Your SBML file is not found: RECON1.xml

Could someone tell me what the problem could be? Should I change the location of the .xml file?

Nikolaus Sonnenschein

unread,
Jul 11, 2015, 11:49:00 AM7/11/15
to cobr...@googlegroups.com
Hi Varada,

Your script might not be run in the same directory as the model. How about giving the function the full path to the model ('/home/user/someFolder/Recon1.xml') or you place the model in the same directory as the script. Also please don't be discouraged, but I think you would benefit a lot from spending some time on learning a few Python and command line basics. Software carpentry, for example, is a pretty good place to start: http://software-carpentry.org/v4/python/
Please continue asking questions here though :-)

Best,

Niko

Reply all
Reply to author
Forward
0 new messages