In [3]:
from om import base, settings
from om.components import *
from om.data import *
from om.util import *

import pandas as pd
import numpy as np
import math,cobra

import escher
import escher.server
import json
import os
from IPython.display import HTML


session = base.Session()

from IPython.html.widgets import interact, interactive, fixed
from IPython.html import widgets
from IPython.display import clear_output, display, HTML

escher.clear_cache()
d = escher.server.directory
#with open(os.path.join(d, 'example_data/reaction_data_iJO1366.json')) as f:
#    reaction_data = json.load(f)

In [4]:
def show_name(dataset):
    rxn_data = {rxn_id:get_reaction_data(rxn_id, dataset)*20 for rxn_id in reaction_data.keys()}
    b2 = escher.Builder(map_json='/Users/dbuser/escher-maps/v1/iJO1366/iJO1366_central_metabolism.json',
                        model_json='/Users/dbuser/escher/escher/example_data/iJO1366.json',
                        reaction_data=rxn_data)
    display(b2.display_in_notebook())

In [5]:
x = interact(show_name, dataset=widgets.ToggleButtonsWidget(values=[x.name for x in session.query(DifferentialExpression).limit(3).all()]))


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-619403fc5200> in show_name(dataset)
      1 def show_name(dataset):
----> 2     rxn_data = {rxn_id:get_reaction_data(rxn_id, dataset)*20 for rxn_id in reaction_data.keys()}
      3     b2 = escher.Builder(map_json='/Users/dbuser/escher-maps/v1/iJO1366/iJO1366_central_metabolism.json',
      4                         model_json='/Users/dbuser/escher/escher/example_data/iJO1366.json',
      5                         reaction_data=rxn_data)

NameError: global name 'reaction_data' is not defined

In [9]:
get_regulation_data('GAPD')


Out[9]:
dataset regulator strain carbon_source nitrogen_source electron_acceptor gene type value
2 338 Crp delta-crp fructose NH4Cl O2 gapA transcriptional 0.79729
3 352 Crp delta-crp glycerol NH4Cl O2 gapA transcriptional -1.00276
0 352 Crp wt glycerol NH4Cl O2 gapA transcriptional -1.00276
1 338 Crp wt fructose NH4Cl O2 gapA transcriptional 0.79729

In [ ]: