Unable to visualize cobra model using Escher

259 views
Skip to first unread message

prashan...@igib.in

unread,
Apr 27, 2018, 8:38:55 AM4/27/18
to cobra pie
Hi,

I am trying to visualize a metabolic model of mitochondria published here using Esher. Here is the code:

import cobra
from escher import Builder

Recon_model = cobra.io.read_sbml_model('mitocore.xml')

from cobra.util.solver import linear_reaction_coefficients
linear_reaction_coefficients(Recon_model)
Recon_model.objective = 'OF_ATP_MitoCore'
Recon_model.optimize()

b = Builder(model=Recon_model)
b.display_in_browser()

However, this returns an empty browser. I have tried running a sample code provided in the Esher documentation to display cobra models in browser and it works fine. The escher documentation says that it could used to visualize any metabolic models. It is something I am missing and doing wrong? I am also attaching the model I am using. 


Best,
Prashant Bajpai
PhD Scholar,
CSIR-IGIB, Delhi, India
mitocore.xml

Moritz Beber

unread,
Apr 27, 2018, 6:37:08 PM4/27/18
to cobra pie
Dear Prashant,

The main thing that you are missing is a map. You probably got confused by this section in the documentation: https://escher.readthedocs.io/en/stable/escher-python.html#launching-escher-in-python. In the first example a pre-drawn map is loaded by name. In the second example the model is loaded into the Escher builder, however, Escher does not draw anything automatically. Loading a model simply means that Escher knows about the reactions and metabolites in the model. You will still have to place and connect them manually via the Escher tools. Unless somebody has already drawn a map and sends the file to you.

One more comment: The following two lines in your code above are unnecessary.

from cobra.util.solver import linear_reaction_coefficients
linear_reaction_coefficients
(Recon_model)

Also, Escher has a gitter chat room where you may be able to get more help with all things related to Escher https://gitter.im/zakandrewking/escher.

Best,
Moritz
Reply all
Reply to author
Forward
0 new messages