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

Generator for macromolecular complexation submodel for eukaryotes :Author: Yin Hoon Chew <yinhoon.chew@mssm.edu> :Date: 2019-08-02 :Copyright: 2019, Karr Lab :License: MIT

class wc_model_gen.eukaryote.complexation.ComplexationSubmodelGenerator(knowledge_base, model, options=None)[source]

Bases: wc_model_gen.core.SubmodelGenerator

Generator for macromolecular complexation submodel

Options: * amino_acid_id_conversion (dict): a dictionary with amino acid standard ids

as keys and amino acid metabolite ids as values

  • codon_table (dict): a dictionary with protein subunit id as key and

    NCBI identifier for translation table as value, the default is 1 (standard table) for all protein

  • cds (bool): True indicates the sequences of protein subunits are complete CDS,

    the default if True

  • beta (float, optional): ratio of Michaelis-Menten constant

    to substrate concentration (Km/[S]) for use when estimating Km values, the default value is 1

  • estimate_initial_state (bool): if True, the initial concentrations of complexes

    and free-pool subunits will be estimated using linear programming, the default is True

  • greedy_step_size (float): the extent to which complex copy number is increased

    at each round of reaction selection during initial copy number estimation, value should be higher than 0 and not more than 1.0, and the default value is 0.1

calibrate_submodel()[source]

Calibrate the submodel using data in the KB

clean_and_validate_options()[source]

Apply default options and validate options

determine_initial_concentration()[source]

Estimate the initial concentrations of complex species using the following steps:

  1. For each complex species, calculate the maximum possible copy number by taking the minimum of the availability of each subunit, which is determined as the ratio of subunit copy number to its stoichiometric coefficient in the complex.

  2. Arrange complexation reactions in decreasing order of the effective dissociation rate into a list.

  3. For each reaction in the list, increase the copy number of complex by either the minimum of all current subunit availability or the maximum possible copy number calculated in step 1 multiplied by the greedy_step_size, whichever is less. The copy number of subunits are adjusted accordingly. If the copy number of any subunits reaches zero, the reaction is removed from the list.

  4. Repeat step 3 until the list is empty.

gen_rate_laws()[source]

Generate rate laws for the reactions in the submodel

gen_reactions()[source]

Generate reactions associated with submodel

2.1.1.1.3. wc_model_gen.eukaryote.core module

Generator for models based on KBs

Author

Yin Hoon Chew <yinhoon.chew@mssm.edu>

Date

2019-01-07

Copyright

2019, Karr Lab

License

MIT

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

Bases: wc_model_gen.core.ModelGenerator

Generator for submodels based on KBs

Options: * id * name * version * component

  • InitializeModel

  • ComplexationSubmodelGenerator,

  • TranscriptionSubmodelGenerator,

  • RnaDegradationSubmodelGenerator

DEFAULT_COMPONENT_GENERATORS = (<class 'wc_model_gen.eukaryote.initialize_model.InitializeModel'>, <class 'wc_model_gen.eukaryote.complexation.ComplexationSubmodelGenerator'>, <class 'wc_model_gen.eukaryote.transcription.TranscriptionSubmodelGenerator'>, <class 'wc_model_gen.eukaryote.rna_degradation.RnaDegradationSubmodelGenerator'>, <class 'wc_model_gen.eukaryote.translation_translocation.TranslationTranslocationSubmodelGenerator'>, <class 'wc_model_gen.eukaryote.protein_degradation.ProteinDegradationSubmodelGenerator'>, <class 'wc_model_gen.eukaryote.metabolism.MetabolismSubmodelGenerator'>)[source]
clean_and_validate_options()[source]

Apply default options and validate options

2.1.1.1.4. wc_model_gen.eukaryote.initialize_model module

Initialize the construction of wc_lang-encoded models from wc_kb-encoded knowledge base.

Author

Yin Hoon Chew <yinhoon.chew@mssm.edu>

Date

2019-01-09

Copyright

2019, Karr Lab

License

MIT

class wc_model_gen.eukaryote.initialize_model.InitializeModel(knowledge_base, model, options=None)[source]

Bases: wc_model_gen.core.ModelComponentGenerator

Initialize model from knowledge base

