{ "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": [ "\n", " Ec_biomass_iJO1366_core_53p95M 0.000000\n", " EX_succ_lp_e_rp_ 17.096429\n", "
\n", " " ], "text/plain": [ "