ecoli.processes.metabolism

Metabolism

Encodes molecular simulation of microbial metabolism using flux-balance analysis.

This process demonstrates how metabolites are taken up from the environment and converted into other metabolites for use in other processes.

NOTE: - In wcEcoli, metabolism only runs after all other processes have completed and internal states have been updated (deriver-like, no partitioning necessary)

class ecoli.processes.metabolism.FluxBalanceAnalysisModel(parameters, timeline, include_ppgpp=True)[source]

Bases: object

Metabolism model that solves an FBA problem with modular_fba.

Parameters:
  • parameters (dict[str, Any]) – parameters from simulation data

  • timeline (tuple[tuple[int, str], ...]) – timeline for nutrient changes during simulation (time of change, media ID), by default [(0.0, ‘minimal’)]

  • include_ppgpp (bool) – if True, ppGpp is included as a concentration target

set_molecule_levels(metabolite_counts, counts_to_molar, coefficient, current_media_id, unconstrained, constrained, conc_updates, aa_uptake_package=None)[source]

Set internal and external molecule levels available to the FBA solver.

Parameters:
  • metabolite_counts (ndarray[Any, dtype[int64]]) – counts for each metabolite with a concentration target

  • counts_to_molar (Unum) – conversion from counts to molar (counts/volume)

  • coefficient (Unum) – coefficient to convert from mmol/g DCW/hr to mM basis (mass*time/volume)

  • current_media_id (str) – ID of current media

  • unconstrained (set[str]) – molecules that have unconstrained import

  • constrained (set[str]) – molecules (keys) and their limited max uptake rates (mol / mass / time)

  • conc_updates (dict[str, Unum]) – updates to concentrations targets for molecules (mmol/L)

  • aa_uptake_package (tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[str_]], bool] | None) – (uptake rates, amino acid names, force levels), determines whether to set hard uptake rates

set_reaction_bounds(catalyst_counts, counts_to_molar, coefficient, gtp_to_hydrolyze)[source]

Set reaction bounds for constrained reactions in the FBA object.

Parameters:
  • catalyst_counts (ndarray[Any, dtype[int64]]) – counts of enzyme catalysts

  • counts_to_molar (Unum) – conversion from counts to molar (counts/volume)

  • coefficient (Unum) – coefficient to convert from mmol/g DCW/hr to mM basis (mass*time/volume)

  • gtp_to_hydrolyze (float) – number of GTP molecules to hydrolyze to account for consumption in translation

set_reaction_targets(kinetic_enzyme_counts, kinetic_substrate_counts, counts_to_molar, time_step)[source]

Set reaction targets for constrained reactions in the FBA object.

Parameters:
  • kinetic_enzyme_counts (ndarray[Any, dtype[int64]]) – counts of enzymes used in kinetic constraints

  • kinetic_substrate_counts (ndarray[Any, dtype[int64]]) – counts of substrates used in kinetic constraints

  • counts_to_molar (Unum) – conversion from counts to molar (counts/volume)

  • time_step (Unum) – current time step (time)

Returns:

3-element tuple containing

  • mean_targets: mean target for each constrained reaction

  • upper_targets: upper target limit for each constrained reaction

  • lower_targets: lower target limit for each constrained reaction

Return type:

tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]]

update_external_molecule_levels(objective, metabolite_concentrations, external_molecule_levels)[source]

Limit amino acid uptake to what is needed to meet concentration objective to prevent use as carbon source, otherwise could be used as an infinite nutrient source.

Parameters:
  • objective (dict[str, Unum]) – homeostatic objective for internal molecules (molecule ID: concentration in counts/volume units)

  • metabolite_concentrations (Unum) – concentration for each molecule in metabolite_names

  • external_molecule_levels (ndarray[Any, dtype[float64]]) – current limits on external molecule availability

Returns:

Updated limits on external molecule availability

Return type:

ndarray[Any, dtype[float64]]

TODO(wcEcoli):

determine rate of uptake so that some amino acid uptake can be used as a carbon/nitrogen source

class ecoli.processes.metabolism.Metabolism(parameters=None)[source]

Bases: Step

Metabolism Process

defaults: Dict[str, Any]
{   'aa_exchange_names': [],
    'aa_names': [],
    'aa_targets_not_updated': set(),
    'amino_acid_ids': {},
    'avogadro': 6.02214076e+23 [1/mol],
    'base_reaction_ids': [],
    'cell_density': 1100.0 [g/L],
    'cell_dry_mass_fraction': 0.3,
    'current_timeline': None,
    'dark_atp': 33.565052868380675 [mmol/g],
    'doubling_time': 44.0 [min],
    'exchange_data_from_media': <function Metabolism.<lambda> at 0x7f82414f77e0>,
    'exchange_molecules': [],
    'fba_reaction_ids_to_base_reaction_ids': [],
    'get_biomass_as_concentrations': <function Metabolism.<lambda> at 0x7f82414f7420>,
    'get_import_constraints': <function Metabolism.<lambda> at 0x7f8241680860>,
    'get_masses': <function Metabolism.<lambda> at 0x7f82414f7880>,
    'get_ppGpp_conc': <function Metabolism.<lambda> at 0x7f82414f7740>,
    'import_constraint_threshold': 0,
    'imports': {},
    'include_ppgpp': False,
    'linked_metabolites': None,
    'mechanistic_aa_transport': False,
    'media_id': 'minimal',
    'metabolism': {},
    'ngam': 8.39 [mmol/g.h],
    'nutrientToDoublingTime': {},
    'ppgpp_id': 'ppgpp',
    'reduce_murein_objective': False,
    'removed_aa_uptake': [],
    'seed': 0,
    'time_step': 1,
    'use_trna_charging': False}
name = 'ecoli-metabolism'
next_update(timestep, states)[source]
ports_schema()[source]
topology
{   'boundary': ('boundary',),
    'bulk': ('bulk',),
    'bulk_total': ('bulk',),
    'environment': {'_path': ('environment',), 'exchange': ('exchange',)},
    'global_time': ('global_time',),
    'listeners': ('listeners',),
    'next_update_time': ('next_update_time', 'metabolism'),
    'polypeptide_elongation': ('process_state', 'polypeptide_elongation'),
    'timestep': ('timestep',)}
update_amino_acid_targets(counts_to_molar, count_diff, amino_acid_counts)[source]

Finds new amino acid concentration targets based on difference in supply and number of amino acids used in polypeptide_elongation. Skips updates to molecules defined in self.aa_targets_not_updated: - L-SELENOCYSTEINE: rare AA that led to high variability when updated

Parameters:
  • counts_to_molar (Unum) – conversion from counts to molar

  • count_diff (dict[str, float])

  • amino_acid_counts (dict[str, float])

Returns:

{AA name (str): new target AA conc (float with mol/volume units)}

Return type:

dict[str, Unum]

update_condition(timestep, states)[source]

See update_condition().