CardamomOT.inference.simulations ================================ .. py:module:: CardamomOT.inference.simulations .. autoapi-nested-parse:: 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 :class:`ApproxODE`; * stochastic piecewise-deterministic Markov process (PDMP) modelling bursty protein production encapsulated in :class:`BurstyPDMP`. Helper routines such as ``base_kon_vector`` and ``kon_ref`` are also included, since they are reused across inference and trajectory modules. Classes ------- .. autoapisummary:: CardamomOT.inference.simulations.ApproxODE CardamomOT.inference.simulations.BurstyPDMP CardamomOT.inference.simulations.Simulation Functions --------- .. autoapisummary:: CardamomOT.inference.simulations.flow CardamomOT.inference.simulations.step_ode CardamomOT.inference.simulations.simulate_next_prot_ode CardamomOT.inference.simulations.simulate_next_prot_pdmp Module Contents --------------- .. py:function:: flow(time, d1, P, ns=1) Deterministic flow for the bursty model. .. py:function:: step_ode(d1, ks, inter, basal, dt, scale, P, ns=1) Euler step for the deterministic limit model. .. py:class:: ApproxODE(d, basal, inter) ODE version of the network model .. py:method:: 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 .. py:class:: BurstyPDMP(ks, basal, inter, ns=1) Bursty PDMP version of the network model (promoters not described) .. py:method:: 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. .. py:method:: simulation(d1, ks, c, timepoints, scale, ns=1, verb=False) Exact simulation of the network in the bursty PDMP case. .. py:method:: 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). .. py:class:: Simulation(t, p, log_weight: float = 0.0) Basic object to store simulations. .. py:function:: simulate_next_prot_ode(d, a, basal, inter, t, scale, **kwargs) -> Simulation Perform simulation of the network model (ODE version). .. py:function:: simulate_next_prot_pdmp(d, a, c, basal, inter, t, scale, **kwargs) -> Simulation Perform simulation of the network model (PDMP version). Optional kwargs: prolif_fn : callable (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.