{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Analyzing models\n", "\n", "**cameo** uses 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": {}, "outputs": [], "source": [ "from cameo import models\n", "model = models.bigg.e_coli_core" ] }, { "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": 2, "metadata": {}, "outputs": [], "source": [ "from cameo import flux_variability_analysis" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
lower_boundupper_bound
ACALD-20.0000000.000000
ACALDt-20.0000000.000000
ACKr-20.0000000.000000
ACONTa0.00000020.000000
ACONTb0.00000020.000000
ACt2r-20.0000000.000000
ADK10.000000166.610000
AKGDH0.00000020.000000
AKGt2r-10.0000000.000000
ALCD2x-20.0000000.000000
ATPM8.390000175.000000
ATPS4r-31.610000150.000000
BIOMASS_Ecoli_core_w_GAM0.0000000.873922
CO2t-60.00000011.104242
CS0.00000020.000000
CYTBD0.000000120.000000
D_LACt2-20.0000000.000000
ENO0.00000020.000000
ETOHt2r-20.0000000.000000
EX_ac_e0.00000020.000000
EX_acald_e0.00000020.000000
EX_akg_e0.00000010.000000
EX_co2_e-11.10424260.000000
EX_etoh_e0.00000020.000000
EX_for_e0.00000040.000000
EX_fru_e0.0000000.000000
EX_fum_e0.0000000.000000
EX_glc__D_e-10.000000-0.479429
EX_gln__L_e0.0000000.000000
EX_glu__L_e0.00000010.000000
.........
ME20.00000098.305000
NADH160.000000120.000000
NADTRHD0.000000378.220000
NH4t0.00000010.000000
O2t0.00000060.000000
PDH0.00000040.000000
PFK0.000000176.610000
PFL0.00000040.000000
PGI-50.00000010.000000
PGK-20.0000000.000000
PGL0.00000060.000000
PGM-20.0000000.000000
PIt2r0.0000003.214895
PPC0.000000166.610000
PPCK0.000000166.610000
PPS0.000000166.610000
PTAr0.00000020.000000
PYK0.000000176.610000
PYRt2-20.0000000.000000
RPE-0.62090940.000000
RPI-20.0000000.000000
SUCCt2_20.000000222.146667
SUCCt30.000000222.146667
SUCDi0.0000001000.000000
SUCOAS-20.0000000.000000
TALA-0.15453620.000000
THD20.000000333.220000
TKT1-0.15453620.000000
TKT2-0.46637320.000000
TPI-10.00000010.000000
\n", "

95 rows × 2 columns

\n", "
" ], "text/plain": [ " lower_bound upper_bound\n", "ACALD -20.000000 0.000000\n", "ACALDt -20.000000 0.000000\n", "ACKr -20.000000 0.000000\n", "ACONTa 0.000000 20.000000\n", "ACONTb 0.000000 20.000000\n", "ACt2r -20.000000 0.000000\n", "ADK1 0.000000 166.610000\n", "AKGDH 0.000000 20.000000\n", "AKGt2r -10.000000 0.000000\n", "ALCD2x -20.000000 0.000000\n", "ATPM 8.390000 175.000000\n", "ATPS4r -31.610000 150.000000\n", "BIOMASS_Ecoli_core_w_GAM 0.000000 0.873922\n", "CO2t -60.000000 11.104242\n", "CS 0.000000 20.000000\n", "CYTBD 0.000000 120.000000\n", "D_LACt2 -20.000000 0.000000\n", "ENO 0.000000 20.000000\n", "ETOHt2r -20.000000 0.000000\n", "EX_ac_e 0.000000 20.000000\n", "EX_acald_e 0.000000 20.000000\n", "EX_akg_e 0.000000 10.000000\n", "EX_co2_e -11.104242 60.000000\n", "EX_etoh_e 0.000000 20.000000\n", "EX_for_e 0.000000 40.000000\n", "EX_fru_e 0.000000 0.000000\n", "EX_fum_e 0.000000 0.000000\n", "EX_glc__D_e -10.000000 -0.479429\n", "EX_gln__L_e 0.000000 0.000000\n", "EX_glu__L_e 0.000000 10.000000\n", "... ... ...\n", "ME2 0.000000 98.305000\n", "NADH16 0.000000 120.000000\n", "NADTRHD 0.000000 378.220000\n", "NH4t 0.000000 10.000000\n", "O2t 0.000000 60.000000\n", "PDH 0.000000 40.000000\n", "PFK 0.000000 176.610000\n", "PFL 0.000000 40.000000\n", "PGI -50.000000 10.000000\n", "PGK -20.000000 0.000000\n", "PGL 0.000000 60.000000\n", "PGM -20.000000 0.000000\n", "PIt2r 0.000000 3.214895\n", "PPC 0.000000 166.610000\n", "PPCK 0.000000 166.610000\n", "PPS 0.000000 166.610000\n", "PTAr 0.000000 20.000000\n", "PYK 0.000000 176.610000\n", "PYRt2 -20.000000 0.000000\n", "RPE -0.620909 40.000000\n", "RPI -20.000000 0.000000\n", "SUCCt2_2 0.000000 222.146667\n", "SUCCt3 0.000000 222.146667\n", "SUCDi 0.000000 1000.000000\n", "SUCOAS -20.000000 0.000000\n", "TALA -0.154536 20.000000\n", "THD2 0.000000 333.220000\n", "TKT1 -0.154536 20.000000\n", "TKT2 -0.466373 20.000000\n", "TPI -10.000000 10.000000\n", "\n", "[95 rows x 2 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fva_result = flux_variability_analysis(model)\n", "fva_result.data_frame" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/vnd.plotly.v1+html": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "data": [ { "fillcolor": "#B3E2CD", "hoverinfo": "none", "mode": "markers", "name": "WT", "opacity": 0.3, "type": "scatter", "x": [ -10, -10, -10, 10, 10, -10, 83.305, 10, -5, -10, 91.695, 59.19499999999997, 0.4369607534842152, -24.447878787878786, 10, 60, -10, 10, -10, 10, 10, 5, 24.447878787878786, 10, 20 ], "y": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ] } ], "layout": { "height": 432, "shapes": [ { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -20, "y0": 0.5, "y1": 1.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -20, "y0": 1.5, "y1": 2.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -20, "y0": 2.5, "y1": 3.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 20, "x1": 0, "y0": 3.5, "y1": 4.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 20, "x1": 0, "y0": 4.5, "y1": 5.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -20, "y0": 5.5, "y1": 6.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 166.61, "x1": 0, "y0": 6.5, "y1": 7.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 20, "x1": 0, "y0": 7.5, "y1": 8.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -10, "y0": 8.5, "y1": 9.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -20, "y0": 9.5, "y1": 10.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 175, "x1": 8.39, "y0": 10.5, "y1": 11.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 149.99999999999994, "x1": -31.61, "y0": 11.5, "y1": 12.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0.8739215069684304, "x1": 0, "y0": 12.5, "y1": 13.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 11.104242424242424, "x1": -59.99999999999999, "y0": 13.5, "y1": 14.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 20, "x1": 0, "y0": 14.5, "y1": 15.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 120, "x1": 0, "y0": 15.5, "y1": 16.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -20, "y0": 16.5, "y1": 17.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 20, "x1": 0, "y0": 17.5, "y1": 18.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -20, "y0": 18.5, "y1": 19.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 20, "x1": 0, "y0": 19.5, "y1": 20.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 20, "x1": 0, "y0": 20.5, "y1": 21.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 10, "x1": 0, "y0": 21.5, "y1": 22.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 59.99999999999999, "x1": -11.104242424242424, "y0": 22.5, "y1": 23.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 20, "x1": 0, "y0": 23.5, "y1": 24.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 40, "x1": 0, "y0": 24.5, "y1": 25.5 } ], "title": "Flux Variability Analysis", "width": 700, "xaxis": { "title": "Flux limits" }, "yaxis": { "ticktext": [ "", "ACALD", "ACALDt", "ACKr", "ACONTa", "ACONTb", "ACt2r", "ADK1", "AKGDH", "AKGt2r", "ALCD2x", "ATPM", "ATPS4r", "BIOMASS_Ecoli_core_w_GAM", "CO2t", "CS", "CYTBD", "D_LACt2", "ENO", "ETOHt2r", "EX_ac_e", "EX_acald_e", "EX_akg_e", "EX_co2_e", "EX_etoh_e", "EX_for_e" ], "tickvals": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ], "title": "Reactions" } } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fva_result.plot(index=fva_result.data_frame.index[:25])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "One very useful application of FVA is determining if alternative optimal solution exist." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
lower_boundupper_bound
ACALD-12.6024530.000000
ACALDt-12.6024530.000000
ACKr-13.3588520.000000
ACONTa0.47143713.830289
ACONTb0.47143713.830289
ACt2r-13.3588520.000000
ADK10.00000084.338330
AKGDH0.00000013.358852
AKGt2r-6.6794260.000000
ALCD2x-11.0716130.000000
ATPM8.39000092.728330
ATPS4r5.29867799.656146
BIOMASS_Ecoli_core_w_GAM0.4369610.873922
CO2t-41.4049170.925477
CS0.47143713.830289
CYTBD12.51755381.799493
D_LACt2-10.7256250.000000
ENO4.82588218.184734
ETOHt2r-11.0716130.000000
EX_ac_e0.00000013.358852
EX_acald_e0.00000012.602453
EX_akg_e0.0000006.679426
EX_co2_e-0.92547741.404917
EX_etoh_e0.00000011.071613
EX_for_e0.00000028.826782
EX_fru_e0.0000000.000000
EX_fum_e0.0000000.000000
EX_glc__D_e-10.000000-5.233056
EX_gln__L_e0.0000000.000000
EX_glu__L_e0.0000006.281521
.........
ME20.00000052.201468
NADH1612.51755381.799493
NADTRHD0.000000193.989678
NH4t2.3826608.664181
O2t6.25877640.899746
PDH0.00000028.826782
PFK0.00000093.903685
PFL0.00000028.826782
PGI-30.1661339.910423
PGK-18.838427-5.479575
PGL0.00000040.076556
PGM-18.184734-4.825882
PIt2r1.6074483.214895
PPC0.00000085.590485
PPCK0.00000084.338330
PPS0.00000084.338330
PTAr0.00000013.358852
PYK0.00000092.296238
PYRt2-12.6024530.000000
RPE-0.62090926.403617
RPI-13.672939-0.314087
SUCCt2_20.000000112.451107
SUCCt30.000000112.451107
SUCDi0.0000001000.000000
SUCOAS-13.3588520.000000
TALA-0.15453613.280680
THD20.000000168.676660
TKT1-0.15453613.280680
TKT2-0.46637313.122937
TPI-3.7934979.565355
\n", "

