3.1. h1_hesc package

3.1.2. Submodules

3.1.3. h1_hesc.__main__ module

Command line programs for generating random whole-cell models

Author:Jonathan Karr <karr@mssm.edu>
Date:2018-05-15
Copyright:2018, Karr Lab
License:MIT
class h1_hesc.__main__.App(label=None, **kw)[source]

Bases: cement.core.foundation.App

Command line application

class Meta[source]

Bases: object

base_controller = 'base'[source]
handlers = [<class 'h1_hesc.__main__.BaseController'>][source]
label = 'h1_hesc'[source]
class h1_hesc.__main__.BaseController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Base controller for command line application

class Meta[source]

Bases: object

arguments = [(['-v', '--version'], {'action': 'version', 'version': '0.0.1'})][source]
description = 'Whole-cell model of H1 human embryonic stem cells (hESCs)'[source]
label = 'base'[source]
h1_hesc.__main__.main()[source]

3.1.4. h1_hesc.utils module

A set of functions to support core functions

Author:Yin Hoon Chew <yinhoon.chew@mssm.edu>
Author:Jonathan Karr <jonrkarr@gmail.com>
Date:2017-09-19
Copyright:2017, Karr Lab
License:MIT
h1_hesc.utils.calc_eff_vmax(enzyme_kcats, prot_concs)[source]

Calculate the effective Vmax of a reaction based on the kcats of each enzyme and the concentrations and stoichiometries of their subunits

Parameters:
  • enzyme_kcats (dict) – a dictionary whose keys are enzymes (semicolon-separated list of the stoichiometry * the UniProt id of each subunit of the complex) and values are their kcat`s. See :obj:`calc_mean_kcat for examples.
  • prot_concs (dict) – a dictionary whose keys are the UniProt ids of proteins and values are their concentrations
Returns:

effective Vmax

Return type:

float

h1_hesc.utils.calc_median_kcat(reactions, enzyme_strs, kcats)[source]

Calculate the median kcat for each enzyme of each reaction among a set of observed kcats

Parameters:
  • reactions (list) – reaction ids
  • enzymes (list) –

    enzyme compositions (semicolon-separated list of the stoichiometry * the UniProt id of each subunit of the complex), in the same order as the reaction list. Examples:

    • A: monomer of A
    • 2*A: homodimer of A
    • A; B: heterodimer of A and B
    • 2*A; 2*B: heterotetramer of A and B
  • kcats (list) – observed kcats, in the same order as the reaction and enzyme lists
Returns:

a nested dictionary whose keys are reaction ids and values are dictionaries whose

keys are enzyme ids and values are the mean kcat observed for the enzyme for the reaction

Return type:

dict

h1_hesc.utils.eval_gene_reaction_rule(reaction, gene_expressions)[source]

Calculate the activity of a gene-reaction rule based on the expression of each gene

Parameters:
  • reaction (cobra.Reaction) – COBRApy reaction
  • gene_expressions (dict) – dictionary whose keys are gene ids (str) and values are gene expressions (bool)
Returns:

reaction activity

Return type:

bool

h1_hesc.utils.format_observed_kcats(parameters)[source]

Format the k_cat observations of a reaction for Excel export

Parameters:parameters (list of sabio_rk.Parameter) – list of parameters
Returns:
  • float: Mean of the observations
  • float: Standard deviation of the observations
  • list of dict: list of the individual observations and their metadata
Return type:tuple
h1_hesc.utils.format_observed_kms(parameters)[source]

Format the K_m observations of a reaction for Excel export

Parameters:parameters (list of sabio_rk.Parameter) – list of parameters
Returns:
  • str: semicolon-separated list of means of the observed K_m’s for each species
  • str: semicolon-separated list of the standard deviations of the observed K_m’s for each species
  • str: semicolon-separated list of species for which K_m’s were observed
  • list of dict: list of the individual observations and their metadata
Return type:tuple
h1_hesc.utils.get_complexes_from_gene_rule(rule)[source]

Get a list of all of the complexes that can catalyze a reaction from its gene-reaction rule

Parameters:rule (str) – gene-reaction rule (e.g. HGNC:8994 or HGNC:8995 or HGNC:8996)
Returns:
list of complexes that can catalyze the reaction, with each complex listed
as a list of the names of the subunits
Return type:list of list of str
h1_hesc.utils.get_enzyme_equation(enzyme)[source]

Get a string representation of the subunits of an enzyme

Parameters:enzyme (sabio_rk.Enzyme) – enzyme
Returns:string representation of the subunits of the enzyme e.g. 2*subunit-A; subunit-B
Return type:str
h1_hesc.utils.get_reaction_equation(reaction)[source]

Create a string representation of the equation of a reaction

Parameters:reaction (dict) – dictionary that contains a key participants whose value is a list of participants, each of which is a dictionary with a species
Returns:string representation of the equation of the reaction
Return type:str
h1_hesc.utils.has_all_inchi_structures(reaction)[source]

Determine if structures (in InChI format) are defined for all of a reaction’s participants

Parameters:reaction (dict) – dictionary that contains a key participants whose value is a list of participants, each of which is a dictionary with a species
Returns:True if structures (in InChI format) are defined for all of a reaction’s participants
Return type:bool
h1_hesc.utils.parse_cobra_reaction_equation(equation)[source]

Parse a COBRApy reaction equation

Parameters:equation (str) – a COBRApy reaction equation
Returns:dictionary whose keys are species ids (str) and values are stoichiometric coefficients (float) bool: reversibility of the reaction
Return type:dict
h1_hesc.utils.parse_cobra_reaction_equation_side(side)[source]

Parse a side of a COBRApy reaction equation

Parameters:side (str) – side of a COBRApy reaction equation
Returns:dictionary whose keys are species ids (str) and values are stoichiometric coefficients (float)
Return type:dict
h1_hesc.utils.remove_inchi_layer(inchi_structure, layer_to_remove, raise_error_if_no_layer=False)[source]

Remove a layer for an InChI-encoded chemical structure

Parameters:
  • inchi_structure (str) – InChI-encoded chemical structure
  • layer_to_remove (str) – character code for the layer to remove
  • raise_error_if_no_layer (bool, optional) – if True, raise an error if the structure doesn’t contain the layer
Returns:

InChI-encoded chemical structure with the specified layer removed

Return type:

str

Raises:

ValueError – if the raise_error_if_no_layer is True and the layer isn’t in the structure

3.1.5. Module contents