Make a context-specific ecModel#
A context-specific GEM describes the metabolism of one tissue, cell line or strain. It is made from a generic GEM with a method such as ftINIT (ftINIT in RAVEN, ftinit in raven-toolbox). getSubsetEcModel trims a generic ecModel to the reactions and genes of a context-specific GEM, and setProtPoolSize sets the protein pool of the context.
Place in the workflow
The diagram orders the functions of this page within the workflow. Boxes with a dashed outline are optional steps, a dotted arrow is an optional path, and a diamond is a choice. Rounded boxes with a dotted outline are the context, other pages or the model to start from, and a click on one opens its page.
---
config:
flowchart:
useMaxWidth: false
---
flowchart TB
classDef opt stroke-dasharray: 5 4
classDef ctx fill:transparent,stroke-dasharray: 2 3
PV(["Start: a generic ecModel without proteomics constraints"]):::ctx
OR{"Order"}
BE(["Build an ecModel<br/>with the context-specific GEM"]):::ctx
GS["getSubsetEcModel<br/>with the context-specific GEM"]
SP["setProtPoolSize<br/>protein content of the context"]:::opt
PV --> OR
OR -->|context-specific GEM first| BE
OR -->|generic ecModel first| GS --> SP
NX(["Next: Constrain enzymes with proteomics of the context (optional)"]):::ctx
GS --> NX
SP --> NX
click PV href "first-ecmodel.html"
click BE href "first-ecmodel.html"
click NX href "proteomics.html"
---
config:
flowchart:
useMaxWidth: false
---
flowchart TB
classDef opt stroke-dasharray: 5 4
classDef ctx fill:transparent,stroke-dasharray: 2 3
PV(["Start: a generic ecModel without proteomics constraints"]):::ctx
OR{"Order"}
BE(["Build an ecModel<br/>with the context-specific GEM"]):::ctx
GS["get_subset_ec_model<br/>with the context-specific GEM"]
SP["set_prot_pool_size<br/>protein content of the context"]:::opt
PV --> OR
OR -->|context-specific GEM first| BE
OR -->|generic ecModel first| GS --> SP
NX(["Next: Constrain enzymes with proteomics of the context (optional)"]):::ctx
GS --> NX
SP --> NX
click PV href "first-ecmodel.html"
click BE href "first-ecmodel.html"
click NX href "proteomics.html"
Functions#
MATLAB |
Python |
Note |
|---|---|---|
trim a generic ecModel to the reactions and genes of a context-specific GEM |
||
set the upper bound of the protein pool exchange |
Setup#
The examples use the generic ecModel and the model adapter parameters params, loaded as in the setup of Analyse an ecModel. The other names in the examples are placeholders for values of the project:
MATLAB |
Python |
Value |
|---|---|---|
|
|
a context-specific GEM, made from the same GEM (and the same version) as the ecModel |
|
|
total protein content of the context, in g/gDCW |
Choose the order#
There are two ways to get an ecModel of a context:
Order |
What it needs |
Result |
|---|---|---|
make the context-specific GEM, then build an ecModel from it |
the full ecModel workflow per context |
each context has its own kcat assignment |
build one generic ecModel, then trim it with |
the generic ecModel and the context-specific GEM |
all contexts have the kcats of the generic ecModel |
The second way builds the enzyme data once, which saves time when many contexts are made from one generic model, and gives all contexts the same kcats. The sections below describe the second way. For the first way, follow Build an ecModel with the context-specific GEM as the GEM of the project.
Trim the generic ecModel#
getSubsetEcModel removes the genes that the context-specific GEM does not have, with the enzymes and reactions that depend on them, and then the reactions whose identifier (without _REV and _EXP_<n>) is not in the context-specific GEM. The usage_prot_* reactions of the remaining enzymes and prot_pool_exchange are kept, with their bounds. Both models must come from the same GEM: a reaction of the context-specific GEM that the ecModel does not have raises an error. The function warns when a usage_prot_* reaction of the generic ecModel has an upper bound other than 1000, because enzyme concentrations of the generic model may not apply to the context.
ecContext = getSubsetEcModel(ecModel, contextGEM);
ecContext = setProtPoolSize(ecContext, PtotContext);
from geckopy import get_subset_ec_model, set_prot_pool_size
ec_context = get_subset_ec_model(ec_model, context_gem)
set_prot_pool_size(ec_context, p_tot=p_tot_context)
get_subset_ec_model returns a new EcModel; ec_model is not changed.
The upper bound of prot_pool_exchange is copied from the generic ecModel. Call setProtPoolSize with the total protein content of the context when it is different (Set the protein pool). Without the values f and sigma, setProtPoolSize reads them from the model adapter.
Troubleshooting#
Problem |
Possible reason |
Solution |
|---|---|---|
|
the context-specific GEM was made from another GEM or another version of it |
Make the context-specific GEM from the GEM of the ecModel |
Warning that the ecModel is constrained by protein concentrations |
the generic ecModel has measured enzyme concentrations as usage bounds |
Trim an ecModel without proteomics constraints, and add the proteomics data of the context afterwards (Constrain enzymes with proteomics) |
See also#
Analyse an ecModel: the analyses to run on the context-specific ecModel, and the shared setup.
Set the protein pool:
Ptot,fandsigmaof the protein pool.API reference and MATLAB vs Python: the signature of each function in the table.