95 rows × 2 columns

\n", "
" ], "text/plain": [ " lower_bound upper_bound\n", "ACALD -12.602453 0.000000\n", "ACALDt -12.602453 0.000000\n", "ACKr -13.358852 0.000000\n", "ACONTa 0.471437 13.830289\n", "ACONTb 0.471437 13.830289\n", "ACt2r -13.358852 0.000000\n", "ADK1 0.000000 84.338330\n", "AKGDH 0.000000 13.358852\n", "AKGt2r -6.679426 0.000000\n", "ALCD2x -11.071613 0.000000\n", "ATPM 8.390000 92.728330\n", "ATPS4r 5.298677 99.656146\n", "BIOMASS_Ecoli_core_w_GAM 0.436961 0.873922\n", "CO2t -41.404917 0.925477\n", "CS 0.471437 13.830289\n", "CYTBD 12.517553 81.799493\n", "D_LACt2 -10.725625 0.000000\n", "ENO 4.825882 18.184734\n", "ETOHt2r -11.071613 0.000000\n", "EX_ac_e 0.000000 13.358852\n", "EX_acald_e 0.000000 12.602453\n", "EX_akg_e 0.000000 6.679426\n", "EX_co2_e -0.925477 41.404917\n", "EX_etoh_e 0.000000 11.071613\n", "EX_for_e 0.000000 28.826782\n", "EX_fru_e 0.000000 0.000000\n", "EX_fum_e 0.000000 0.000000\n", "EX_glc__D_e -10.000000 -5.233056\n", "EX_gln__L_e 0.000000 0.000000\n", "EX_glu__L_e 0.000000 6.281521\n", "... ... ...\n", "ME2 0.000000 52.201468\n", "NADH16 12.517553 81.799493\n", "NADTRHD 0.000000 193.989678\n", "NH4t 2.382660 8.664181\n", "O2t 6.258776 40.899746\n", "PDH 0.000000 28.826782\n", "PFK 0.000000 93.903685\n", "PFL 0.000000 28.826782\n", "PGI -30.166133 9.910423\n", "PGK -18.838427 -5.479575\n", "PGL 0.000000 40.076556\n", "PGM -18.184734 -4.825882\n", "PIt2r 1.607448 3.214895\n", "PPC 0.000000 85.590485\n", "PPCK 0.000000 84.338330\n", "PPS 0.000000 84.338330\n", "PTAr 0.000000 13.358852\n", "PYK 0.000000 92.296238\n", "PYRt2 -12.602453 0.000000\n", "RPE -0.620909 26.403617\n", "RPI -13.672939 -0.314087\n", "SUCCt2_2 0.000000 112.451107\n", "SUCCt3 0.000000 112.451107\n", "SUCDi 0.000000 1000.000000\n", "SUCOAS -13.358852 0.000000\n", "TALA -0.154536 13.280680\n", "THD2 0.000000 168.676660\n", "TKT1 -0.154536 13.280680\n", "TKT2 -0.466373 13.122937\n", "TPI -3.793497 9.565355\n", "\n", "[95 rows x 2 columns]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fva_result2 = flux_variability_analysis(model,fraction_of_optimum=0.5)\n", "fva_result2.data_frame" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "fillcolor": "#B3E2CD", "hoverinfo": "none", "mode": "markers", "name": "WT", "opacity": 0.3, "type": "scatter", "x": [ -6.301226350813717, -6.301226350813717, -6.679425994085078, 7.150862951019199, 7.150862951019199, -6.679425994085078, 42.16916509839322, 6.67942599408508, -3.33971299704254, -5.535806451612918 ], "y": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] } ], "layout": { "height": 432, "shapes": [ { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -12.602452701627435, "y0": 0.5, "y1": 1.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -12.602452701627435, "y0": 1.5, "y1": 2.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -13.358851988170157, "y0": 2.5, "y1": 3.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 13.830288945104279, "x1": 0.47143695693411947, "y0": 3.5, "y1": 4.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 13.830288945104279, "x1": 0.47143695693411947, "y0": 4.5, "y1": 5.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -13.358851988170157, "y0": 5.5, "y1": 6.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 84.33833019678644, "x1": 0, "y0": 6.5, "y1": 7.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 13.35885198817016, "x1": 0, "y0": 7.5, "y1": 8.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -6.67942599408508, "y0": 8.5, "y1": 9.5 }, { "fillcolor": "#B3E2CD", "line": { "color": "#B3E2CD", "width": 0 }, "opacity": 0.3, "type": "rect", "x0": 0, "x1": -11.071612903225835, "y0": 9.5, "y1": 10.5 } ], "title": "Flux Variability Analysis", "width": 700, "xaxis": { "title": "Flux limits" }, "yaxis": { "ticktext": [ "", "ACALD", "ACALDt", "ACKr", "ACONTa", "ACONTb", "ACt2r", "ADK1", "AKGDH", "AKGt2r", "ALCD2x" ], "tickvals": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], "title": "Reactions" } } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fva_result2.plot()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "from cameo.visualization import plotting" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Phenotypic Phase Plane\n", "--------------------\n", "\n", "The phenotypic phase plane is a modeling technique was developed to do a theoretical accessement of what cell can or cannot do in terms of the stoichiometric constraints [Edawards *et al.* 2001]. \n", "\n", "The phenotipic phase plane between growth and a product of interest yields the production envelope: a representation between the trade of between production of the desired product and growth." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "from cameo import phenotypic_phase_plane" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "model.reactions.EX_o2_e.lower_bound = -10\n", "result = phenotypic_phase_plane(model, \n", " variables=[model.reactions.BIOMASS_Ecoli_core_w_GAM],\n", " objective=model.reactions.EX_succ_e,\n", " points=10)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "fill": "toself", "fillcolor": "#B3E2CD", "hoverinfo": "none", "marker": { "line": { "color": "#B3E2CD" }, "opacity": 0.3 }, "mode": "line", "name": "WT", "opacity": 0.3, "type": "scatter", "x": [ 0, 0.06211673330133617, 0.12423346660267234, 0.18635019990400853, 0.2484669332053447, 0.31058366650668084, 0.37270039980801706, 0.4348171331093532, 0.4969338664106894, 0.5590505997120255, 0.5590505997120255, 0.4969338664106894, 0.4348171331093532, 0.37270039980801706, 0.31058366650668084, 0.2484669332053447, 0.18635019990400853, 0.12423346660267234, 0.06211673330133617, 0, 0, 0 ], "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4.3798766917375955, 6.814195460874885, 9.190730513378575, 10.684340589920453, 11.83019587619151, 12.97407991251248, 14.110775497230406, 15.24747108194856, 16.3841666666666, 0, 16.3841666666666 ] } ], "layout": { "height": 432, "title": "Phenotypic Phase Plane (flux)", "width": 700, "xaxis": { "title": "BIOMASS_Ecoli_core_w_GAM [h^-1]" }, "yaxis": { "title": "EX_succ_e [mmol gDW^-1 h^-1]" } } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "result.plot()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The production envelope allows is a quick way to inspect the limitations of the system to design and how the production relates for with growth. In the previous example, succinate prudction is completly decoupled from growth and by decreasing the growth rate it is theoretically possible to produce up to 15 times more succinate. " ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "fill": "toself", "fillcolor": "#B3E2CD", "hoverinfo": "none", "marker": { "line": { "color": "#B3E2CD" }, "opacity": 0.3 }, "mode": "line", "name": "WT", "opacity": 0.3, "type": "scatter", "x": [ 0, 0.06211673330133617, 0.12423346660267234, 0.18635019990400853, 0.2484669332053447, 0.31058366650668084, 0.37270039980801706, 0.4348171331093532, 0.4969338664106894, 0.5590505997120255, 0.5590505997120255, 0.4969338664106894, 0.4348171331093532, 0.37270039980801706, 0.31058366650668084, 0.2484669332053447, 0.18635019990400853, 0.12423346660267234, 0.06211673330133617, 0, 0, 0 ], "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4.3798766917375955, 6.814195460874885, 9.190730513378575, 10.684340589920453, 11.83019587619151, 12.97407991251248, 14.110775497230406, 15.24747108194856, 16.3841666666666, 0, 16.3841666666666 ] }, { "marker": { "color": [ "green", "red" ] }, "mode": "markers", "name": "Data Points", "type": "scatter", "x": [ 0.52, 0.23 ], "y": [ 0, 12.2 ] } ], "layout": { "height": 432, "title": "Phenotypic Phase Plane (flux)", "width": 700, "xaxis": { "title": "BIOMASS_Ecoli_core_w_GAM [h^-1]" }, "yaxis": { "title": "EX_succ_e [mmol gDW^-1 h^-1]" } } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "result.plot(points=[(0.52, 0), (0.23, 12.2)], points_colors=[\"green\", \"red\"])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The production envelope can show the coupling between growth and production. There is no stoichiometric couple between growth and production for succinate under aerobic conditions, but that is not the case for acetate under anaerobic conditions." ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "fill": "toself", "fillcolor": "#B3E2CD", "hoverinfo": "none", "marker": { "line": { "color": "#B3E2CD" }, "opacity": 0.3 }, "mode": "line", "name": "WT", "opacity": 0.3, "type": "scatter", "x": [ 0, 0.029423715774317058, 0.058847431548634116, 0.08827114732295117, 0.11769486309726823, 0.1471185788715853, 0.17654229464590235, 0.2059660104202194, 0.23538972619453646, 0.26481344196885354, 0.2942371577431706, 0.3236608735174876, 0.3530845892918047, 0.38250830506612177, 0.4119320208404388, 0.44135573661475586, 0.4707794523890729, 0.5002031681633899, 0.5296268839377071, 0.5590505997120241, 0.5590505997120241, 0.5296268839377071, 0.5002031681633899, 0.4707794523890729, 0.44135573661475586, 0.4119320208404388, 0.38250830506612177, 0.3530845892918047, 0.3236608735174876, 0.2942371577431706, 0.26481344196885354, 0.23538972619453646, 0.2059660104202194, 0.17654229464590235, 0.1471185788715853, 0.11769486309726823, 0.08827114732295117, 0.058847431548634116, 0.029423715774317058, 0, 0, 0 ], "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.627960120303466, 9.905679878989176, 11.503269460276801, 11.950465804472762, 12.397662148668719, 12.844858492864677, 13.292054837060633, 13.739251181256595, 14.186447525452547, 14.63364386964851, 15.080840213844464, 15.528036558040423, 15.97523290223638, 16.422429246432337, 16.869625590628296, 17.31682193482426, 17.764018279020206, 18.211214623216172, 18.658410967412124, 19.105607311608082, 19.55280365580404, 20, 0, 20 ] } ], "layout": { "height": 432, "title": "Phenotypic Phase Plane (flux)", "width": 700, "xaxis": { "title": "BIOMASS_Ecoli_core_w_GAM [h^-1]" }, "yaxis": { "title": "EX_ac_e [mmol gDW^-1 h^-1]" } } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "result = phenotypic_phase_plane(model, \n", " variables=[model.reactions.BIOMASS_Ecoli_core_w_GAM],\n", " objective=model.reactions.EX_ac_e)\n", "result.plot()" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
BIOMASS_Ecoli_core_w_GAMobjective_lower_boundobjective_upper_boundc_yield_lower_boundc_yield_upper_boundmass_yield_lower_boundmass_yield_upper_bound
00.0000000.0000020.0000000.0000000.6666670.0000000.655477
10.0294240.0000019.5528040.0000000.6517600.0000000.640821
20.0588470.0000019.1056070.0000000.6368540.0000000.626164
30.0882710.0000018.6584110.0000000.6219470.0000000.611508
40.1176950.0000018.2112150.0000000.6070400.0000000.596852
50.1471190.0000017.7640180.0000000.5921340.0000000.582195
60.1765420.0000017.3168220.0000000.5772270.0000000.567539
70.2059660.0000016.8696260.0000000.5623210.0000000.552883
80.2353900.0000016.4224290.0000000.5474140.0000000.538226
90.2648130.0000015.9752330.0000000.5325080.0000000.523570
100.2942370.0000015.5280370.0000000.5176010.0000000.508914
110.3236610.0000015.0808400.0000000.5026950.0000000.494257
120.3530850.0000014.6336440.0000000.4877880.0000000.479601
130.3825080.0000014.1864480.0000000.4728820.0000000.464945
140.4119320.0000013.7392510.0000000.4579750.0000000.450288
150.4413560.0000013.2920550.0000000.4430680.0000000.435632
160.4707790.0000012.8448580.0000000.4281620.0000000.420975
170.5002030.0000012.3976620.0000000.4132550.0000000.406319
180.5296272.6279611.9504660.0875990.3983490.0861280.391663
190.5590519.9056811.5032690.3301890.3834420.3246470.377006
\n", "
" ], "text/plain": [ " BIOMASS_Ecoli_core_w_GAM objective_lower_bound objective_upper_bound \\\n", "0 0.000000 0.00000 20.000000 \n", "1 0.029424 0.00000 19.552804 \n", "2 0.058847 0.00000 19.105607 \n", "3 0.088271 0.00000 18.658411 \n", "4 0.117695 0.00000 18.211215 \n", "5 0.147119 0.00000 17.764018 \n", "6 0.176542 0.00000 17.316822 \n", "7 0.205966 0.00000 16.869626 \n", "8 0.235390 0.00000 16.422429 \n", "9 0.264813 0.00000 15.975233 \n", "10 0.294237 0.00000 15.528037 \n", "11 0.323661 0.00000 15.080840 \n", "12 0.353085 0.00000 14.633644 \n", "13 0.382508 0.00000 14.186448 \n", "14 0.411932 0.00000 13.739251 \n", "15 0.441356 0.00000 13.292055 \n", "16 0.470779 0.00000 12.844858 \n", "17 0.500203 0.00000 12.397662 \n", "18 0.529627 2.62796 11.950466 \n", "19 0.559051 9.90568 11.503269 \n", "\n", " c_yield_lower_bound c_yield_upper_bound mass_yield_lower_bound \\\n", "0 0.000000 0.666667 0.000000 \n", "1 0.000000 0.651760 0.000000 \n", "2 0.000000 0.636854 0.000000 \n", "3 0.000000 0.621947 0.000000 \n", "4 0.000000 0.607040 0.000000 \n", "5 0.000000 0.592134 0.000000 \n", "6 0.000000 0.577227 0.000000 \n", "7 0.000000 0.562321 0.000000 \n", "8 0.000000 0.547414 0.000000 \n", "9 0.000000 0.532508 0.000000 \n", "10 0.000000 0.517601 0.000000 \n", "11 0.000000 0.502695 0.000000 \n", "12 0.000000 0.487788 0.000000 \n", "13 0.000000 0.472882 0.000000 \n", "14 0.000000 0.457975 0.000000 \n", "15 0.000000 0.443068 0.000000 \n", "16 0.000000 0.428162 0.000000 \n", "17 0.000000 0.413255 0.000000 \n", "18 0.087599 0.398349 0.086128 \n", "19 0.330189 0.383442 0.324647 \n", "\n", " mass_yield_upper_bound \n", "0 0.655477 \n", "1 0.640821 \n", "2 0.626164 \n", "3 0.611508 \n", "4 0.596852 \n", "5 0.582195 \n", "6 0.567539 \n", "7 0.552883 \n", "8 0.538226 \n", "9 0.523570 \n", "10 0.508914 \n", "11 0.494257 \n", "12 0.479601 \n", "13 0.464945 \n", "14 0.450288 \n", "15 0.435632 \n", "16 0.420975 \n", "17 0.406319 \n", "18 0.391663 \n", "19 0.377006 " ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result.data_frame" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "One can immediately see if a design is feasible within the new defined constraints." ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "fill": "toself", "fillcolor": "#B3E2CD", "hoverinfo": "none", "marker": { "line": { "color": "#B3E2CD" }, "opacity": 0.3 }, "mode": "line", "name": "WT", "opacity": 0.3, "type": "scatter", "x": [ 0, 0.029423715774317058, 0.058847431548634116, 0.08827114732295117, 0.11769486309726823, 0.1471185788715853, 0.17654229464590235, 0.2059660104202194, 0.23538972619453646, 0.26481344196885354, 0.2942371577431706, 0.3236608735174876, 0.3530845892918047, 0.38250830506612177, 0.4119320208404388, 0.44135573661475586, 0.4707794523890729, 0.5002031681633899, 0.5296268839377071, 0.5590505997120241, 0.5590505997120241, 0.5296268839377071, 0.5002031681633899, 0.4707794523890729, 0.44135573661475586, 0.4119320208404388, 0.38250830506612177, 0.3530845892918047, 0.3236608735174876, 0.2942371577431706, 0.26481344196885354, 0.23538972619453646, 0.2059660104202194, 0.17654229464590235, 0.1471185788715853, 0.11769486309726823, 0.08827114732295117, 0.058847431548634116, 0.029423715774317058, 0, 0, 0 ], "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.627960120303466, 9.905679878989176, 11.503269460276801, 11.950465804472762, 12.397662148668719, 12.844858492864677, 13.292054837060633, 13.739251181256595, 14.186447525452547, 14.63364386964851, 15.080840213844464, 15.528036558040423, 15.97523290223638, 16.422429246432337, 16.869625590628296, 17.31682193482426, 17.764018279020206, 18.211214623216172, 18.658410967412124, 19.105607311608082, 19.55280365580404, 20, 0, 20 ] }, { "marker": { "color": [ "green", "red" ] }, "mode": "markers", "name": "Data Points", "type": "scatter", "x": [ 0.2, 0.2 ], "y": [ 8, 2 ] } ], "layout": { "height": 432, "title": "Phenotypic Phase Plane (flux)", "width": 700, "xaxis": { "title": "BIOMASS_Ecoli_core_w_GAM [h^-1]" }, "yaxis": { "title": "EX_ac_e [mmol gDW^-1 h^-1]" } } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "result.plot(points=[(0.2, 8), (0.2, 2)], points_colors=[\"green\", \"red\"])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The computed data can be inspected in the format of a pandas data frame by calling `result.data_frame`" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
BIOMASS_Ecoli_core_w_GAMobjective_lower_boundobjective_upper_boundc_yield_lower_boundc_yield_upper_boundmass_yield_lower_boundmass_yield_upper_bound
00.0000000.0000020.0000000.0000000.6666670.0000000.655477
10.0294240.0000019.5528040.0000000.6517600.0000000.640821
20.0588470.0000019.1056070.0000000.6368540.0000000.626164
30.0882710.0000018.6584110.0000000.6219470.0000000.611508
40.1176950.0000018.2112150.0000000.6070400.0000000.596852
50.1471190.0000017.7640180.0000000.5921340.0000000.582195
60.1765420.0000017.3168220.0000000.5772270.0000000.567539
70.2059660.0000016.8696260.0000000.5623210.0000000.552883
80.2353900.0000016.4224290.0000000.5474140.0000000.538226
90.2648130.0000015.9752330.0000000.5325080.0000000.523570
100.2942370.0000015.5280370.0000000.5176010.0000000.508914
110.3236610.0000015.0808400.0000000.5026950.0000000.494257
120.3530850.0000014.6336440.0000000.4877880.0000000.479601
130.3825080.0000014.1864480.0000000.4728820.0000000.464945
140.4119320.0000013.7392510.0000000.4579750.0000000.450288
150.4413560.0000013.2920550.0000000.4430680.0000000.435632
160.4707790.0000012.8448580.0000000.4281620.0000000.420975
170.5002030.0000012.3976620.0000000.4132550.0000000.406319
180.5296272.6279611.9504660.0875990.3983490.0861280.391663
190.5590519.9056811.5032690.3301890.3834420.3246470.377006
\n", "
" ], "text/plain": [ " BIOMASS_Ecoli_core_w_GAM objective_lower_bound objective_upper_bound \\\n", "0 0.000000 0.00000 20.000000 \n", "1 0.029424 0.00000 19.552804 \n", "2 0.058847 0.00000 19.105607 \n", "3 0.088271 0.00000 18.658411 \n", "4 0.117695 0.00000 18.211215 \n", "5 0.147119 0.00000 17.764018 \n", "6 0.176542 0.00000 17.316822 \n", "7 0.205966 0.00000 16.869626 \n", "8 0.235390 0.00000 16.422429 \n", "9 0.264813 0.00000 15.975233 \n", "10 0.294237 0.00000 15.528037 \n", "11 0.323661 0.00000 15.080840 \n", "12 0.353085 0.00000 14.633644 \n", "13 0.382508 0.00000 14.186448 \n", "14 0.411932 0.00000 13.739251 \n", "15 0.441356 0.00000 13.292055 \n", "16 0.470779 0.00000 12.844858 \n", "17 0.500203 0.00000 12.397662 \n", "18 0.529627 2.62796 11.950466 \n", "19 0.559051 9.90568 11.503269 \n", "\n", " c_yield_lower_bound c_yield_upper_bound mass_yield_lower_bound \\\n", "0 0.000000 0.666667 0.000000 \n", "1 0.000000 0.651760 0.000000 \n", "2 0.000000 0.636854 0.000000 \n", "3 0.000000 0.621947 0.000000 \n", "4 0.000000 0.607040 0.000000 \n", "5 0.000000 0.592134 0.000000 \n", "6 0.000000 0.577227 0.000000 \n", "7 0.000000 0.562321 0.000000 \n", "8 0.000000 0.547414 0.000000 \n", "9 0.000000 0.532508 0.000000 \n", "10 0.000000 0.517601 0.000000 \n", "11 0.000000 0.502695 0.000000 \n", "12 0.000000 0.487788 0.000000 \n", "13 0.000000 0.472882 0.000000 \n", "14 0.000000 0.457975 0.000000 \n", "15 0.000000 0.443068 0.000000 \n", "16 0.000000 0.428162 0.000000 \n", "17 0.000000 0.413255 0.000000 \n", "18 0.087599 0.398349 0.086128 \n", "19 0.330189 0.383442 0.324647 \n", "\n", " mass_yield_upper_bound \n", "0 0.655477 \n", "1 0.640821 \n", "2 0.626164 \n", "3 0.611508 \n", "4 0.596852 \n", "5 0.582195 \n", "6 0.567539 \n", "7 0.552883 \n", "8 0.538226 \n", "9 0.523570 \n", "10 0.508914 \n", "11 0.494257 \n", "12 0.479601 \n", "13 0.464945 \n", "14 0.450288 \n", "15 0.435632 \n", "16 0.420975 \n", "17 0.406319 \n", "18 0.391663 \n", "19 0.377006 " ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result.data_frame" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "fill": "toself", "fillcolor": "#B3E2CD", "hoverinfo": "none", "marker": { "line": { "color": "#B3E2CD" }, "opacity": 0.3 }, "mode": "line", "name": "WT", "opacity": 0.3, "type": "scatter", "x": [ 0, 0.02351810552614555, 0.0470362110522911, 0.07055431657843665, 0.0940724221045822, 0.11759052763072776, 0.1411086331568733, 0.16462673868301886, 0.1881448442091644, 0.21166294973530997, 0.21166294973530997, 0.1881448442091644, 0.16462673868301886, 0.1411086331568733, 0.11759052763072776, 0.0940724221045822, 0.07055431657843665, 0.0470362110522911, 0.02351810552614555, 0, 0, 0 ], "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 8.503585277961015, 8.503585277961303, 8.669853580410049, 8.836121882858794, 9.002390185307537, 9.168658487756279, 9.334926790205028, 9.501195092653768, 9.667463395102514, 9.833731697551253, 10, 0, 10 ] } ], "layout": { "height": 432, "title": "Phenotypic Phase Plane (flux)", "width": 700, "xaxis": { "title": "BIOMASS_Ecoli_core_w_GAM [h^-1]" }, "yaxis": { "title": "EX_ac_e [mmol gDW^-1 h^-1]" } } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "model.reactions.EX_o2_e.lower_bound = 0\n", "result2 = phenotypic_phase_plane(model, \n", " variables=[model.reactions.BIOMASS_Ecoli_core_w_GAM],\n", " objective=model.reactions.EX_ac_e,\n", " points=10)\n", "result2.plot()" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Flux Balance Impact Degree" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "from cameo.flux_analysis.analysis import flux_balance_impact_degree" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "model.reactions.EX_o2_e.lower_bound = -10" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 447 ms, sys: 5.18 ms, total: 452 ms\n", "Wall time: 470 ms\n" ] } ], "source": [ "%time fbid = flux_balance_impact_degree(model, [\"EX_o2_e\"])" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "

Flux Balance Impact Degree

\n", " \n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
perturbed
ACALDFalse
ACALDtFalse
ADK1False
ALCD2xFalse
ATPMFalse
ATPS4rTrue
CO2tFalse
CYTBDTrue
D_LACt2False
ENOFalse
ETOHt2rFalse
EX_acald_eTrue
EX_co2_eFalse
EX_etoh_eFalse
EX_glc__D_eFalse
EX_h2o_eTrue
EX_h_eFalse
EX_lac__D_eFalse
EX_pyr_eTrue
FBAFalse
FBPFalse
FRD7False
GAPDFalse
GLCptsFalse
GLNSFalse
GLUDyFalse
GLUNFalse
GLUSyFalse
H2OtFalse
LDH_DFalse
MDHFalse
ME1False
ME2False
NADH16True
NADTRHDFalse
PDHFalse
PFKFalse
PGIFalse
PGKFalse
PGMFalse
PPCFalse
PPCKFalse
PPSFalse
PYKFalse
PYRt2False
SUCCt2_2False
SUCCt3False
SUCDiFalse
THD2False
TPIFalse
\n", "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fbid" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "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.5" } }, "nbformat": 4, "nbformat_minor": 1 }