예제 #1
0
get_ipython().getoutput("wget -nc http://bigg.ucsd.edu/static/models/iJO1366.json")
builder.model = cobra.io.load_json_model('iJO1366.json')


# Run FBA with the model and add the flux data to the map
solution = builder.model.optimize()
builder.reaction_data = solution.fluxes


# Add some data for metabolites
builder.metabolite_data = solution.shadow_prices


# Simplify the map by hiding some labels
builder.hide_secondary_metabolites = True
builder.hide_all_labels = True


builder.reaction_scale = [
    { 'type': 'min', 'color': '#000000', 'size': 12 },
    { 'type': 'median', 'color': '#ffffff', 'size': 20 },
    { 'type': 'max', 'color': '#ff0000', 'size': 25 }
]


builder.reaction_scale_preset = 'GaBuRd'


# Make all the arrows three times as thick
builder.reaction_scale = [
    {k: v * 3 if k == 'size' else v for k, v in x.items()}