Options:

  • culture_volume (float): volume of cell culture; default is 1.0 liter

  • cell_density(float): cell density; default is 1040 g/liter

  • membrane_density (float): membrane density; default is 1160 g/liter

  • cds (bool): True indicates mRNA sequence is a complete CDS; default is True

  • amino_acid_id_conversion (dict): a dictionary with amino acid standard ids

    as keys and amino acid metabolite ids as values

  • environment (dict): dictionary with details for generating cell environment in the model

  • ph (float): pH at which species will be protonated and reactions will be balanced; default is 7.4

  • media (dict): a dictionary with species type ids as keys and tuples of concentration (M) in the

    media (extracellular space), list of wc_lang.Reference, and comments as values

  • check_reaction (bool): if True, reactions will be checked and corrected for proton and charge balance;

    default is True

  • gen_dna (bool): if True, DNA species types and species will be generated;

    default is True

  • gen_transcripts (bool): if True, transcript species types and species will be generated;

    default is True

  • gen_protein (bool): if True, protein species types and species will be generated;

    default is True

  • gen_metabolites (bool): if True, metabolite species types and species will be generated;

    default is True

  • gen_complexes (bool): if True, macromolecular complex species types and species will be generated;

    default is True

  • gen_distribution_init_concentration (bool): if True, initial concentration of species will be generated;

    default is True

  • gen_observables (bool): if True, observables will be generated; default is True

  • gen_kb_reactions (bool): if True, reactions will be generated; default is True

  • gen_kb_rate_laws (bool): if True, rate laws will be generated; default is True

  • gen_environment (bool): if True, cell environment will be generated; default is True

clean_and_validate_options()[source]

Apply default options and validate options

determine_protein_structure_from_aa(polymer_id, count)[source]
Determine the empirical formula, molecular weight and charge of

a protein based on the structural information of its metabolite amino acid monomers to ensure consistency with the pH

Parameters
  • polymer_id (str) – polymer ID

  • count (dict) – dictionary showing the count of each amino acid in the protein

Returns

protein empirical formula float: protein molecular weight int: protein charge bool: True if protein structure has been successfully determined

from the metabolite monomer, else False

Return type

wc_utils.util.chem.EmpiricalFormula

gen_compartments()[source]

Generate compartments for the model from knowledge base

gen_complexes()[source]

Generate complexes for the model from knowledge base

gen_distribution_init_concentrations()[source]

Generate concentrations for the model from knowledge base

gen_dna()[source]

Generate DNAs for the model from knowledge base

gen_environment()[source]

Generate the environment, i.e. temperature, for the simulated cells

gen_kb_rate_laws()[source]

Generate the rate laws for reactions encoded in the knowledge base

gen_kb_reactions()[source]

Generate reactions encoded within KB

gen_metabolites()[source]

Generate metabolites for the model from knowledge base

gen_observables()[source]

Generate observables for the model from knowledge base

gen_parameters()[source]

Generate parameters for the model from knowledge base

gen_protein()[source]

Generate proteins for the model from knowledge base

gen_species_type(kb_species_type, extra_compartment_ids=None)[source]

Generate a model species type and species

Parameters
  • kb_species_type (wc_kb.SpeciesType) – knowledge base species type

  • extra_compartment_ids (list of str, optional) – compartment ids of additional species that should be created beyond those represented in the KB

Returns

model species type

Return type

  • wc_lang.SpeciesType

gen_taxon()[source]

Generate taxon for the model from knowledge base

gen_transcripts()[source]

Generate transcripts (mature RNAs) for the model from knowledge base

populate_protein_aa_usage(protein_id, seq)[source]
Populate a global variable dictionary of amino acid

usage in a protein given its sequence

Parameters
  • protein_id (str) – protein ID

  • seq (Bio.Seq.Seq) – sequence

run()[source]

Run all the components for initializing model from knowledge base

structure_to_smiles_and_props(structure, ph)[source]
Convert InChI or SMILES string in the knowledge base

to a SMILES string at specific pH and calculate properties such as empirical formula, charge and molecular weight

Parameters
  • structure (str) – InChI or SMILES string

  • ph (float) – pH at which the properties should be determined

Returns

SMILES string wc_utils.util.chem.core.EmpiricalFormula: empirical formula int: charge float: molecular weight

Return type

str

2.1.1.1.5. wc_model_gen.eukaryote.metabolism module

Generator for metabolism submodel for eukaryotes

Author

Yin Hoon Chew <yinhoon.chew@mssm.edu>

Date

2020-01-21

Copyright

2020, Karr Lab

License

MIT

