2.1. wc_model_gen package

2.1.2. Submodules

2.1.3. 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

knowledge_base[source]

knowledge base

Type:wc_kb.core.KnowledgeBase
model[source]

model

Type:wc_lang.Model
options[source]

options

Type:dict, optional
clean_and_validate_options()[source]

Apply default options and validate options

run()[source]

Generate model components

class wc_model_gen.core.ModelGenerator(knowledge_base, component_generators=None, options=None)[source]

Bases: object

Generator for models (wc_lang.Model)

knowledge_base[source]

knowledge base

Type:wc_kb.core.KnowledgeBase
component_generators[source]

model component generators

Type:list of ModelComponentGenerator
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
DEFAULT_COMPONENT_GENERATORS = ()[source]
static analyze_model(self, results)[source]

Prints the standard analysis of simulation results

clean_and_validate_options()[source]

Apply default options and validate options

static gen_rand_min_model_kb(name=None)[source]

Generates a random min model KB

run()[source]

Generate a wc_lang model from a wc_kb knowledge base

Returns:model
Return type:wc_lang.Model
static run_model(model, results_dir, checkpoint_period=5, end_time=100)[source]

Simulates model

class wc_model_gen.core.SubmodelGenerator(knowledge_base, model, options=None)[source]

Bases: wc_model_gen.core.ModelComponentGenerator

Base class for submodel generators

knowledge_base[source]

knowledge base

Type:wc_kb.core.KnowledgeBase
model[source]

model

Type:wc_lang.Model
submodel[source]

submodel

Type:wc_lang.Submodel
options[source]

options

Type:dict, optional
calibrate_submodel()[source]

Calibrate the submodel using data in the KB

clean_and_validate_options()[source]

Apply default options and validate options

gen_rate_laws()[source]

Generate rate laws for the reactions in the submodel

gen_reactions()[source]

Generate reactions associated with the submodel

run()[source]

Generate model components

2.1.4. 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 concentration
  • half_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 concentration
  • half_life (float) – species half life
  • mean_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) – model
  • reaction (wc_lang.Reaction) – reaction
  • modifiers (list of wc_lang.Observable) – list of observables, each of which evaluates to the total concentration of all enzymes that catalyze the same intermediate step in the reaction
  • modifier_reactants (list of wc_lang.Species) – list of species in modifiers that should be included as reactants in the rate law
Returns:

rate law list of wc_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)[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) – model
  • reaction (wc_lang.Reaction) – reaction
  • modifiers (list of wc_lang.Observable) – list of observables, each of which evaluates to the total concentration of all enzymes that catalyze the same intermediate step in the reaction
  • modifier_reactants (list of wc_lang.Species) – list of species in modifiers that should be included as reactants in the rate law
Returns:

rate law list of wc_lang.Parameter: list of parameters in the rate law

Return type:

wc_lang.RateLawExpression

2.1.5. Module contents