In [1]:
import escher
import escher.server
import json
import os
from IPython.display import HTML

Load the Escher map using development versions of the JavaScript source

This requires that the local_host is passed to escher.Builder. local_host is the address of the local Escher server.


In [6]:
# grab some data
with open(os.path.abspath('../../escher/example_data/reaction_data_iJO1366.json'), 'r') as f:
    reaction_data = json.load(f)
# make a Builder, with a local server
b = escher.Builder(map_name='iJO1366.Central metabolism',
                   model_name='iJO1366',
                   reaction_data=reaction_data,
                   local_host='http://localhost:7778/',
                   reaction_styles=['color', 'size', 'abs'])

In [7]:
b.display_in_notebook(js_source='dev')


Out[7]:

Use the Escher maps in an notebook without a network connection

Providing a local_host also allows you to run Escher offline in the IPython notebook.


In [8]:
# locally available maps
escher.list_cached_maps()


Out[8]:
[{'map_name': 'e_coli_core.Core metabolism', 'organism': 'Escherichia coli'},
 {'map_name': 'iJO1366.Central metabolism', 'organism': 'Escherichia coli'}]

In [9]:
b = escher.Builder(map_name='e_coli_core.Core metabolism',
                   local_host='http://localhost:7778')
b.display_in_notebook(js_source='local')


Out[9]:

In [ ]: