reconstruction.ecoli.dataclasses.process.two_component_system

Two component systems.

Note: Ligand binding to histidine kinases is modeled by equilibrium.

TODOs: moleculesToNextTimeStep()

Consider relocating (since it’s useful for both the parca and simulation)

class reconstruction.ecoli.dataclasses.process.two_component_system.TwoComponentSystem(raw_data, sim_data)[source]

Bases: object

_buildComplexToMonomer(modifiedFormsMonomers, tcsMolecules)[source]

Maps each complex to a dictionary that maps each subunit of the complex to its stoichiometry

_make_dependency_matrix()[source]

Builds matrix mapping linearly independent molecules (ATP, histidine kinases, response regulators, and ligand-bound histidine kinases for positively oriented networks) to their dependents.

_make_derivative()[source]

Creates symbolic representation of the ordinary differential equations and the Jacobian. Used during simulations.

_make_derivative_parca()[source]

Creates symbolic representation of the ordinary differential equations and the Jacobian assuming ATP, ADP, Pi, water and protons are at steady state. Used in the parca.

_make_y_dy()[source]
_populate_derivative_and_jacobian()[source]

Compile callable functions for computing the derivative and the Jacobian.

derivatives(t, y)[source]

Calculate derivatives from stoichiometry and rates with argument order for solve_ivp.

derivatives_jacobian(t, y)[source]

Calculate the jacobian of derivatives from stoichiometry and rates with argument order for solve_ivp.

derivatives_jacobian_jit(t, y)[source]

Calculate the jacobian of derivatives from stoichiometry and rates with argument order for solve_ivp.

derivatives_jit(t, y)[source]

Calculate derivatives from stoichiometry and rates with argument order for solve_ivp.

get_monomers(cplxId)[source]

Returns subunits for a complex (or any ID passed). If the ID passed is already a monomer returns the monomer ID again with a stoichiometric coefficient of zero.

get_reaction_name(templateName, systemMolecules)[source]

Returns reaction name for a particular system.

mass_balance()[source]

Sum along the columns of the massBalance matrix to check for reaction mass balance

mass_matrix()[source]

Builds stoichiometry mass matrix Rows: molecules Columns: reactions Values: molecular mass

molecules_to_next_time_step(moleculeCounts, cellVolume, nAvogadro, timeStepSec, random_state, method='LSODA', min_time_step=None, jit=True, methods_tried=None)[source]

Calculates the changes in the counts of molecules in the next timestep by solving an initial value ODE problem.

Parameters:
  • moleculeCounts (1d ndarray, ints) – current counts of molecules involved in the ODE

  • cellVolume (float) – current volume of cell

  • nAvogadro (float) – Avogadro’s number

  • timeStepSec (float) – current length of timestep in seconds

  • random_state (RandomState object) – process random state

  • method (str) – name of the ODE method to use

  • min_time_step (int) – if not None, timeStepSec will be scaled down until it is below min_time_step if negative counts are encountered

  • jit (bool) – if True, use the jit compiled version of derivatives functions

  • methods_tried (Optional[Set[str]]) – methods for the solver that have already been tried

Returns:

counts of molecules that need

to be consumed

allMoleculesChanges (1d ndarray, ints): expected changes in

molecule counts after timestep

Return type:

moleculesNeeded (1d ndarray, ints)

molecules_to_ss(moleculeCounts, cellVolume, nAvogadro, timeStepSec=1e+20)[source]

Calculates the changes in the counts of molecules as the system reaches steady state

Parameters:
  • moleculeCounts – current counts of molecules involved in the ODE

  • cellVolume – current volume of cell

  • nAvogadro – Avogadro’s number

  • timeStepSec – current length of timestep (set to large number)

Returns:

counts of molecules that need to be consumed allMoleculesChanges: expected changes in molecule counts after timestep

Return type:

moleculesNeeded

stoich_matrix()[source]

Builds stoichiometry matrix Rows: molecules Columns: reactions Values: reaction stoichiometry

stoich_matrix_monomers()[source]

Builds stoichiometry matrix for monomers (complex subunits) Rows: molecules (complexes and monomers) Columns: complexes Values: monomer stoichiometry