|
|
Line 1: |
Line 1: |
| 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 [[reagent]]s 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]] {{fact|date=June 2012}}.
| | Hi there. Allow me begin by introducing the author, her title is Myrtle Cleary. She is a librarian but she's always needed her personal company. He is truly fond of performing ceramics but he is struggling to find time for it. North Dakota is her beginning location but she will have to move 1 day or another.<br><br>Here is my blog post; home std test kit ([http://www.youporn-nederlandse.com/blog/117384 advice here]) |
| | |
| == 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 process]]es.
| |
| 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 [[Maurice 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.
| |
| | |
| ==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.
| |
| | |
| ==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 Thompson Plimpton 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. (2009, 2010), and later independently rediscovered by Indurkhya and Beal (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 Sbalzarini 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.
| |
| | |
| ===Simple example: Reversible binding of A and B to form AB dimers===
| |
| | |
| A simple example may help to explain how the Gillespie algorithm works. Consider a system of
| |
| molecules of two types: ''A'' and ''B''. In the system ''A'' and ''B'' reversibly
| |
| bind together to form ''AB'' dimers. So there are two reactions.
| |
| The first is where one molecule of ''A'' reacts reversibly
| |
| with one B molecule to form an ''AB'' dimer, and the second is where an
| |
| ''AB'' dimer dissociates into an ''A'' and a ''B'' molecule. The reaction rate constant for a given single
| |
| A molecule reacting with a given single ''B'' molecule is <math>k_D</math>, and the reaction
| |
| rate for an ''AB'' dimer breaking up is <math>k_B</math>. Both rate constants have dimensions
| |
| of one over time.
| |
| | |
| So, for example if at time ''t'' there is one molecule of each type then the rate of dimer formation is
| |
| <math>k_D</math>, while if there are <math>n_A</math> molecules of type ''A'' and <math>n_B</math>
| |
| molecules of type ''B'', the rate of dimer formation is <math> k_Dn_An_B</math>.
| |
| If there are <math>n_{AB}</math> dimers then the rate of dimer dissociation is
| |
| <math>k_Bn_{AB}</math>.
| |
| | |
| The total reaction rate, <math>R_{TOT}</math>, at time ''t'' is then given by
| |
| | |
| <math>R_{TOT}=k_Dn_An_B+k_Bn_{AB}</math>
| |
| | |
| So, we have now described a simple model with two reactions. This definition is independent of
| |
| the Gillespie algorithm. We will now describe how to apply the Gillespie algorithm to this system.
| |
| | |
| In the algorithm, we advance forward in time in two steps: calculating the time
| |
| to the next reaction, and determining which of the possible reactions, the next reaction is.
| |
| Reactions are assumed to be completely random, so if the reaction rate at
| |
| a time ''t'' is <math>R_{TOT}</math>, then the time, δ''t'', until the next reaction occurs is a random number
| |
| drawn from exponential distribution function with mean <math>1/R_{TOT}</math>. Thus,
| |
| we advance time from ''t'' to ''t'' + δ''t''.
| |
| | |
| [[File:Example calculation illustrating the Gillespie algorithm for reversible dimerising molecules.png|thumb|Plot of the number
| |
| ''A'' molecules (black curve) and ''AB'' dimers as a function of time. As we started with 10 ''A'' and ''B'' molecules
| |
| at time ''t''=0, the number of ''B'' molecules is always equal to the number of ''A'' molecules and so it is not
| |
| shown.]]
| |
| | |
| The probability that this reaction is an ''A'' molecule binding to a ''B'' molecule
| |
| is simply the fraction of total rate due to this type of reaction, i.e.,
| |
| | |
| the probability that reaction is ''A'' + ''B'' → ''AB'' <math> = k_Dn_An_B/R_{TOT}</math>
| |
| | |
| The probability that the next reaction is an ''AB'' dimer dissociating is just 1 minus that.
| |
| So with these two probabilities we either form a dimer by reducing
| |
| <math>n_A</math> and <math>n_B</math> by one, and increase <math>n_{AB}</math> by one, or
| |
| we dissociate a dimer and increase <math>n_A</math> and <math>n_B</math> by one and decrease <math>n_{AB}</math> by one.
| |
| | |
| Now we have both advanced time to ''t'' + δ''t'', and performed a single reaction.
| |
| The Gillespie algorithm just repeats these two steps as many times as needed
| |
| to simulate the system for however long we want (i.e., for as many reactions). The result
| |
| of a Gillespie simulation that starts with <math>n_A=n_B=10</math> and <math>n_{AB}=0</math> at ''t''=0,
| |
| and where <math>k_D=2</math> and <math>k_U=1</math>, is shown at the right. For these parameter values,
| |
| on average there 8 <math>n_{AB}</math> dimers and 2 of ''A'' and ''B'' but due to the small numbers of molecules
| |
| fluctuations around these values are large. The Gillespie algorithm is often used to study systems where
| |
| these fluctuations are important.
| |
| | |
| That was just a simple example, with two reactions. More complex systems with more reactions are handled in the same way.
| |
| All reaction rates must be calculated at each time step, and one chosen with probability equal to its fractional contribution to the rate.
| |
| Time is then advanced as in this example.
| |
| | |
| ==Further reading==
| |
| <!-- *[http://www.caam.rice.edu/~caam210/reac/lec.html Summary of Gillespie Algorithm with [[MATLAB]] examples] -->
| |
| * {{cite journal |author=Gillespie, Daniel T. |title=Exact Stochastic Simulation of Coupled Chemical Reactions |journal=The Journal of Physical Chemistry |volume=81 |issue=25 |pages=2340–2361 |year=1977 |doi=10.1021/j100540a008 }}
| |
| * {{cite journal |author=Gillespie, Daniel T. |title=A General Method for Numerically Simulating the Stochastic Time Evolution of Coupled Chemical Reactions |journal=Journal of Computational Physics |volume=22 |issue=4 |pages=403–434 |year=1976 |doi=10.1016/0021-9991(76)90041-3 }}
| |
| * {{cite journal |author=Doob, Jacob L. |title=Topics in the Theory of Markoff Chains |journal=Transactions of the American Mathematical Society |volume=52 |pages=37–64 |year=1942 |issue=1 |jstor=1990152 |doi=10.1090/S0002-9947-1942-0006633-7 }}
| |
| * {{cite journal |author=Doob, Jacob L. |title=Markoff chains – Denumerable case |journal=Transactions of the American Mathematical Society |volume=58 |pages=455–473 |year=1945 |doi=10.2307/1990339 |issue=3 |jstor=1990339 }}
| |
| * {{Cite book |last1=Press |first1=William H. |last2=Teukolsky |first2=Saul A. |last3=Vetterling |first3=William T. |last4=Flannery |first4=Brian P. |year=2007 |title=Numerical Recipes: The Art of Scientific Computing |edition=3rd |publisher=Cambridge University Press |publication-place=New York, NY |isbn=978-0-521-88068-8 |chapter=Section 17.7. Stochastic Simulation of Chemical Reaction Networks |chapter-url=http://apps.nrbook.com/empanel/index.html#pg=946 }}
| |
| * {{cite journal |author=Kolmogorov, Andrey N. |title=Über die analytischen Methoden in der Wahrscheinlichkeitsrechnung |trans_title=On Analytical Methods in the Theory of Probability |journal=Mathematische Annalen |volume=104 |pages=415 |year=1931 |url=http://www.springerlink.com/content/v724507673277262/fulltext.pdf |doi=10.1007/BF01457949 }}
| |
| * {{cite journal |author=Feller, Willy |title=On the Integro-Differential Equations of Purely Discontinous Markoff Processes |journal=Transactions of the American Mathematical Society |volume= 48 |pages=4885–15 |year=1940 |jstor=1970064 |issue=3 }}
| |
| * {{cite journal |author=Kendall, David G. |title=An Artificial Realization of a Simple "Birth-and-Death" Process |journal=Journal of the Royal Statistical Society, Series B |volume=12 |pages=116–119 |year=1950 |issue=1 |jstor=2983837 }}
| |
| * {{cite journal |author=Bartlett, Maurice S. |title=Stochastic Processes or the Statistics of Change |journal=Journal of the Royal Statistical Society, Series C |volume=2 |pages=44–64 |year=1953 |issue=1 |jstor=2985327 }}
| |
| * {{cite journal |author=Rathinam, Muruhan; Petzold, Linda R.; Cao, Yang; and Gillespie, Daniel T. |title=Stiffness in stochastic chemically reacting systems: The implicit tau-leaping method |journal=Journal of Chemical Physics |volume=119 |issue=24 |pages=12784–12794 |year=2003 |doi=10.1063/1.1627296 }}
| |
| * {{cite journal |last1=Sinitsyn |first1=Nikolai A. |last2=Hengartner |first2=Nicolas |last3=Nemenman |first3=Ilya |title=Adiabatic coarse-graining and simulations of stochastic biochemical networks |journal=Proceedings of the National Academy of Sciences of the United States of America |volume=106 |issue=20 |pages=10546–10551 |year=2009 |url=http://www.menem.com/~ilya/wiki/images/1/18/Sinitsyn-etal-09.pdf |doi=10.1073/pnas.0809340106 |pmid=19525397 |pmc=2705573 }}
| |
| * {{cite journal |author=Gibson, Michael A.; and Bruck, Jehoshua |url=http://www.cs.caltech.edu/courses/cs191/paperscs191/JPhysChemA(2000-104)1876.pdf |title=Efficient Exact Stochastic Simulation of Chemical Systems with Many Species and Many Channels |journal= Journal of Physical Chemistry A |volume=104 |pages=1876–1889 |year=2000 |doi=10.1021/jp993732q |issue=9 }}
| |
| * {{cite journal |last1=Salis |first1=Howard |last2=Kaznessis |first2=Yiannis N. |title=Accurate hybrid stochastic simulation of a system of coupled chemical or biochemical reactions |journal=Journal of Chemical Physics |volume=122 |pages=054103 |year=2005 |doi=10.1063/1.1835951 |pmid=15740306 |issue=5 }}
| |
| * (Slepoy Thompson Plimpton 2008): {{cite journal |last1=Slepoy |first1=Alexander |last2=Thompson |first2=Aidan P. |last3=Plimpton |first3=Steven J. |title=A constant-time kinetic Monte Carlo algorithm for simulation of large biochemical reaction networks |journal=Journal of Chemical Physics |volume=128 |issue=20 |pages=205101 |year=2008 |doi=10.1063/1.2919546 |pmid=18513044 }}
| |
| * (Bratsun et al. 2005): {{cite journal |author=Bratsun, Dmitri; Volfson, Dmitri; Hasty, Jeff; and Tsimring, Lev S. |title=Delay-induced stochastic oscillations in gene regulation |journal=Proceedings of the National Academy of Sciences of the United States of America |volume=102 |issue=41 |pages=14593–8 |year=2005 |doi=10.1073/pnas.0503858102 |pmid=16199522 |pmc=1253555 }}
| |
| * (Barrio et al. 2006): {{cite journal |author=Barrio, Manuel; Burrage, Kevin; Leier, André; and Tian, Tianhai |title=Oscillatory Regulation of ''hes1'': Discrete Stochastic Delay Modelling and Simulation |journal=Public Library of Science (PLoS) Computational Biology |volume=2 |pages=1017 |year=2006 |doi=10.1371/journal.pcbi.0020117 |pmid=16965175 |issue=9 |pmc=1560403 }}
| |
| * (Cai 2007): {{cite journal |author=Cai, Xiaodong |title=Exact stochastic simulation of coupled chemical reactions with delays |journal=Journal of Chemical Physics |volume=126 |pages=124108 |year=2007 |doi=10.1063/1.2710253 |issue=12 |pmid=17411109 }}
| |
| * (Barnes Chu 2010): {{cite book |author=Barnes, David J.; and Chu, Dominique |title=Introduction to Modeling for Biosciences |publisher=Springer Verlag |year=2010 }}
| |
| * (Ramaswamy González-Segredo Sbalzarini 2009): {{cite journal |author=Ramaswamy, Rajesh; González-Segredo, Nélido; and Sbalzarini, Ivo F. |title=A new class of highly efficient exact stochastic simulation algorithms for chemical reaction networks |journal=Journal of Chemical Physics |volume=130 |pages=244104 |year=2009 |doi=10.1063/1.3154624 |issue=24 |pmid=19566139 }}
| |
| * (Ramaswamy Sbalzarini 2010): {{cite journal |author=Ramaswamy, Rajesh; and Sbalzarini, Ivo F. |title=A partial-propensity variant of the composition-rejection stochastic simulation algorithm for chemical reaction networks |journal=Journal of Chemical Physics |volume=132 |pages=044102 |year=2010 |doi=10.1063/1.3297948 |issue=4 |pmid=20113014 }}
| |
| * (Indurkhya Beal 2010): {{cite journal |author=Indurkhya, Sagar; and Beal, Jacob S. |title=Reaction Factoring and Bipartite Update Graphs Accelerate the Gillespie Algorithm for Large-Scale Biochemical Systems |journal=Public Library of Science (PLoS) ONE |volume=5 |issue=1 |pages=e8125 |year=2005 |doi=10.1371/journal.pone.0008125 |editor1-last=Isalan |editor1-first=Mark |pmid=20066048 |pmc=2798956 }}
| |
| * (Ramaswamy Sbalzarini 2011): {{cite journal |author=Ramaswamy, Rajesh; and Sbalzarini, Ivo F. |title=A partial-propensity formulation of the stochastic simulation algorithm for chemical reaction networks with delays |journal=Journal of Chemical Physics |volume=134 |pages=014106 |year=2011 |doi=10.1063/1.3521496 |pmid=21218996 |issue=1 }}
| |
| | |
| == External links ==
| |
| ;Software
| |
| * [http://cain.sourceforge.net/ Cain] - Stochastic simulation of chemical kinetics. Direct, next reaction, tau-leaping, hybrid, etc.
| |
| * [http://stochpy.sourceforge.net/ StochPy] - Stochastic modelling in Python
| |
| * [http://synbioss.sourceforge.net/ 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.
| |
| * [http://cran.r-project.org/web/packages/GillespieSSA/index.html GillespieSSA] - R package for Gillespie algorithm
| |
| * [http://demonstrations.wolfram.com/DeterministicVersusStochasticChemicalKinetics/] - Mathematica code and applet for stochastic simulation of chemical kinetics.
| |
| * [http://mosaic.mpi-cbg.de/?q=downloads/stochastic_chemical_net pSSAlib] - C++ implementations of all partial-propensity methods.
| |
| | |
| [[Category:Chemical kinetics]]
| |
| [[Category:Computational chemistry]]
| |
| [[Category:Monte Carlo methods]]
| |
| [[Category:Stochastic simulation]]
| |