Skip to content

Finite State Projection algorithms for chemical reaction networks

License

Notifications You must be signed in to change notification settings

SciML/FiniteStateProjection.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FiniteStateProjection.jl

Dev

Finite State Projection [1] algorithms for chemical reaction networks based on Catalyst.jl and ModelingToolkit.jl. Converts descriptions of reaction networks into ODEProblems and SteadyStateProblems for use with DifferentialEquations.jl.

Features:

  • Built on top of Catalyst.jl
  • FSP equations are generated as ODEFunction/ODEProblems and can be solved with DifferentialEquations.jl, with on-the-fly generation of targeted functions for improved performance
  • The Chemical Master Equation can be represented as a SparseMatrixCSC

More information is available in the documentation. Please feel free to open issues and submit pull requests!

Examples

Birth-Death System

using FiniteStateProjection
using OrdinaryDiffEq

rn = @reaction_network begin
    σ, 0 --> A
    d, A --> 0
end

sys = FSPSystem(rn)

# Parameters for our system
ps = [ 10.0, 1.0 ]

# Initial distribution (over 1 species)
# Here we start with 0 copies of A
u0 = zeros(50)
u0[1] = 1.0

prob = convert(ODEProblem, sys, u0, (0, 10.0), ps)
sol = solve(prob, Vern7())

Visualisation

Telegraph Model

using FiniteStateProjection
using OrdinaryDiffEq

rn = @reaction_network begin
    σ_on * (1 - G_on), 0 --> G_on
    σ_off, G_on --> 0
    ρ, G_on --> G_on + M
    d, M --> 0
end

sys = FSPSystem(rn)

# Parameters for our system
ps = [ 0.25, 0.15, 15.0, 1.0 ]

# Initial distribution (over two species)
# Here we start with 0 copies of G_on and M
u0 = zeros(2, 50)
u0[1,1] = 1.0

prob = convert(ODEProblem, sys, u0, (0, 10.0), ps)
sol = solve(prob, Vern7())

Visualisation

TODO:

  • Add bursty reactions
  • Add support for sparse Jacobians

References

[1] B. Munsky and M. Khammash, "The Finite State Projection algorithm for the solution of the Chemical Master Equation", Journal of Chemical Physics 124, 044104 (2006). https://doi.org/10.1063/1.2145882