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(sim_data, modifiedFormsMonomers, tcsMolecules)[source]
Maps each complex to a dictionary that maps each subunit of the complex to its stoichiometry.
This function also handles correcting compartment tags for subunits where the compartment tag listed in the raw_data.modified_proteins table is inconsistent with the molecule’s tag saved in the bulk molecule data.
- _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.
- _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 one.
- get_reaction_name(templateName, systemMolecules)[source]
Returns reaction name for a particular system.
- make_modified_molecule_list()[source]
Since the raw modified_proteins table contains proteins that are not in the original molecule pool provided in raw_data.two_component_systems (PHOQ-MONOMER, PHOR-MONOMER, ARCB-MONOMER, and NARX-MONOMER), the list of molecules that the stoich_matrix_monomers() function pulls from needs to be manually expanded to include these proteins.
This function generates a modified molecule list that includes the original molecules from the TCS molecule pool (built in __init__()) and the new proteins from the raw_data.modified_proteins file that were not included in the original list.
- 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 mapping complexes to their base monomers subunits.
Rows: modified molecules (complexes and monomers, including base monomer subunits that were not included in the original molecule list extracted from raw_data.two_component_systems, but were included in the raw_data.modified_proteins table). Columns: complexes Values: base monomer stoichiometry (not including non-monomer subunits, like metabolites, ATP, etc.)