-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added pathway visualization example notebook.
- Loading branch information
1 parent
f0f1345
commit 7b8e795
Showing
2 changed files
with
107 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"from cameo import load_model" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"iJO1366 = load_model('iJO1366')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"solution = iJO1366.solve()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"from escher import Builder" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"ename": "ValueError", | ||
"evalue": "too many values to unpack", | ||
"output_type": "error", | ||
"traceback": [ | ||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | ||
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", | ||
"\u001b[0;32m<ipython-input-10-cc9dea1dbb37>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mpathway\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mBuilder\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmap_name\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'iJO1366.Central metabolism'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreaction_data\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0mreaction\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mflux\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mreaction\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mflux\u001b[0m \u001b[0;32min\u001b[0m \u001b[0msolution\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfluxes\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mabs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mflux\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m1e-6\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mpathway\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdisplay_in_notebook\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", | ||
"\u001b[0;32m<ipython-input-10-cc9dea1dbb37>\u001b[0m in \u001b[0;36m<dictcomp>\u001b[0;34m(***failed resolving arguments***)\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mpathway\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mBuilder\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmap_name\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'iJO1366.Central metabolism'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreaction_data\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0mreaction\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mflux\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mreaction\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mflux\u001b[0m \u001b[0;32min\u001b[0m \u001b[0msolution\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfluxes\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mabs\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mflux\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m1e-6\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mpathway\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdisplay_in_notebook\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", | ||
"\u001b[0;31mValueError\u001b[0m: too many values to unpack" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"pathway = Builder(map_name='iJO1366.Central metabolism', reaction_data={reaction: flux for reaction, flux in solution.fluxes if abs(flux) > 1e-6})\n", | ||
"pathway.display_in_notebook()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 2", | ||
"language": "python", | ||
"name": "python2" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 2 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython2", | ||
"version": "2.7.9" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.