3.1.1.4. h1_hesc.model_sim package

3.1.1.4.1. Submodules

3.1.1.4.2. h1_hesc.model_sim.essentiality module

Simulation of gene essentiality of the H1-hESC whole-cell model

Author

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

Date

2021-06-07

Copyright

2021, Karr Lab

License

MIT

h1_hesc.model_sim.essentiality.compare_essentiality(simulation_path=None, data_path=None)[source]

Compare simulated essential genes with experimental data

Parameters
  • simulation_path (str, optional) – path to file where simulated list of essential genes are stored

  • ('obj (data_path) – str, optional): path to experimental data file

Returns

list of true positive genes list: list of true negative genes list: list of false positive genes list: list of false negative genes list: list of genes without data

Return type

list

h1_hesc.model_sim.essentiality.essentiality_simulation(deleted_gene, knowledgebase, model, type_of_species, biomass_component=None)[source]
Simulate the essentiality of a gene. First, the concentrations of products

(RNA and protein) of the gene is set to zero. Then, a cascading failure analysis is conducted on the reaction network by iteratively evaluating all the rate laws and setting to zero the concentrations of products of reactions with zero rate, until no further change can be found on the evaluated rates of all reactions. Then, flux balance analysis is run on the metabolism submodel by maximizing the biomass reaction that contains species in a provided list of biomass components. If all the biomass reaction carry a flux in the solution, the gene is considered non-essential.

Parameters
  • deleted_gene (str) – ID of the gene to be deleted

  • knowledgebase (wc_kb.KnowledgeBase) – the knowledgebase associated with the model

  • model (wc_lang.Model) – the model to be simulated

  • type_of_species (dict) – the type name (e.g. ‘DNA’, ‘metabolite’) of each species type

:param biomass_component (list: optional): list of IDs for species whose

production would be tested for gene essentiality; default is a pre-defined list

Returns

True if the gene is essential, else False wc_lang.Model: simulated model

Return type

bool

h1_hesc.model_sim.essentiality.plot_time_series(gene, doubling_time=None, ko_time_series_path=None, polr_time_series_path=None, ribo_time_series_path=None, growth_time_series_path=None, output_path=None)[source]
Plot the concentration time series of the products of the input gene

and normalized growth on a secondary y-axis, and save the figure.

Parameters
  • gene (str) – Ensembl gene ID whose product concentrations are to be plotted

  • doubling_time (float, optional) – the doubling time for use in determining generations in the plot; default is 71280.0 sec, which is the doubling time of H1 hESC

  • ko_time_series_path (str, optional) – path to a file storing the time series of macromolecular complexes upon individual gene deletion

  • polr_time_series_path (str, optional) – path to a file storing the time series of macromolecular complexes upon deletion of RNA polymerase

  • ribo_time_series_path (str, optional) – path to a file storing the time series of macromolecular complexes upon deletion of ribosome

  • growth_time_series_path (str, optional) – path to a file storing the time series of growth

  • output_path (str, optional) – path to the directory where the figures will be saved

h1_hesc.model_sim.essentiality.prepare_conv_model(model, biomass_component=None)[source]
Create a conv_opt model object that has only a subset of the original

biomass components, while the rest are changed into individual exchange reactions.

Parameters

model (wc_lang.Model) – the model to be simulated

:param biomass_component (list: optional): list of IDs for species whose

production would be tested for gene essentiality; default is a pre-defined list

Returns

metabolism submodel represented as a conv_opt Model object dict of conv_opt.Variable: dictionary with variable IDs as keys

and variable objects as values

dict of conv_opt.Term: dictionary with variable IDs as keys and

linear term objects for the exchange reactions of biomass components that are removed from the original biomass reaction

Return type

conv_opt.Model

h1_hesc.model_sim.essentiality.recalibrate_initial_values(input_kb_path=None, input_model_path=None, output_path=None, functional_genes_only=False)[source]
h1_hesc.model_sim.essentiality.run_essentiality(input_kb_path=None, input_model_path=None, output_path=None, all_genes=False, gene_path=None, biomass_component=None, start=None, end=None)[source]
Determine the essentiality of all genes in the whole-cell model of H1 hESCs

and write the results to a file

Parameters
  • input_kb_path (str, optional) – path to the knowledge base; if not provided, a knowledge base will be read from a default file

  • input_model_path (str, optional) – path to a model for simulation; if not provided, a model will be read from a default file

  • output_path (str, optional) – path to file where results will be written

  • all_genes (bool, optional) – if True, all genes will be tested, else only genes provided in the gene_path file will be tested; default is False

  • gene_path (str, optional) – path to file storing list of genes to be tested

:param biomass_component (list: optional): list of IDs for species whose

production would be tested for gene essentiality; default is a pre-defined list

Parameters
  • start (int, optional) – index of the element in the list of genes to start the test

  • end (int, optional) – index of the element in the list of genes to end the test

Returns

list of essential gene IDs conv_opt.Model: metabolism as a linear programming model dict of conv_opt.LinearTerm: dictionary of linear terms

for all pseudo-reaction variables

Return type

list

h1_hesc.model_sim.essentiality.run_gene_expression(input_kb_path=None, input_model_path=None, output_path=None, gene_path=None, sim_type=None, start=None, end=None, test_kb=None, polr_hl=None, ribo_hl=None, duration=None)[source]
Simulate the net synthesis and degradation of the mrna, protein and

macromolecular complexes for wild type, individual gene knockout, RNA polymerase knockout or ribosome knockout phenotype.

Parameters
  • input_kb_path (str, optional) – path to the knowledge base; if not provided, a knowledge base will be read from a default file

  • input_model_path (str, optional) – path to a model for simulation; if not provided, a model will be read from a default file

  • output_path (str, optional) – path to file where results will be written

  • gene_path (str, optional) – path to file storing list of genes to be tested

  • ( (sim_type) – obj: int, optional): type of simulation; if 1 is provided, simulation of RNA polymerase knockout will be performed; if 2 is provided, simulation of ribososme knockout will be performed; if nothing is provided, the default will simulate gene knockout;

  • start (int, optional) – index of the element in the list of genes to start the test

  • end (int, optional) – index of the element in the list of genes to end the test

  • test_kb (wc_kb.KnowledgeBase, optional) – knowledge base input for test purpose

  • polr_hl (float, optional) – the half-life of RNA polymerase, to be provided if simulating knockout of RNA polymerase; default is None

  • ribo_hl (float, optional) – the half-life of ribosome, to be provided if simulating ribosome knockout; default is None

  • duration (float, optional) – simulation duration; default is ten times of doubling time

Raises

ValueError – if the sim_type input is not 1 or 2

h1_hesc.model_sim.essentiality.simulate_effect_on_growth(input_model_path=None, ko_time_series_path=None, polr_time_series_path=None, ribo_time_series_path=None, output_path=None, biomass_component=None, gen_no=None, scale_factor=None, start=None, end=None)[source]
Simulate the effect of gene knockout on growth at different time points by

constraining metabolism submodel to the abundances of macromolecular complexes at the specific time point. To simulate the effect of individual gene knockout, only the abundances of deleted gene products will be reduced while the other complexes are assumed to increase at a steady rate so as to maintain their concentrations.

Parameters
  • input_model_path (str, optional) – path to a model for simulation; if not provided, a model will be read from a default file

  • ko_time_series_path (str, optional) – path to a file storing the time series of macromolecular complexes upon individual gene deletion

  • polr_time_series_path (str, optional) – path to a file storing the time series of macromolecular complexes upon deletion of RNA polymerase

  • ribo_time_series_path (str, optional) – path to a file storing the time series of macromolecular complexes upon deletion of ribosome

  • output_path (str, optional) – path to file where results will be written

:param biomass_component (list: optional): list of IDs for species whose

production would be tested for gene essentiality; default is a pre-defined list

Parameters
  • gen_no (int, optional) – number of generations to be simulated in the cases of RNA polymerase and ribosome knockout; the default is 10 generations

  • scale_factor (float, optional) – factor used to scale the bounds in the linear programming problem; default is 1.

  • start (int, optional) – index of the element in the list of genes to start the test

  • end (int, optional) – index of the element in the list of genes to end the test

Returns

the model

Return type

wc_lang.Model

h1_hesc.model_sim.essentiality.simulate_gene_expression(selected_proteins, knowledgebase, model, duration, gene_ko=True, ribo_hl=None, polr_hl=None)[source]
Simulate the net synthesis and degradation of the mrna, protein and

macromolecular complexes of selected genes for wild type, indvidual gene knockout, RNA polymerase or ribosome knockout phenotypes. The simulation assumes that growth and the abundances of molecules other than those selected above increase exponentially to maintain a steady state concentration. For simulating the effect of knocking out RNA polymerase (or ribosome), its abundance is assumed to decrease exponentially at a rate determined based on estimated half-life. ODE simulation is used.

Parameters
  • selected_proteins (list of str) – list of selected protein IDs

  • knowledgebase (wc_kb.KnowledgeBase) – the knowledgebase associated with the model

  • model (wc_lang.Model) – the model to be simulated

  • duration (float) – simulation duration

  • gene_ko (bool, optional) – True if simulating the deletion of a gene; default is True

  • ribo_hl (float, optional) – the half-life of ribosome, to be provided if simulating ribosome knockout; default is None

  • polr_hl (float, optional) – the half-life of RNA polymerase, to be provided if simulating knockout of RNA polymerase; default is None

Returns

dictionary with time and species ID as keys and

list of time points and the species abundance at each time point as values

str: error message if the ODE solution fails, otherwise an empty string dict of str:list of :obj:`tuple: dictionary mapping

species ID to associated list of tuple for each reaction participated by the species. The first element in the tuple shows the stoichiometry coefficient of the species while the second element shows the rate law

Return type

dict

3.1.1.4.3. h1_hesc.model_sim.main module

Main for model simulation

Author

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

Date

2019-11-11

Copyright

2019, Karr Lab

License

MIT

h1_hesc.model_sim.main.sim_main(model_core_path=None, sim_results_dir=None, sim_time=None, checkpoint_frequency=1, add_rxn=False, add_rxn_path=None, profile=False, verbose=False, object_memory_change_interval=0)[source]

Simulate a whole-cell model of H1 hESCs

Parameters
  • model_core_path (str, optional) – path to read/write the model

  • sim_results_dir (str, optional) – path to a directory in which results are stored

  • sim_time (float, optional) – the end time of the simulation (sec); if not provided, the cell doubling time will be used

  • checkpoint_frequency (int, optional) – the number of checkpoints during simulation; if not provided, only the final state is checkpointed

  • add_rxn (bool, optional) – if True, reactions with a fixed rate will be added before simulation to produce/consume species listed in a default file; the default is False

  • add_rxn_path (str, optional) – path to reactions to be added if add_rxn is True

  • profile (bool, optional) – whether to output a profile of the simulation’s performance created by a Python profiler

  • verbose (bool, optional) – whether to print success output

  • object_memory_change_interval (int, optional) – event interval between memory profiles of the simulation; default of 0 indicates no profile

Returns

simulated model

Return type

wc_lang.Model

3.1.1.4.4. Module contents

Model simulation API

Author

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

Date

2019-11-11

Copyright

2019, Karr Lab

License

MIT