class wc_model_gen.eukaryote.metabolism.MetabolismSubmodelGenerator(knowledge_base, model, options=None)[source]

Bases: wc_model_gen.core.SubmodelGenerator

Generator for metabolism submodel

Options: * recycled_metabolites (dict): a dictionary with species IDs of metabolites

to be recycled as keys and recycled amounts in copy number as values

  • carbohydrate_components (dict): a dictionary with species IDs of carbohydrate

    metabolite components as keys and their relative compositions as values

  • lipid_components (dict): a dictionary with species IDs of lipid

    metabolite components as keys and their relative compositions as values

  • atp_production (float): ATP requirement in copy number per cell cycle per cell;

    if not provided, it will be calculated from other generated submodels

  • amino_acid_ids (list): amino acid metabolite ids

  • media_fluxes(dict): dictionary with reaction ids as keys and tuples of

    the lower and upper bounds based on measured fluxes (copy number per second) as values

  • exchange_reactions (list): IDs of exchange/demand/sink reactions

  • scale_factor (float): scaling factor multiplied by the reaction bounds during

    calibration; the default value is 1.0

  • coef_scale_factor (float): scaling factor multiplied by the species coefficients

    in the objective function during calibration; the default value is 1.0

  • optimization_type (bool): if True, linear optimization is used during submodel

    calibration, else a quadratic optimization is used; default is True

  • beta (float, optional): ratio of Michaelis-Menten constant to substrate

    concentration (Km/[S]) for use when estimating Km values, the default value is 1

calibrate_submodel()[source]

Calibrate the submodel by adjusting measured kinetic constants to achieve the measured growth rate while minimizing the total necessary adjustment. Kinetic constants that have no measured values are then imputed based on values determined by Flux Variability Analysis.

clean_and_validate_options()[source]

Apply default options and validate options

flux_variability_analysis(conv_model, fraction_of_objective=1.0, target_reactions=None)[source]
Conduct flux variability analysis by:
  1. Optimizing the model by maximizing the objective function

  2. Setting the objective function to the optimal value

  3. Determining the maximal and minimal fluxes for each reaction by

    maximizing and minimizing the reaction

Parameters
  • conv_model (conv_opt.Model) – a conv_opt model for optimization

  • fraction_of_objective (float, optional) – network state with respect to the optimal solution, e.g. 0.9 maximal possible biomass production rate (allowable range: 0.0-1.0, default = 1.0)

  • target_reactions (list, optional) – a list of reaction IDs where FVA will be conducted (the default is to conduct FVA on all reactions in the model)

Returns

a dictionary with reaction ids as keys and tuples containing the

minimum and maximum fluxes as values

Return type

dict

gen_rate_laws()[source]

Generate rate laws for carbohydrate and lipid formation reactions. High rates are assumed so that the macromolecules are formed as soon as the components are available.

gen_reactions()[source]

Generate reactions associated with submodel

A biomass reaction is generated by accounting for all the metabolites that are consumed and produced by the reactions in other submodels, and the metabolites that are in the free pool

impute_kinetic_constant(bound_values)[source]

Impute the values of kcat that have not been measured.

Parameters

bound_values (dict) – Keys are reaction IDs and values are tuples of the minimum and maximum bounds that would be used to impute kcat

relax_bounds(target, lower_bound_adjustable, upper_bound_adjustable)[source]
Relax bounds to achieve set target flux(es) while minimizing the total necessary adjustment

to the flux bounds

Parameters
  • target (dict) – a dictionary of IDs of variables to be set and their target values

  • lower_bound_adjustable (list) – list of IDs of variables whose lower bounds are to be adjusted

  • upper_bound_adjustable (list) – list of IDs of variables whose upper bounds are to be adjusted

Returns

a dictionary of reaction IDs as keys and the necessary lower bound adjustments

as values

dict: a dictionary of reaction IDs as keys and the necessary upper bound adjustments

as values

Return type

dict

2.1.1.1.6. wc_model_gen.eukaryote.protein_degradation module

Generator for protein degradation submodel for eukaryotes :Author: Yin Hoon Chew <yinhoon.chew@mssm.edu> :Date: 2019-06-11 :Copyright: 2019, Karr Lab :License: MIT

class wc_model_gen.eukaryote.protein_degradation.ProteinDegradationSubmodelGenerator(knowledge_base, model, options=None)[source]

Bases: wc_model_gen.core.SubmodelGenerator

Generator for protein degradation submodel

Options: * compartment_proteasomes (dict): a dictionary with compartment id

as the key and a list of the names of proteasome complexes that degrade the protein species in the compartments as value

  • amino_acid_id_conversion (dict): a dictionary with amino acid standard ids

    as keys and amino acid metabolite ids as values

  • codon_table (dict): a dictionary with protein id as key and

    NCBI identifier for translation table as value, the default is 1 (standard table) for all protein

  • cds (bool): True indicates the sequences of protein are complete CDS,

    the default is True

  • beta (float, optional): ratio of Michaelis-Menten constant

    to substrate concentration (Km/[S]) for use when estimating Km values, the default value is 1

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 submodel

2.1.1.1.7. wc_model_gen.eukaryote.rna_degradation module

Generator for rna degradation submodel for eukaryotes :Author: Yin Hoon Chew <yinhoon.chew@mssm.edu> :Date: 2019-06-11 :Copyright: 2019, Karr Lab :License: MIT

class wc_model_gen.eukaryote.rna_degradation.RnaDegradationSubmodelGenerator(knowledge_base, model, options=None)[source]

Bases: wc_model_gen.core.SubmodelGenerator

Generator for rna degradation submodel

Options: * rna_exo_pair (dict): a dictionary of RNA id as key and

the name of exosome complex that degrades the RNA as value

  • beta (float, optional): ratio of Michaelis-Menten constant

    to substrate concentration (Km/[S]) for use when estimating Km values, the default value is 1

  • ribosome_occupancy_width (int, optional): number of base-pairs

    on the mRNA occupied by each bound ribosome, the default value is 27 (9 codons)

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 submodel

2.1.1.1.8. wc_model_gen.eukaryote.transcription module

Generator for transcription submodels for eukaryotes

Author

Yin Hoon Chew <yinhoon.chew@mssm.edu>

Date

2019-01-07

Copyright

2019, Karr Lab

License

MIT

class wc_model_gen.eukaryote.transcription.TranscriptionSubmodelGenerator(knowledge_base, model, options=None)[source]

Bases: wc_model_gen.core.SubmodelGenerator

Generator for transcription submodel

Options: * rna_pol_pair (dict): a dictionary of RNA id as key and

the name of RNA polymerase complex that transcribes the RNA as value, e.g. rna_pol_pair = {

‘rRNA45S’: ‘DNA-directed RNA Polymerase I complex’, ‘mRNA’: ‘DNA-directed RNA Polymerase II complex’, ‘sRNA’: ‘DNA-directed RNA Polymerase II complex’, ‘tRNA’: ‘DNA-directed RNA Polymerase III complex’, ‘rRNA5S’: ‘DNA-directed RNA Polymerase III complex’ }

  • init_factors (dict, optional): a dictionary of generic init factor name as key and

    list of lists of the id or name of initiation factors, grouped based on similar functions or classes, e.g. {‘pol1_init_factors’: [[‘factor1_variant1’, ‘factor1_variant2’], [‘factor2’]]} where the keys must start with the substring ‘pol1_’, ‘pol2_’, ‘pol3_’, and ‘polm_’ if factors for the polymerase exists, the default is an empty dictionary

  • elongation_termination_factors (dict, optional): a dictionary of generic elongation and

    termination factor name as key and list of lists of the id or name of elongation and termination factors, grouped based on similar functions or classes, e.g. {‘pol1_elongation_termination_factors’: [[‘factor1_variant1’, ‘factor1_variant2’], [‘factor2’]]}, where the keys must start with the substring ‘pol1_’, ‘pol2_’, ‘pol3_’, and ‘polm_’ if factors for the polymerase exists, the default is an empty dictionary

  • elongation_negative_factors (dict, optional): a dictionary of generic elongation negative

    factor name as key and list of lists of the id or name of elongation negative factors, grouped based on similar functions or classes, e.g. {‘pol2_elongation_negative_factors’: [[‘factor1_variant1’, ‘factor1_variant2’], [‘factor2’]]}, where the keys must start with the substring ‘pol1_’, ‘pol2_’, ‘pol3_’, and ‘polm_’ if factors for the polymerase exists, the default is an empty dictionary

  • rna_init_factors (dict, optional): a dictionary of RNA id as key and the generic init factor

    name (the key in init_factors option) as value, the default is an empty dictionary

  • rna_elongation_termination_factors (dict, optional): a dictionary of RNA id as key and the

    generic elongation and termination factor name (the key in elongation_termination_factors option) as value, the default is an empty dictionary

  • rna_elongation_negative_factors (dict, optional): a dictionary of RNA id as key and the

    generic elongation negatic factor name (the key in elongation_termination_factors option) as value, the default is an empty dictionary

  • beta (float, optional): ratio of Michaelis-Menten constant to substrate

    concentration (Km/[S]) for use when estimating Km values, the default value is 1

  • beta_activator (float, optional): ratio of effective equilibrium

    dissociation constant of a transcription factor (activator) to the transcription factor concentration (Ka/[TF]) for use when estimating Ka values, the default value is 1

  • beta_repressor (float, optional): ratio of effective equilibrium

    dissociation constant of a transcription factor (repressor) to the transcription factor concentration (Kr/[TF]) for use when estimating Kr values, the default value is 1

  • activator_effect (float, optional): interaction effect between an activator

    and RNA polymerase, which must take the value of 1 and higher, the default value is 1.2

  • polr_occupancy_width (int, optional): number of base-pairs on the DNA occupied

    by each bound RNA polymerase, , the default value is 80

  • ribosome_occupancy_width (int, optional): number of base-pairs on the mRNA occupied

    by each bound ribosome, the default value is 27 (9 codons)

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 submodel

