Gillespie algorithm
In probability theory, the Gillespie algorithm (or occasionally the Doob-Gillespie algorithm) generates a statistically correct trajectory (possible solution) of a stochastic equation. It was created by Joseph L. Doob and others (circa 1945) and popularized by Dan Gillespie in 1977 in a paper where he uses it to simulate chemical or biochemical systems of reactions efficiently and accurately using limited computational power (see Stochastic simulation). As computers have become faster, the algorithm has been used to simulate increasingly complex systems. The algorithm is particularly useful for simulating reactions within cells where the number of reagents typically number in the tens of molecules (or less). Mathematically, it is a variety of a dynamic Monte Carlo method and similar to the kinetic Monte Carlo methods. It is used heavily in computational systems biology.
Contents |
[edit] History
The process that lead to the algorithm recognizes several important steps. In 1931, Andrei Kolmogorov introduced the differential equations corresponding to the time-evolution of stochastic processes that proceed by jumps, today known as Kolmogorov equations (Markov jump process) (a simplified version is known as master equation in the natural sciences). It was William Feller, in 1940, who found the conditions under which the Kolmogorov equations admitted (proper) probabilities as solutions. In his Theorem I (1940 work) he establishes that the time-to-the-next-jump was exponentially distributed and the probability of the next event is proportional to the rate. As such, he established the relation of Kolmogorov's equations with stochastic processes. Later, Doob (1942, 1945) extended Feller's solutions beyond the case of pure-jump processes. The method was implemented in computers by David George Kendall (1950) using the Manchester Mark 1 computer and later used by M. S. Bartlett (1953) in his studies of epidemics outbreaks. Gillespie (1977) worked ignoring this history as he writes "It should be emphasized, though, that the master equation itself plays no role whatsoever in either the derivation or the implementation of the stochastic simulation algorithm". Gillespie then proceeds through a heuristic argument to introduce the algorithm.
[edit] Idea behind the algorithm
Traditional continuous and deterministic biochemical rate equations do not accurately predict cellular reactions since they rely on bulk reactions that require the interactions of millions of molecules. They are typically modeled as a set of coupled ordinary differential equations. In contrast, the Gillespie algorithm allows a discrete and stochastic simulation of a system with few reactants because every reaction is explicitly simulated. When simulated, a Gillespie realization represents a random walk that exactly represents the distribution of the master equation.
The physical basis of the algorithm is the collision of molecules within a reaction vessel. It is assumed that collisions are frequent, but collisions with the proper orientation and energy are infrequent. Therefore, all reactions within the Gillespie framework must involve at most two molecules. Reactions involving three molecules are assumed to be extremely rare and are modeled as a sequence of binary reactions. It is also assumed that the reaction environment is well mixed.
[edit] Algorithm
Gillespie developed two different, but equivalent formulations; the direct method and the first reaction method. Below is a summary of the steps to run the algorithm (math omitted):
- Initialization: Initialize the number of molecules in the system, reactions constants, and random number generators.
- Monte Carlo step: Generate random numbers to determine the next reaction to occur as well as the time interval. The probability of a given reaction to be chosen is proportional to the number of substrate molecules.
- Update: Increase the time step by the randomly generated time in Step 2. Update the molecule count based on the reaction that occurred.
- Iterate: Go back to Step 2 unless the number of reactants is zero or the simulation time has been exceeded.
The algorithm is computationally expensive and thus many modifications and adaptations exist, including the next reaction method (Gibson & Bruck), tau-leaping, as well as hybrid techniques where abundant reactants are modeled with deterministic behavior. Adapted techniques generally compromise the exactitude of the theory behind the algorithm as it connects to the Master equation, but offer reasonable realizations for greatly improved timescales. The computational cost of exact versions of the algorithm is determined by the coupling class of the reaction network. In weakly coupled networks, the number of reactions that is influenced by any other reaction is bounded by a small constant. In strongly coupled networks, a single reaction firing can in principle affect all other reactions. An exact version of the algorithm with constant-time scaling for weakly coupled networks has been developed, enabling efficient simulation of systems with very large numbers of reaction channels (Slepoy 2008). The generalized Gillespie algorithm that accounts for the non-Markovian properties of random biochemical events with delay has been developed by Bratsun et al. 2005 and independently Barrio et al. 2006, as well as (Cai 2007). See the articles cited below for details.
Partial-propensity formulations as developed by Ramaswamy et al. (Ramaswamy 2009, 2010), and later independently rediscovered by Indurkhya (Indurkhya, 2010), are available to construct a family of exact versions of the algorithm whose computational cost is proportional to the number of chemical species in the network, rather than the (larger) number of reactions. These formulations can reduce the computational cost to constant-time scaling for weakly coupled networks and to scale at most linearly with the number of species for strongly coupled networks. A partial-propensity variant of the generalized Gillespie algorithm for reactions with delays has also been proposed (Ramaswamy 2011). The use of partial-propensity methods is limited to elementary chemical reactions, i.e., reactions with at most two different reactants. Every non-elementary chemical reaction can be equivalently decomposed into a set of elementary ones, at the expense of a linear (in the order of the reaction) increase in network size.
[edit] Further reading
- Daniel T. Gillespie (1977). "Exact Stochastic Simulation of Coupled Chemical Reactions". The Journal of Physical Chemistry 81 (25): 2340–2361. doi:10.1021/j100540a008.
- Daniel T. Gillespie (1976). "A General Method for Numerically Simulating the Stochastic Time Evolution of Coupled Chemical Reactions". Journal of Computational Physics 22 (4): 403–434. doi:10.1016/0021-9991(76)90041-3.
- Jacob L. Doob (1942). "Topics in the Theory of Markoff Chains". Transactions of the American Mathematical Society 52 (1): 37–64. doi:10.1090/S0002-9947-1942-0006633-7. JSTOR 1990152.
- Jacob L. Doob (1945). "Markoff chains – Denumerable case". Transactions of the American Mathematical Society 58 (3): 455–473. doi:10.2307/1990339. JSTOR 1990339.
- Press, WH; Teukolsky, SA; Vetterling, WT; Flannery, BP (2007). "Section 17.7. Stochastic Simulation of Chemical Reaction Networks". Numerical Recipes: The Art of Scientific Computing (3rd ed.). New York: Cambridge University Press. ISBN 978-0-521-88068-8. http://apps.nrbook.com/empanel/index.html#pg=946.
- A Kolmogorov (1931). "Über die analytischen Methoden in der Wahrscheinlichkeitsrechnung". Mathematische Annalen 104: 415. doi:10.1007/BF01457949. http://www.springerlink.com/content/v724507673277262/fulltext.pdf.
- W Feller (1940). "On the Integro-Differential Equations of Purely Discontinous Markoff Processes". Transactions of the American Mathematical Society 48 (3): 4885–15. JSTOR 1970064.
- David G. Kendall (1950). "An Artificial Realization of a Simple "Birth-and-Death" Process". Journal of the Royal Statistical Society. Series B (Methodological), 12 (1): 116–119. JSTOR 2983837.
- Maurice S. Bartlett (1953). "Stochastic Processes or the Statistics of Change". : Journal of the Royal Statistical Society. Series C (Applied Statistics), 2 (1): 44–64. JSTOR 2985327.
- M. Rathinam, L. R. Petzold, Y. Cao, and Daniel T. Gillespie, (2003). "Stiffness in stochastic chemically reacting systems: The implicit tau-leaping method". Journal of Chemical Physics 119 (24): 12784–12794. doi:10.1063/1.1627296.
- Sinitsyn, NA; Hengartner, N; Nemenman, I (2009). "Adiabatic coarse-graining and simulations of stochastic biochemical networks". Proceed. Nat. Acad. Science U. S. A. 106 (20): 10546–10551. doi:10.1073/pnas.0809340106. PMC 2705573. PMID 19525397. http://www.menem.com/~ilya/wiki/images/1/18/Sinitsyn-etal-09.pdf.
- M. A. Gibson and J. Bruck, (2000). "Efficient Exact Stochastic Simulation of Chemical Systems with Many Species and Many Channels". J. Phys. Chem. A 104 (9): 1876–1889. doi:10.1021/jp993732q. http://www.cs.caltech.edu/courses/cs191/paperscs191/JPhysChemA(2000-104)1876.pdf.
- Salis, H; Kaznessis, Y (2005). "Accurate hybrid stochastic simulation of a system of coupled chemical or biochemical reactions". Journal of Chemical Physics 122 (5): 054103. doi:10.1063/1.1835951. PMID 15740306.
- (Slepoy 2008): Slepoy, A; Thompson, AP; Plimpton, SJ (2008). "A constant-time kinetic Monte Carlo algorithm for simulation of large biochemical reaction networks". Journal of Chemical Physics 128 (20): 205101. doi:10.1063/1.2919546. PMID 18513044.
- (Bratsun 2005): D. Bratsun, D. Volfson, J. Hasty, L. Tsimring, (2005). "Delay-induced stochastic oscillations in gene regulation". PNAS 102 (41): 14593–8. doi:10.1073/pnas.0503858102. PMC 1253555. PMID 16199522. http://www.pubmedcentral.nih.gov/articlerender.fcgi?tool=pmcentrez&artid=1253555.
- (Barrio 2005): M. Barrio, K. Burrage, A. Leier and T. Tian, (2006). "Oscillatory Regulation of Hes1: Discrete Stochastic Delay Modelling and Simulation". PLoS Comput Biol 2 (9): 1017. doi:10.1371/journal.pcbi.0020117. PMC 1560403. PMID 16965175. http://www.pubmedcentral.nih.gov/articlerender.fcgi?tool=pmcentrez&artid=1560403.
- (Cai 2007): X. Cai, (2007). "Exact stochastic simulation of coupled chemical reactions with delays". J. Chem. Phys. 126 (12): 124108. doi:10.1063/1.2710253. PMID 17411109.
- (Barnes 2010): D. Barnes, D. Chu, (2010). Introduction to Modelling for Biosciences. Springer Verlag.
- (Ramaswamy 2009): R. Ramaswamy, N. Gonzalez-Segredo, I. F. Sbalzarini, (2009). "A new class of highly efficient exact stochastic simulation algorithms for chemical reaction networks". J. Chem. Phys. 130 (24): 244104. doi:10.1063/1.3154624. PMID 19566139.
- (Ramaswamy 2010): R. Ramaswamy, I. F. Sbalzarini, (2010). "A partial-propensity variant of the composition-rejection stochastic simulation algorithm for chemical reaction networks". J. Chem. Phys. 132 (4): 044102. doi:10.1063/1.3297948. PMID 20113014.
- (Indurkhya 2010): S. Indurkhya, J. Beal, (2005). Isalan, Mark. ed. "Reaction Factoring and Bipartite Update Graphs Accelerate the Gillespie Algorithm for Large-Scale Biochemical Systems". PLoS ONE 5 (1): e8125. doi:10.1371/journal.pone.0008125. PMC 2798956. PMID 20066048. http://www.pubmedcentral.nih.gov/articlerender.fcgi?tool=pmcentrez&artid=2798956.
- (Ramaswamy 2011): R. Ramaswamy, I. F. Sbalzarini, (2011). "A partial-propensity formulation of the stochastic simulation algorithm for chemical reaction networks with delays". J. Chem. Phys. 134 (1): 014106. doi:10.1063/1.3521496. PMID 21218996.
[edit] External links
- Software
- Cain - Stochastic simulation of chemical kinetics. Direct, next reaction, tau-leaping, hybrid, etc.
- StochPy - Stochastic modelling in Python
- SynBioSS - Stochastic simulation of chemical kinetics using the exact SSA as well as an SSA/Langevin hybrid. Both MPI-parallel (supercomputer) and GUI (desktop) versions are provided.
- GillespieSSA - R package for Gillespie algorithm
- [1] - Mathematica code and applet for stochastic simulation of chemical kinetics.
- PDM - C++ implementations of all partial-propensity methods.