CardamomOT.inference.simulations¶
Numerical solvers and utilities for gene regulatory network simulations.
This module provides both Numba-accelerated low-level functions and higher-level classes for the two simulation regimes used by CARDAMOM:
deterministic ordinary differential equation (ODE) dynamics handled by
ApproxODE;stochastic piecewise-deterministic Markov process (PDMP) modelling bursty protein production encapsulated in
BurstyPDMP.
Helper routines such as base_kon_vector and kon_ref are also
included, since they are reused across inference and trajectory modules.
Classes¶
ODE version of the network model |
|
Bursty PDMP version of the network model (promoters not described) |
|
Basic object to store simulations. |
Functions¶
|
Deterministic flow for the bursty model. |
|
Euler step for the deterministic limit model. |
|
Perform simulation of the network model (ODE version). |
|
Perform simulation of the network model (PDMP version). |
Module Contents¶
- CardamomOT.inference.simulations.flow(time, d1, P, ns=1)¶
Deterministic flow for the bursty model.
- CardamomOT.inference.simulations.step_ode(d1, ks, inter, basal, dt, scale, P, ns=1)¶
Euler step for the deterministic limit model.
- class CardamomOT.inference.simulations.ApproxODE(d, basal, inter)¶
ODE version of the network model
- simulation(d1, ks, timepoints, scale, ns=1, verb=False)¶
Simulation of the deterministic limit model, which is relevant when promoters and mRNA are much faster than proteins. 1. Nonlinear ODE system involving proteins only 2. Mean level of mRNA given protein levels
- class CardamomOT.inference.simulations.BurstyPDMP(ks, basal, inter, ns=1)¶
Bursty PDMP version of the network model (promoters not described)
- step(d1, ks, c, scale, ns=1)¶
Compute the next jump and the next step of the thinning method, in the case of the bursty model.
- simulation(d1, ks, c, timepoints, scale, ns=1, verb=False)¶
Exact simulation of the network in the bursty PDMP case.
- simulation_with_growth(d1, ks, c, timepoints, scale, prolif_fn, ns=1, verb=False)¶
- Same as simulation but also accumulates the growth log-weight:
log_weight = integral R(P(t)) dt (forward Riemann sum over PDMP steps)
This is the forward-only estimate of the full growth log-weight R·Δt. For a combined forward+backward correction (trapezoidal rule using both start and end protein states), see the resampling step in simulate_trajectories_unitary, which does not use this method.
prolif_fn : callable (1, n_proteins) -> (1,) array of net growth rates. Returns (sim_array, log_weight).
- class CardamomOT.inference.simulations.Simulation(t, p, log_weight: float = 0.0)¶
Basic object to store simulations.
- CardamomOT.inference.simulations.simulate_next_prot_ode(d, a, basal, inter, t, scale, **kwargs) Simulation¶
Perform simulation of the network model (ODE version).
- CardamomOT.inference.simulations.simulate_next_prot_pdmp(d, a, c, basal, inter, t, scale, **kwargs) Simulation¶
Perform simulation of the network model (PDMP version).
- Optional kwargs:
- prolif_fncallable (1, n_proteins) -> (1,) or None.
When provided, the PDMP micro-steps are used to accumulate log_weight = integral R(P(t)) dt stored in Simulation.log_weight.