2.1. wc_model_gen package¶
2.1.1. Subpackages¶
- 2.1.1.1. wc_model_gen.eukaryote package
- 2.1.1.1.1. Submodules
- 2.1.1.1.2. wc_model_gen.eukaryote.complexation module
- 2.1.1.1.3. wc_model_gen.eukaryote.core module
- 2.1.1.1.4. wc_model_gen.eukaryote.initialize_model module
- 2.1.1.1.5. wc_model_gen.eukaryote.metabolism module
- 2.1.1.1.6. wc_model_gen.eukaryote.protein_degradation module
- 2.1.1.1.7. wc_model_gen.eukaryote.rna_degradation module
- 2.1.1.1.8. wc_model_gen.eukaryote.transcription module
- 2.1.1.1.9. wc_model_gen.eukaryote.translation_translocation module
- 2.1.1.1.10. Module contents
- 2.1.1.2. wc_model_gen.prokaryote package
- 2.1.1.2.1. Submodules
- 2.1.1.2.2. wc_model_gen.prokaryote.core module
- 2.1.1.2.3. wc_model_gen.prokaryote.initalize_model module
- 2.1.1.2.4. wc_model_gen.prokaryote.metabolism module
- 2.1.1.2.5. wc_model_gen.prokaryote.protein_degradation module
- 2.1.1.2.6. wc_model_gen.prokaryote.rna_degradation module
- 2.1.1.2.7. wc_model_gen.prokaryote.transcription module
- 2.1.1.2.8. wc_model_gen.prokaryote.translation module
- 2.1.1.2.9. Module contents
2.1.2. Submodules¶
2.1.3. wc_model_gen._version module¶
2.1.4. wc_model_gen.core module¶
Base classes for generating wc_lang
-formatted models from a knowledge base.
- Author
Balazs Szigeti <balazs.szigeti@mssm.edu>
- Author
Jonathan Karr <jonrkarr@gmail.com>
- Author
Yin Hoon Chew <yinhoon.chew@mssm.edu>
- Date
2018-01-21
- Copyright
2018, Karr Lab
- License
MIT
-
class
wc_model_gen.core.
ModelComponentGenerator
(knowledge_base, model, options=None)[source]¶ Bases:
object
Abstract base class for model component generators
-
class
wc_model_gen.core.
ModelGenerator
(knowledge_base, component_generators=None, options=None)[source]¶ Bases:
object
Generator for models (
wc_lang.Model
)-
component_generators
[source]¶ model component generators
- Type
list
ofModelComponentGenerator
-
options
[source]¶ dictionary of options whose keys are the names of component generator classes and whose values are dictionaries of options for the component generator classes
- Type
dict
, optional
-
-
class
wc_model_gen.core.
SubmodelGenerator
(knowledge_base, model, options=None)[source]¶ Bases:
wc_model_gen.core.ModelComponentGenerator
Base class for submodel generators
2.1.5. wc_model_gen.global_vars module¶
Global variables for storing temporary information during model generation
- Author
Yin Hoon Chew <yinhoon.chew@mssm.edu>
- Date
2019-10-04
- Copyright
2019, Karr Lab
- License
MIT
2.1.6. wc_model_gen.utils module¶
Utility methods for generating submodels
- Author
Yin Hoon Chew <yinhoon.chew@mssm.edu>
- Date
2019-01-23
- Copyright
2019, Karr Lab
- License
MIT
-
wc_model_gen.utils.
calc_avg_deg_rate
(mean_concentration, half_life)[source]¶ Calculate the average degradation rate of a species over a cell cycle
- Parameters
mean_concentration (
float
) – species mean concentrationhalf_life (
float
) – species half life
- Returns
the average degradation rate of the species
- Return type
float
-
wc_model_gen.utils.
calc_avg_syn_rate
(mean_concentration, half_life, mean_doubling_time)[source]¶ Calculate the average synthesis rate of a species over a cell cycle
- Parameters
mean_concentration (
float
) – species mean concentrationhalf_life (
float
) – species half lifemean_doubling_time (
float
) – mean doubling time of cells
- Returns
the average synthesis rate of the species
- Return type
float
-
wc_model_gen.utils.
gen_mass_action_rate_law
(model, reaction, model_k, modifiers=None, modifier_reactants=None)[source]¶ Generate a mass action rate law.
Example
Rate = k * [E1] * [S1]
- where
k_: rate constant (e.g.: association, dissociation or catalytic constant) [En]: concentration of nth enzyme (modifier) [Sn]: concentration of nth substrate
- Parameters
model (
wc_lang.Model
) – modelreaction (
wc_lang.Reaction
) – reactionmodifiers (
list
ofwc_lang.Observable
) – list of observables, each of which evaluates to the total concentration of all enzymes that catalyze the same intermediate step in the reactionmodifier_reactants (
list
ofwc_lang.Species
) – list of species in modifiers that should be included as reactants in the rate law
- Returns
rate law
list
ofwc_lang.Parameter
: list of parameters in the rate law- Return type
wc_lang.RateLawExpression
-
wc_model_gen.utils.
gen_michaelis_menten_like_propensity_function
(model, reaction, substrates_as_modifiers=None, exclude_substrates=None)[source]¶ Generate a Michaelis-Menten-like propensity function. For species that are considered ‘substrates’, the substrate term is formulated as the multiplication of a Hill equation with a coefficient of 1 for each ‘substrate’. For species that are considered ‘modifiers’, the modifier term is formulated as the multiplication of the modifier concentrations.
Example
Rate = k_cat * [E1] * [E2] * [S1]/(Km_S1 + [S1]) * [S2]/(Km_S2 + [S2])
- where
k_cat: catalytic constant [En]: concentration of nth modifier [Sn]: concentration of nth substrate Km_Sn: Michaelis-Menten constant for nth substrate
- Parameters
model (
wc_lang.Model
) – modelreaction (
wc_lang.Reaction
) – reactionsubstrates_as_modifiers (
list
ofwc_lang.Species
) – list of reactant species that should be considered as modifiers in the rate lawexclude_substrates (
list
ofwc_lang.Species
) – list of reactant species that would be excluded from the rate law
- Returns
rate law
list
ofwc_lang.Parameter
: list of parameters in the rate law- Return type
wc_lang.RateLawExpression
-
wc_model_gen.utils.
gen_michaelis_menten_like_rate_law
(model, reaction, modifiers=None, modifier_reactants=None, exclude_substrates=None)[source]¶ Generate a Michaelis-Menten-like rate law. For a multi-substrate reaction, the substrate term is formulated as the multiplication of a Hill equation with a coefficient of 1 for each substrate. For multi-steps reaction where each step is catalyzed by a different enzyme, the enzyme term is formulated as the multiplication of all the enzyme concentrations.
Example
Rate = k_cat * [E1] * [E2] * [S1]/(Km_S1 + [S1]) * [S2]/(Km_S2 + [S2])
- where
k_cat: catalytic constant
[En]: concentration of nth enzyme (modifier) [Sn]: concentration of nth substrate Km_Sn: Michaelis-Menten constant for nth substrate
- Parameters
model (
wc_lang.Model
) – modelreaction (
wc_lang.Reaction
) – reactionmodifiers (
list
ofwc_lang.Observable
orwc_lang.Species
) – list of observables (each of which evaluates to the total concentration of all enzymes that catalyze the same intermediate step in the reaction) or enzyme species (that catalyze the reaction)modifier_reactants (
list
ofwc_lang.Species
) – list of species in modifiers that should be included as reactants in the rate lawexclude_substrates (
list
ofwc_lang.Species
) – list of reactant species that would be excluded from the rate law
- Returns
rate law
list
ofwc_lang.Parameter
: list of parameters in the rate law- Return type
wc_lang.RateLawExpression
-
wc_model_gen.utils.
gen_response_functions
(model, beta, reaction_id, reaction_class, compartment, reaction_factors)[source]¶ - Generate a list of response function expression string for each factor or
group of factors (F) in the form of:
F/(Km + F)
- Parameters
model (
wc_lang.Model
) – modelbeta (
float
) – ratio of Michaelis-Menten constant to substrate concentration (Km/[S]) for use when estimating Km valuesreaction_id (
str
) – identifier of reaction whose rate law will use the function expressionsreaction_class (
str
) – generic class that the reaction belongs to which shares the same observables in their rate laws, e.g. ‘translation_initiation’ for each gene that shares the same initiation factorscompartment (
wc_lang.Compartment
) – compartment where the reaction occursreaction_factors (
list
of list) – list of lists of the ID or name of (initiation/elongation/translocation) factors, grouped based on similar functions or classes, e.g. [[‘factor1 variant1’, ‘factor1 variant2’], [‘factor2’]]
- Returns
list of strings of response function expression for each factor/group of factors
dict
: IDs of species (keys) and their species objects (values)dict
: IDs of parameters (keys) and their parameter objects (values)dict
: IDs of volume density functions (keys) and their function objects (values)dict
: IDs of observables (keys) and their observable objects (values)- Return type
list
-
wc_model_gen.utils.
simple_activator
(model, reaction_id, activator)[source]¶ Generate the parameters and string expression of the regulation factor derived in Bintu et al (2005) for the case of a simple activator
- Parameters
model (
wc_lang.Model
) – modelreaction_id (
str
) – reaction idactivator (
wc_lang.Species
) – activator
- Returns
string expression of the regulation factor
dict
ofwc_lang.Species
: dict of species in the expressionwith the species ids as keys and the species objects as values
dict
ofwc_lang.Parameter
: dict of parameters in the expressionwith the parameter ids as keys and the parameter objects as values
dict
ofwc_lang.Function
: dict of functions in the expressionwith the function ids as keys and the function objects as values
- Return type
str
-
wc_model_gen.utils.
simple_repressor
(model, reaction_id, repressor)[source]¶ Generate the parameters and string expression of the regulation factor derived in Bintu et al (2005) for the case of a simple repressor
- Parameters
model (
wc_lang.Model
) – modelreaction_id (
str
) – reaction idrepressor (
wc_lang.Species
) – repressor
- Returns
string expression of the regulation factor
dict
ofwc_lang.Species
: dict of species in the expressionwith the species ids as keys and the species objects as values
dict
ofwc_lang.Parameter
: dict of parameters in the expressionwith the parameter ids as keys and the parameter objects as values
dict
ofwc_lang.Function
: dict of functions in the expressionwith the function ids as keys and the function objects as values
- Return type
str
-
wc_model_gen.utils.
test_metabolite_production
(submodel, reaction_bounds, pseudo_reactions=None, test_producibles=None, test_recyclables=None)[source]¶ Test that an FBA metabolism submodel can produce each reactant component (producible) and recycle each product component (recyclable) in each reaction in the objective function individually. First, a source (sink) reaction is added for each reactant (product) component. Each source (sink) reaction is then set as the objective function to be maximized. If the solution returns a zero objective function, that indicates the submodel cannot produce (recycle) the associated reactant (product) component.
- Parameters
submodel (
wc_lang.Submodel
) – FBA metabolism submodelreaction_bounds (
dict
) – a dictionary with reaction IDs as keys and tuples of (lower bound, upper bound) as valuespseudo_reactions (
list
ofstr
, optional) – list of IDs of pseudo-reactions that will be excluded from the optimization formulationtest_producibles (
list
ofstr
, optional) – list of IDs of species to be tested for producibility in the submodel; if nothing is provided, the species will be extracted from the reactants in the objective reactionstest_recyclables (
list
ofstr
, optional) – list of IDs of species to be tested for recyclability in the submodel; if nothing is provided, the species will be extracted from the products in the objective reactions
- Returns
- list of species IDs of metabolites that cannot be produced
in the metabolism submodel
list
: list of species IDs of metabolites that cannot be recycledin the metabolism submodel
- Return type
list