Production envelopes (aka phenotype phase planes) will show distinct phases of optimal growth with different use of two different substrates. For more information, see Edwards et al.
Cobrapy supports calculating these production envelopes and they can easily be plotted using your favorite plotting package. Here, we will make one for the "textbook" E. coli core model and demonstrate plotting using matplotlib.
In [1]:
import cobra.test
from cobra.flux_analysis import production_envelope
model = cobra.test.create_test_model("textbook")
We want to make a phenotype phase plane to evaluate uptakes of Glucose and Oxygen.
In [2]:
prod_env = production_envelope(model, ["EX_glc__D_e", "EX_o2_e"])
In [3]:
prod_env.head()
Out[3]:
If we specify the carbon source, we can also get the carbon and mass yield. For example, temporarily setting the objective to produce acetate instead we could get production envelope as follows and pandas to quickly plot the results.
In [4]:
prod_env = production_envelope(
model, ["EX_o2_e"], objective="EX_ac_e", carbon_sources="EX_glc__D_e")
In [5]:
prod_env.head()
Out[5]:
In [6]:
%matplotlib inline
In [7]:
prod_env.plot(
kind='line', x='EX_o2_e', y='carbon_yield_maximum');
Previous versions of cobrapy included more tailored plots for phase planes which have now been dropped in order to improve maintainability and enhance the focus of cobrapy. Plotting for cobra models is intended for another package.