COBRApy: Constraint-based metabolic modeling in Python#
![COBRApy logo](/_static/cobrapy-logo.png)
COBRApy is a python package for large-scale analysis of metabolic systems. It offers tools for frequently used COBRA procedures, including flux balance assessment, flux variability studies, and gene removal evaluations.
import corneto as cn
cn.info()
|
|
Genome scale metabolic networks can be customized with COBRApy, and imported to CORNETO for more advanced analysis that require modified versions of methods implemented in the package.
from cobra.io import load_model
model = load_model("textbook")
len(model.metabolites), len(model.reactions)
(72, 95)
G = cn.Graph.from_cobra_model(model)
G.shape
(72, 95)
G.get_edge(0), G.get_attr_edge(0)
((frozenset({'acald_c', 'coa_c', 'nad_c'}),
frozenset({'accoa_c', 'h_c', 'nadh_c'})),
{'__edge_type': 'directed',
'id': 'ACALD',
'__source_attr': {'acald_c': {'__value': -1.0},
'coa_c': {'__value': -1.0},
'nad_c': {'__value': -1.0}},
'__target_attr': {'accoa_c': {'__value': 1.0},
'h_c': {'__value': 1.0},
'nadh_c': {'__value': 1.0}},
'default_lb': -1000.0,
'default_ub': 1000.0,
'GPR': 'b0351 or b1241'})