{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Analyzing models with\n", "\n", "\n", "\n", "**c**omputer **a**ided **m**etabolic **e**ngineering and **o**ptimization\n", "\n", "**cameo** uses and extends the model data structures defined by [cobrapy](https://opencobra.github.io/cobrapy/), our favorite **CO**nstraints-**B**ased **R**econstruction and **A**nalysis tool for **Py**thon. **cameo** is thus 100% compatible with **cobrapy**. For efficiency reasons though **cameo** implements its own analysis methods that take advantage of a more advanced solver interface." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ " \n", " \n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from cameo import load_model\n", "model = load_model(\"iJO1366\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Flux Variability Analysis\n", "\n", "Flux variability analysis (FVA) enables the computation of lower and upper bounds of reaction fluxes." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from cameo import flux_variability_analysis" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
lower_boundupper_bound
EX_glc_lp_e_rp_-10.00-0.134043
PGI-254.35241.850000
\n", "
" ], "text/plain": [ " lower_bound upper_bound\n", "EX_glc_lp_e_rp_ -10.00 -0.134043\n", "PGI -254.35 241.850000" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "flux_variability_analysis(model, reactions=[model.reactions.PGI, model.reactions.EX_glc_lp_e_rp_])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "One very useful application of FVA is determining if alternative optimal solution exist." ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
lower_boundupper_bound
EX_glc_lp_e_rp_-10.000000-10.000000
PGI5.9180655.918065
\n", "
" ], "text/plain": [ " lower_bound upper_bound\n", "EX_glc_lp_e_rp_ -10.000000 -10.000000\n", "PGI 5.918065 5.918065" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "flux_variability_analysis(model, reactions=[model.reactions.PGI, model.reactions.EX_glc_lp_e_rp_],\n", " fraction_of_optimum=1.)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Phenotpic Phase Plane\n", "--------------------" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "model.reactions.EX_o2_lp_e_rp_.lower_bound = -10\n", "result = analysis.phenotypic_phase_plane(model, \n", " variables=[model.reactions.BiomassEcoli],\n", " objective=model.reactions.EX_succ_lp_e_rp_,\n", " points=10)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "result.plot(height=400)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "result.data_frame" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.4.3" } }, "nbformat": 4, "nbformat_minor": 0 }