ecoli.library.initial_conditions

Functions to initialize molecule states from sim_data.

ecoli.library.initial_conditions.calculate_cell_mass(bulk_state, unique_molecules, sim_data)[source]

Calculates cell mass in femtograms.

ecoli.library.initial_conditions.create_bulk_container(sim_data, n_seeds=1, condition=None, seed=0, ppgpp_regulation=True, trna_attenuation=True, mass_coeff=1, form_complexes=True)[source]
ecoli.library.initial_conditions.create_new_unique_molecules(name, n_mols, sim_data, random_state, **attrs)[source]

Helper function to create a new Numpy structured array with n_mols instances of the unique molecule called name. Accepts keyword arguments that become initial values for specified attributes of the new molecules.

ecoli.library.initial_conditions.determine_chromosome_state(tau, replichore_length, n_max_replisomes, place_holder, cell_mass, critical_mass, replication_rate)[source]

Calculates the attributes of oriC’s, replisomes, and chromosome domains on the chromosomes at the beginning of the cell cycle.

Parameters:
  • tau (Unum) – the doubling time of the cell (with Unum time unit)

  • replichore_length (Unum) – the amount of DNA to be replicated per fork, usually half of the genome, in base-pairs (with Unum nucleotide unit)

  • n_max_replisomes (int) – the maximum number of replisomes that can be formed given the initial counts of replisome subunits

  • place_holder (int) – placeholder value for chromosome domains without child domains

  • cell_mass (Unum) – total mass of the cell with mass units (with Unum mass unit)

  • critical_mass (Unum) – mass per oriC before replication is initiated (with Unum mass unit)

  • replication_rate (float) – rate of nucleotide elongation (with Unum nucleotides per time unit)

Returns:

Three dictionaries, each containing updates to attributes of a unique molecule type.

  • oric_state: dictionary of the following format:

    {'domain_index': a vector of integers indicating which chromosome domain the
        oriC sequence belongs to.}
    
  • replisome_state: dictionary of the following format:

    {'coordinates': a vector of integers that indicates where the replisomes
        are located on the chromosome relative to the origin in base pairs,
    'right_replichore': a vector of boolean values that indicates whether the
        replisome is on the right replichore (True) or the left replichore (False),
    'domain_index': a vector of integers indicating which chromosome domain the
        replisomes belong to. The index of the "mother" domain of the replication
        fork is assigned to the replisome}
    
  • domain_state: dictionary of the following format:

    {'domain_index': the indexes of the domains,
    'child_domains': the (n_domain X 2) array of the domain indexes of the two
        children domains that are connected on the oriC side with the given domain.}
    

Return type:

tuple[dict[str, ndarray[Any, dtype[int32]]], dict[str, ndarray[Any, dtype[Any]]], dict[str, ndarray[Any, dtype[int32]]]]

ecoli.library.initial_conditions.initialize_bulk_counts(sim_data, media_id, import_molecules, random_state, mass_coeff, ppgpp_regulation, trna_attenuation, form_complexes=True)[source]
ecoli.library.initial_conditions.initialize_chromosomal_segments(unique_molecules, sim_data, unique_id_rng)[source]

Initialize unique molecule representations of chromosomal segments. All chromosomal segments are assumed to be at their relaxed states upon initialization.

ecoli.library.initial_conditions.initialize_complexation(bulk_counts, sim_data, random_state)[source]
ecoli.library.initial_conditions.initialize_full_chromosome(unique_molecules, sim_data, unique_id_rng)[source]

Initializes the counts of full chromosomes to one. The division_time of this initial chromosome is set to be zero for consistency.

ecoli.library.initial_conditions.initialize_mature_RNA(bulk_counts, sim_data)[source]

Initializes counts of mature RNAs in the bulk molecule container using the counts of unprocessed RNAs. Also consolidates the different variants of each rRNA molecule into the main type.

ecoli.library.initial_conditions.initialize_protein_monomers(bulk_counts, sim_data, random_state, mass_coeff, ppgpp_regulation, trna_attenuation)[source]
ecoli.library.initial_conditions.initialize_replication(bulk_state, unique_molecules, sim_data, cell_mass, mechanistic_replisome, unique_id_rng)[source]

Initializes replication by creating an appropriate number of replication forks given the cell growth rate. This also initializes the gene dosage bulk counts using the initial locations of the forks.

ecoli.library.initial_conditions.initialize_rna(bulk_counts, sim_data, random_state, mass_coeff, ppgpp_regulation, trna_attenuation)[source]

Initializes counts of RNAs in the bulk molecule container using RNA expression data. mRNA counts are also initialized here, but is later reset to zero when the representations for mRNAs are moved to the unique molecule container.

ecoli.library.initial_conditions.initialize_transcription(bulk_state, unique_molecules, sim_data, random_state, unique_id_rng, ppgpp_regulation, trna_attenuation)[source]

Activate RNA polymerases as unique molecules, and distribute them along lengths of trancription units, while decreasing counts of unactivated RNA polymerases (APORNAP-CPLX[c]). Also initialize unique molecule representations of fully transcribed mRNAs and partially transcribed RNAs, using counts of mRNAs initialized as bulk molecules, and the attributes of initialized RNA polymerases. The counts of full mRNAs represented as bulk molecules are reset to zero.

RNA polymerases are placed randomly across the length of each transcription unit, with the synthesis probabilities for each TU determining the number of RNA polymerases placed at each gene.

ecoli.library.initial_conditions.initialize_transcription_factors(bulk_state, unique_molecules, sim_data, random_state)[source]

Initialize transcription factors that are bound to the chromosome. For each type of transcription factor, this function calculates the total number of transcription factors that should be bound to the chromosome using the binding probabilities of each transcription factor and the number of available promoter sites. The calculated number of transcription factors are then distributed randomly to promoters, whose bound_TF attributes and submasses are updated correspondingly.

ecoli.library.initial_conditions.initialize_translation(bulk_state, unique_molecules, sim_data, random_state, unique_id_rng)[source]

Activate ribosomes as unique molecules, and distribute them along lengths of mRNAs, while decreasing counts of unactivated ribosomal subunits (30S and 50S).

Ribosomes are placed randomly across the lengths of each mRNA.

ecoli.library.initial_conditions.initialize_trna_charging(bulk_state, unique_molecules, sim_data, variable_elongation)[source]

Initializes charged tRNA from uncharged tRNA and amino acids

Parameters:
  • bulk_state (ndarray) – Structured array with IDs and counts of all bulk molecules

  • unique_molecules (dict[str, ndarray]) – Mapping of unique molecule names to structured arrays of their current simulation states

  • sim_data (Any) – Simulation data loaded from pickle generated by ParCa

  • variable_elongation (bool) – Sets max elongation higher if True

Note

Does not adjust for mass of amino acids on charged tRNA (~0.01% of cell mass)

ecoli.library.initial_conditions.initialize_unique_molecules(bulk_state, sim_data, cell_mass, random_state, unique_id_rng, superhelical_density, ppgpp_regulation, trna_attenuation, mechanistic_replisome)[source]
ecoli.library.initial_conditions.rescale_initiation_probs(init_probs, TU_index, fixed_synth_probs, fixed_TU_indexes)[source]

Rescales the initiation probabilities of each promoter such that the total synthesis probabilities of certain types of RNAs are fixed to a predetermined value. For instance, if there are two copies of promoters for RNA A, whose synthesis probability should be fixed to 0.1, each promoter is given an initiation probability of 0.05.

ecoli.library.initial_conditions.set_small_molecule_counts(bulk_counts, sim_data, media_id, import_molecules, mass_coeff, cell_mass=None)[source]