{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Differential flux variability analysis" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ " \n", " \n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ ":0 \u001b[1;31mFutureWarning\u001b[0m: IPython widgets are experimental and may change in the future.\n" ] } ], "source": [ "from cameo import load_model\n", "from cameo.flux_analysis.analysis import phenotypic_phase_plane\n", "from cameo.strain_design.deterministic import DifferentialFVA" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### E. coli model and succinate production" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Load the E. coli core model." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "model = load_model('iJO1366')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The production envelope looks like this." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", "\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "production_envelope = phenotypic_phase_plane(model, \n", " variables=[model.reactions.Ec_biomass_iJO1366_core_53p95M],\n", " objective=model.reactions.EX_succ_lp_e_rp_)\n", "production_envelope.plot(height=300)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Set up a model that represents a reference state (in this case a model with a constrained growth rate)." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [], "source": [ "reference_model = model.copy()\n", "biomass_rxn = reference_model.reactions.Ec_biomass_iJO1366_core_53p95M\n", "biomass_rxn.lower_bound = 0.3\n", "target = reference_model.reactions.EX_succ_lp_e_rp_\n", "target.lower_bound = 2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Set up the differential flux variability analysis strain design method." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [], "source": [ "diffFVA = DifferentialFVA(design_space_model=model,\n", " reference_model=reference_model,\n", " objective=target,\n", " variables=[biomass_rxn],\n", " normalize_ranges_by=biomass_rxn,\n", " points=10)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Run differential flux variability analysis (only on the surface of the production envelope)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "Scanning grid points  0%" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').val('0')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').html('0%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').val('1')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').html('12%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').val('2')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').html('25%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').val('3')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').html('37%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').val('4')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').html('50%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').val('5')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').html('62%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').val('6')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').html('75%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').val('7')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').html('87%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').val('8')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').html('100%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').val('8')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "jQuery('#perc-progress-bar-e0e063b4-9497-44f7-9d60-09762fe86521').html('100%')" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "
\n", "\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "result = diffFVA.run(surface_only=True)\n", "result.plot(height=300)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false, "scrolled": false }, "outputs": [ { "data": { "text/html": [ "\n", "

\n", " Ec_biomass_iJO1366_core_53p95M 0.000000
\n", " EX_succ_lp_e_rp_ 17.096429\n", "

\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "if(window.escher_builders == undefined) {\n", "\twindow.escher_builders = {};\n", "}" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", "\n", " \n", " \n", " \n", "\n", " \n", " \n", "\n", "\n", "\n", "
\n", "\n", " \n", " \n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "result.display_on_map(\"iJO1366.Central metabolism\")" ] }, { "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 }