3.1. h1_hesc package

3.1.1. Subpackages

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]
decay()[source]
essential()[source]
growth_decay()[source]
kb()[source]
model()[source]
sd_kb()[source]
sd_model()[source]
sd_sim()[source]
sim()[source]
h1_hesc.__main__.main()[source]

3.1.4. h1_hesc._version module

3.1.5. 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.create_conv_model(met_model)[source]

Convert a metabolism model into a linear programming model in conv_opt format

Parameters

met_model (wc_lang.Submodel) – metabolism submodel

Returns

a linear programming model in conv_opt format dict of str: conv_opt.Variable): a dictionary mapping

reaction IDs to their associated conv_opt.Variable objects

dict of str: list of conv_opt.LinearTerm: a

dictionary mapping species IDs to their associated list of conv_opt.LinearTerm objects representing their stoichiometry coefficients in reactions they participate in

Return type

conv_opt.Model

h1_hesc.utils.determine_bounds(met_model, cell_volume, scale_factor=None)[source]

Determine the bounds of a linear programming problem based on calculated rate laws or measured fluxes

Parameters
  • met_model (wc_lang.Submodel) – metabolism submodel

  • cell_volume (float) – cell volume

  • scale_factor (float, optional) – a scaling factor for the bounds; the default value is 1

Returns

tuple: a dictionary that maps reaction IDs

to (minimum bound, maximum bound) tuples

Return type

dict of str

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.extract_info_from_string(input_str, start_substr, end_substr, include_start=True)[source]

Parse strings to get metadata recorded in undefined format

Parameters
  • input_str (str) – input string

  • start_substr (str) – substring that indicates the metadata key

  • end_substr (str) – substring after the metadata value

  • include_start (bool, optional) – if False, the substring indicating the metadata key will be stripped out of the returned string, default = True

Returns

metadata value

Return type

str

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 (list of dict) – 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.get_value_inchi_formula_connectivity(inchi_str)[source]

Get only the empirical formula and connectivity portion of an InChI string

Parameters

inchi_str (str) – InChI string

Returns

InchI string with only the the empirical formula and connectivity portion

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_type

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.6. Module contents