Skip to content

Latest commit

 

History

History
192 lines (168 loc) · 10.6 KB

README.md

File metadata and controls

192 lines (168 loc) · 10.6 KB

Catalyst.jl

Join the chat at https://julialang.zulipchat.com #sciml-bridged Stable API Stable Dev API Dev

Build Status codecov.io Coverage Status

ColPrac: Contributor's Guide on Collaborative Practices for Community Packages SciML Code Style

Catalyst.jl is a symbolic modeling package for analysis and high performance simulation of chemical reaction networks. Catalyst defines symbolic ReactionSystems, which can be created programmatically or easily specified using Catalyst's domain specific language (DSL). Leveraging ModelingToolkit and Symbolics.jl, Catalyst enables large-scale simulations through auto-vectorization and parallelism. Symbolic ReactionSystems can be used to generate ModelingToolkit-based models, allowing the easy simulation and parameter estimation of mass action ODE models, Chemical Langevin SDE models, stochastic chemical kinetics jump process models, and more. Generated models can be used with solvers throughout the broader SciML ecosystem, including higher level SciML packages (e.g. for sensitivity analysis, parameter estimation, machine learning applications, etc).

Breaking changes and new features

NOTE: version 13 is a breaking release, with changes to simplify the DSL notation while also adding more features, changes to how chemical species are specified symbolically when directly building ReactionSystems, and changes that simplify how to include ODE or algebraic constraint equation.

Breaking changes and new functionality are summarized in the HISTORY.md file.

Tutorials and documentation

The latest tutorials and information on using the package are available in the stable documentation. The in-development documentation describes unreleased features in the current master branch.

Several Youtube video tutorials and overviews are also available, but note these use older Catalyst versions with slightly different notation (for example, in building reaction networks):

Features

  • A DSL provides a simple and readable format for manually specifying chemical reactions.
  • Catalyst ReactionSystems provide a symbolic representation of reaction networks, built on ModelingToolkit.jl and Symbolics.jl.
  • Non-integer (e.g. Float64) stoichiometric coefficients are supported for generating ODE models, and symbolic expressions for stoichiometric coefficients are supported for all system types.
  • The Catalyst.jl API provides functionality for extending networks, building networks programmatically, network analysis, and for composing multiple networks together.
  • ReactionSystems generated by the DSL can be converted to a variety of ModelingToolkit.AbstractSystems, including symbolic ODE, SDE and jump process representations.
  • Coupled differential and algebraic constraint equations can be included in Catalyst models, and are incorporated during conversion to ODEs or steady state equations.
  • Conservation laws can be detected and applied to reduce system sizes, and generate non-singular Jacobians, during conversion to ODEs, SDEs, and steady state equations.
  • By leveraging ModelingToolkit, users have a variety of options for generating optimized system representations to use in solvers. These include construction of dense or sparse Jacobians, multithreading or parallelization of generated derivative functions, automatic classification of reactions into optimized jump types for Gillespie type simulations, automatic construction of dependency graphs for jump systems, and more.
  • Generated systems can be solved using any DifferentialEquations.jl ODE/SDE/jump solver, and can be used within EnsembleProblems for carrying out parallelized parameter sweeps and statistical sampling. Plot recipes are available for visualizing the solutions.
  • Symbolics.jl symbolic expressions and Julia Exprs can be obtained for all rate laws and functions determining the deterministic and stochastic terms within resulting ODE, SDE or jump models.
  • Latexify can be used to generate LaTeX expressions corresponding to generated mathematical models or the underlying set of reactions.
  • Graphviz can be used to generate and visualize reaction network graphs. (Reusing the Graphviz interface created in Catlab.jl.)

Packages supporting Catalyst

  • Catalyst ReactionSystems can be imported from SBML files via SBMLToolkit.jl, and from BioNetGen .net files and various stoichiometric matrix network representations using ReactionNetworkImporters.jl.
  • MomentClosure.jl allows generation of symbolic ModelingToolkit ODESystems, representing moment closure approximations to moments of the Chemical Master Equation, from reaction networks defined in Catalyst.
  • FiniteStateProjection.jl allows the construction and numerical solution of Chemical Master Equation models from reaction networks defined in Catalyst.
  • DelaySSAToolkit.jl can augment Catalyst reaction network models with delays, and can simulate the resulting stochastic chemical kinetics with delays models.
  • BondGraphs.jl a package for constructing and analyzing bond graphs models, which can take Catalyst models as input.
  • PEtab.jl a package that implements the PEtab format for fitting reaction network ODEs to data. Input can be provided either as SBML files or as Catalyst ReactionSystems.

Illustrative examples

Gillespie simulations of Michaelis-Menten enzyme kinetics

using Catalyst, Plots, JumpProcesses
rs = @reaction_network begin
  c1, S + E --> SE
  c2, SE --> S + E
  c3, SE --> P + E
end
p  = (:c1 => 0.00166, :c2 => 0.0001, :c3 => 0.1)
tspan = (0., 100.)
u0 = [:S => 301, :E => 100, :SE => 0, :P => 0]

# solve JumpProblem
dprob = DiscreteProblem(rs, u0, tspan, p)
jprob = JumpProblem(rs, dprob, Direct())
jsol = solve(jprob, SSAStepper())
plot(jsol; lw = 2, title = "Gillespie: Michaelis-Menten Enzyme Kinetics")

Adaptive time stepping SDEs for a birth-death process

using Catalyst, Plots, StochasticDiffEq
rs = @reaction_network begin
  c1, X --> 2X
  c2, X --> 0
  c3, 0 --> X
end
p     = (:c1 => 1.0, :c2 => 2.0, :c3 => 50.)
tspan = (0.,10.)
u0    = [:X => 5.]
sprob = SDEProblem(rs, u0, tspan, p)
ssol  = solve(sprob, LambaEM(), reltol=1e-3)
plot(ssol; lw = 2, title = "Adaptive SDE: Birth-Death Process")

Getting help

Catalyst developers are active on the Julia Discourse, the Julia Slack channels #sciml-bridged and #sciml-sysbio, and the Julia Zulip sciml-bridged channel. For bugs or feature requests open an issue.

Supporting and citing Catalyst.jl

The software in this ecosystem was developed as part of academic research. If you would like to help support it, please star the repository as such metrics may help us secure funding in the future. If you use Catalyst as part of your research, teaching, or other activities, we would be grateful if you could cite our work:

@article{CatalystPLOSCompBio2023,
    doi = {10.1371/journal.pcbi.1011530},
    author = {Loman, Torkel E. AND Ma, Yingbo AND Ilin, Vasily AND Gowda, Shashi AND Korsbo, Niklas AND Yewale, Nikhil AND Rackauckas, Chris AND Isaacson, Samuel A.},
    journal = {PLOS Computational Biology},
    publisher = {Public Library of Science},
    title = {Catalyst: Fast and flexible modeling of reaction networks},
    year = {2023},
    month = {10},
    volume = {19},
    url = {https://doi.org/10.1371/journal.pcbi.1011530},
    pages = {1-19},
    number = {10},
}