2.1.1.1.9. wc_model_gen.eukaryote.translation_translocation module

Generator for translation, protein folding and translocation submodel for eukaryotes :Author: Yin Hoon Chew <yinhoon.chew@mssm.edu> :Date: 2019-06-14 :Copyright: 2019, Karr Lab :License: MIT

class wc_model_gen.eukaryote.translation_translocation.TranslationTranslocationSubmodelGenerator(knowledge_base, model, options=None)[source]

Bases: wc_model_gen.core.SubmodelGenerator

Generator for translation, protein folding and translocation submodel

Translation, protein folding and translocation processes are modeled as three reaction steps in this submodel:

  1. Translation initiation where ribosomes and methionine (or other start amino acid) bind to the mRNA. For nuclear mRNAs, transport from the nucleus to the cytoplasm are lumped with this reaction. The energetic of met-tRNA charging is included;

  2. Translation elongation and termination are lumped into one reaction that produces nascent polypeptides. The energetic of amino-acid-tRNA charging is included;

  3. Protein folding and translocation to each organelle/compartment are lumped into one reaction

Options: * cytoplasmic_ribosome (str): name of cytoplasmic ribosome * mitochondrial_ribosome (str): name of mitochondrial ribosome * cytoplasmic_initiation_factors (list of list): list of lists of the name of

initiation factors in the cytoplasm, grouped based on similar functions or classes, the default is an empty list

  • mitochondrial_initiation_factors (list of list): list of lists of the name of

    initiation factors in the mitochondria, grouped based on similar functions or classes, the default is an empty list

  • cytoplasmic_elongation_factors (list of list): list of lists of the name of

    elongation factors in the cytoplasm, grouped based on similar functions or classes, the default is an empty list

  • mitochondrial_elongation_factors (list of list): list of lists of the name of

    elongation factors in the mitochondria, grouped based on similar functions or classes, the default is an empty list

  • cytoplasmic_chaperones (list of list): list of lists of the name of

    chaperones in the cytoplasm, grouped based on similar functions or classes, the default is an empty list

  • mitochondrial_chaperones (list of list): list of lists of the name of

    chaperones in the mitochondria, grouped based on similar functions or classes, the default is an empty list

  • er_chaperones (list of list): list of lists of the name of

    chaperones in the endoplasmic reticulum, grouped based on similar functions or classes, the default is an empty list

  • amino_acid_id_conversion (dict): a dictionary with amino acid standard ids

    as keys and amino acid metabolite ids as values

  • codon_table (dict, optional): a dictionary with protein id as key and

    NCBI identifier for translation table as value, the default is 1 (standard table) for all protein

  • cds (bool, optional): True indicates the sequences of protein are complete CDS,

    the default is True

  • beta (float, optional): ratio of Michaelis-Menten constant to substrate

    concentration (Km/[S]) for use when estimating Km values, the default value is 1

  • polysome_fraction (dict): a dictionary with mRNA ids as keys and

    fraction of total cellular ribosomes the mRNA is bound to

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 submodel

2.1.1.1.10. Module contents