Ejemplo n.º 1
0
import cobra
from cobra.test import ecoli_pickle, create_test_model

from cobra.flux_analysis.phenotype_phase_plane import calculate_phenotype_phase_plane

model = create_test_model(ecoli_pickle)
model
# Output:
# <Model iJO1366 at 0x5b0abd0>

# We want to make a phenotype phase plane to evaluate uptakes of Glucose and
# Oxygen.
#
# With [matplotlib](http://matplotlib.org) installed, this is as simple as

data = calculate_phenotype_phase_plane(model, "EX_glc_e", "EX_o2_e")
data.plot_matplotlib()

# If [brewer2mpl](https://pypi.python.org/pypi/brewer2mpl/) is installed, other
# color schemes can be used as well

data.plot_matplotlib("Pastel1")
data.plot_matplotlib("Dark2")

# The number of points which are plotted in each dimension can also be changed

calculate_phenotype_phase_plane(
    model, "EX_glc_e", "EX_o2_e", reaction1_npoints=20, reaction2_npoints=20
).plot_matplotlib()

# The code can also use multiple processes to speed up calculations
 def PhasePlane(self, reac1, reac2, reac1_max=20, reac2_max=20, reac1_n=50,
         reac2_n=50, solver=None, n_processes=1, tol=1e-10):
     return phenotype_phase_plane.calculate_phenotype_phase_plane(self,
         reac1=reac1 ,reac2=reac2 , reac1_max=reac1_max,
         reac2_max=reac2_max, reac1_n=reac1_n, reac2_n=reac2_n,
         solver=solver, n_processes=n_processes, tol=tol)
Ejemplo n.º 3
0
from cobra.test import ecoli_pickle, create_test_model

from cobra.flux_analysis.phenotype_phase_plane import \
    calculate_phenotype_phase_plane

model = create_test_model(ecoli_pickle)
model
# Output:
# <Model iJO1366 at 0x5b0abd0>

# We want to make a phenotype phase plane to evaluate uptakes of Glucose and
# Oxygen.
#
# With [matplotlib](http://matplotlib.org) installed, this is as simple as

data = calculate_phenotype_phase_plane(model, "EX_glc_e", "EX_o2_e")
data.plot_matplotlib()

# If [brewer2mpl](https://pypi.python.org/pypi/brewer2mpl/) is installed, other
# color schemes can be used as well

data.plot_matplotlib("Pastel1")
data.plot_matplotlib("Dark2")

# The number of points which are plotted in each dimension can also be changed

calculate_phenotype_phase_plane(model,
                                "EX_glc_e",
                                "EX_o2_e",
                                reaction1_npoints=20,
                                reaction2_npoints=20).plot_matplotlib()

# #### | YOU CAN TOUCH AGAIN |

# ### Phenotype Phase Plane

# In[29]:

from cobra.flux_analysis.phenotype_phase_plane import calculate_phenotype_phase_plane
import matplotlib.pyplot as plt


# In[ ]:

get_ipython().magic(u'matplotlib inline')
data = calculate_phenotype_phase_plane(model, "PEPCARBOX_RXN_c_phase1", "Starch_link1_2")
data.plot_matplotlib();


# # Constraints Scan

# In[1]:

model.ConstraintScan({"Citrate_link1_2": 1}, 0, 100, 101)


# In[ ]: