linearnoiseapproximation.jl

This package provides a numerical method of applying linear noise approximation (LNA) to a given reaction system

https://github.com/xiaomingfu2013/linearnoiseapproximation.jl

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.0%) to scientific vocabulary

Keywords

linear-noise-approximation reaction-systems
Last synced: 6 months ago · JSON representation ·

Repository

This package provides a numerical method of applying linear noise approximation (LNA) to a given reaction system

Basic Info
  • Host: GitHub
  • Owner: xiaomingfu2013
  • License: mit
  • Language: Julia
  • Default Branch: main
  • Homepage:
  • Size: 383 KB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Topics
linear-noise-approximation reaction-systems
Created almost 3 years ago · Last pushed about 2 years ago
Metadata Files
Readme License Citation

README.md

LinearNoiseApproximation.jl

Build Status doc dev badge

Purpose

This package provides a numerical method to automatically deriving the linear noise approximation (LNA) for a given stochastic reaction network (SRN) using Catalyst.jl. SRNs have proven their flexibility beyond chemical systems and across many different fields. These include biochemistry with gene expression models, epidemiology with compartmental models, ecology with the Lotka-Volterra equations, condensed matter and semiconductor physics with diffusion processes, and even sociology. The derived expanded system can be solved using DifferentialEquations.jl.

Installation

LinearNoiseApproximation.jl can be installed using following commands inside the Julia REPL

julia using Pkg Pkg.add("LinearNoiseApproximation")

It can then be used with

julia using LinearNoiseApproximation

Usage

While LNA has applications in many different fields, it was first derived as a moment-based approximation method for stochastic chemical kinetics. For brevity and historical consistency, we will therefore stick to the naming conventions from this field.

Reaction network with system size Ω

Suppose we have a reaction network, defined with Catalyst.jl

julia rn = @reaction_network TwoStage begin @parameters v0 v1 d0 d1 Ω @species M(t) P(t) v0*Ω, ∅ --> M v1, M --> M + P d0, M --> ∅ d1, P --> ∅ end

Here the system size Ω is integrated into the system (propensities).

With LinearNoiseApproximation.jl, you can now simply obtain the LNA system by calling

julia LNAsys = LNASystem(rn) This system can be solved with DifferentialEquations.jl

julia @variables v0, v1, d0, d1, Ω rates = [v0=>4.0,v1=>10.0,d0=>1.0,d1=>1.0,Ω=>5.0] tspan = (0.0, 20.0) u0 =[0, 0] # initial condition for M and P prob = ODEProblem(LNAsys, u0, tspan, rates) sol = solve(prob,Vern7(),abstol=1e-7, saveat=1.0)

A complete working version of this example is in the examples folder.

Brief introduction to linear noise approximation

LNA is a moment-based approximation method for stochastic chemical kinetics [1]. A general chemical kinetics reaction can be described as follows: given a set of chemical species $X_{i}, i = 1, \ldots, N$, we define $R$ chemical reactions by the notation

math \begin{equation} k_r:\sum_{i=1}^{N}s_{ir}X_{i} \rightarrow \sum_{i=1}^{N}s'_{ir}X_{i}, \tag{1} \end{equation}

where the stoichiometric coefficients $s{ir}$ and $s'{ir}$ are non-negative integer numbers denoting the numbers of reactant and product molecules, respectively. The quantity $k_r$ in Equation (1) is called the reaction rate constant of the $r$-th reaction. Classically, the dynamics of a chemical reaction system as in Equation (1) is modelled by the law of mass action. The law of mass action states that the rate of a reaction is proportional to the product of the concentrations of reactant molecules, which lead to the following rate equations as:

math \begin{equation} \frac{\mathrm{d}}{\mathrm{dt}} \phi_i = \sum_{r=1}^{R} S_{ir} g_r(\boldsymbol{\phi}), \tag{2} \end{equation}

where $\phii$ is the concentration of species $Xi$,

math \boldsymbol{S} = \{S_{ir}\}_{N\times R},\; S_{ir}=s'_{ir} - s_{ir},\; i=1,\ldots,N,\; r=1,\ldots,R \notag

is the stoichiometric matrix, and

math g_r(\boldsymbol{\phi}) = k_r \prod_{i=1}^{N} \phi_i^{s_{ir}},

is the rate of the $r$-th reaction.

However, the law of mass action is only valid when the number of molecules is large. When the number of molecules is small, System (1) can instead be modelled by a continuous-time Markov jump process to study the probability of the system being in a particular state at a given time. The dynamics of such a system can be described by the chemical master equation (CME) [2]:

math \begin{equation} \begin{aligned} \frac{\mathrm{d}}{\mathrm{dt}} P(\boldsymbol{n}, t) = \sum_{r=1}^{R} f_r(\boldsymbol{n} - \mathbf{S}_r, t) P(\boldsymbol{n} - \mathbf{S}_r, t) - \sum_{r=1}^{R} f_r(\boldsymbol{n}, t) P(\boldsymbol{n}, t), \notag \end{aligned} \end{equation}

where $P(\boldsymbol{n}, t)$ is the probability of the system being in state $\boldsymbol{n}$ at time $t$,

math f_r(\boldsymbol{n}, t) = k_r\Omega \prod_{i=1}^{N} \frac{n_i!}{(n_i-s_{ir})!\Omega^{s_{ir}}}

is the propensity function of reaction $r$ at state $\boldsymbol{n}$, and $\mathbf{S}_r$ is the stoichiometric vector of reaction $r$, $\Omega$ is the system size (or volume of the system).

The chemical master equation is written directly from the rate constants and stoichiometries of all the elementary reactions of a chemical system, but neither analytical nor numerical solutions are in general available. Fortunately, the chemical master equation can often be simplified in a linear noise approximation. Linear noise approximation is an expansion of the CME taking the inverse system size $1/\Omega$ as the perturbed variable, which is originally developed by [3]. The idea is to separate concentrations into a deterministic part, given by the solution of the deterministic rate equations, and a part describing the fluctuations about the deterministic mean

math \frac{n_i}{\Omega} = \phi_i + \Omega^{-1/2} \epsilon_i,

where $\phii$ is the solution of the deterministic rate equations (2), and $\epsiloni$ represents fluctuations about the deterministic mean. Define $\boldsymbol{\Sigma}=\left(\epsilon{ij}\right){N\times N}$ to be the covariance matrix of the fluctuations, the linear noise approximation is given by:

math \begin{equation} \partial_t \boldsymbol{\Sigma} = \mathbf{A} \boldsymbol{\Sigma} + \boldsymbol{\Sigma} \mathbf{A}^T + \Omega^{-1} \mathbf{B}, \tag{3} \end{equation}

where $\mathbf{A}=\mathbf{A}(\boldsymbol{\phi}),\, \mathbf{B}=\mathbf{B}(\boldsymbol{\phi})$ both depend on the solution $\boldsymbol{\phi}$ of the rate equation \eqref{eq:rate_equations}, which are defined by

math \mathbf{A} = \left(A_{ij}\right)_{N\times N}, A_{ij}=\sum_{r=1}^{R} S_{ir}\partial_{\phi_j}g_r(\boldsymbol{\phi}),

as the Jacobian matrix of the deterministic rate equations, and

math \mathbf{B} =\left(B_{ij}\right)_{N\times N}, B_{ij} = \sum_{r=1}^{R} S_{ir}S_{jr}g_r(\boldsymbol{\phi}).

In this formulation, the LNA allows for analytical solutions that are locally valid close to macroscopic trajectories (solution of the rate equations) of the system. We refer to the review paper [2] for more details on the CME and LNA.

References

[1] Nicolaas Godfried van Kampen. The Expansion of the Master Equation. John Wiley & Sons, Inc., 2007.

[2] David Schnoerr, Guido Sanguinetti, and Ramon Grima. Approximation and inference methods for stochastic biochemical kinetics — a tutorial review (2017). Journal of Physics A: Mathematical and Theoretical, 50(9):093001.

[3] Nicolaas Godfried van Kampen. Stochastic Processes in Physics and Chemistry, volume 1. Elsevier, 1992.

Owner

  • Name: Xiaoming Fu
  • Login: xiaomingfu2013
  • Kind: user
  • Company: Helmholtz-Zentrum Dresden-Rossendorf

Currently post-doc at the Center for Advanced Systems Understanding (CASUS) and the Helmholtz-Zentrum Dresden-Rossendorf (HZDR)

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Fu"
  given-names: "Xiaoming"
  orcid: "https://orcid.org/0000-0003-4073-9822"
title: "LinearNoiseApproximation.jl"
version: 1.0.0
date-released: 2023-09-14
url: "https://github.com/xiaomingfu2013/LinearNoiseApproximation.jl"

GitHub Events

Total
  • Watch event: 1
  • Issue comment event: 1
Last Year
  • Watch event: 1
  • Issue comment event: 1

Dependencies

.github/workflows/CI.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • codecov/codecov-action v3 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/CompatHelper.yml actions
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite