38
The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References Models and Languages for Computational Systems Biology – Lecture 6 Stochastic Simulation Jane Hillston. LFCS and CSBE, University of Edinburgh 31st January 2011

Models and Languages for Computational Systems Biology ... · PDF fileModels and Languages for Computational Systems Biology ... vectordefining the result of reaction on state

Embed Size (px)

Citation preview

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Models and Languages for ComputationalSystems Biology – Lecture 6

Stochastic Simulation

Jane Hillston.LFCS and CSBE, University of Edinburgh

31st January 2011

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Outline

The deterministic and stochastic approaches

Stochastic simulation algorithms

Comparing stochastic simulation and ODEs

References

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Scenario

We consider a system in which there are N biochemical species,S1,S2, . . . ,SN.

We have variables X1,X2, . . . ,XN where Xi(t) represents thenumber of molecules of species Si at time t .

The state of the system at time t is thenX(t) = (X1(t),X2(t), . . . ,XN(t)).

These species may interact through M reactions R1,R2, . . . ,RM ;each reaction Rµ induces an update vµ (the stoichiometric vector)on the state of the system.

The system is assumed to be well-stirred and confined to aconstant volume Ω in thermal equilibrium.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Background

• The modelling of chemical reactions using deterministic ratelaws has proven extremely successful in both chemistry andbiochemistry for many years.

• This deterministic approach has at its core the reaction rateequations (RRE), a set of coupled ordinary differentialequations relating reaction rates and molecular componentconcentrations.

• Given knowledge of initial molecular concentrations, thereaction rate equations provide a complete picture of thecomponent concentrations at all future time points.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Background: Reaction Rate Equations

• The RRE are based on the assumption that the evolution ofthe system over time can be expressed as equations of theform

dXi

dt= fi(X1, . . . ,XN) (i = 1, . . .N)

• These are evidently simplifications, as it is well understoodthat chemical reactions involve discrete, random collisionsbetween individual molecules.

• As we consider smaller and smaller systems, the validity of acontinuous approach becomes ever more tenuous.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Background: Application of Stochastic Models

Arguments for the application of stochastic models for chemicalreactions come from at least three directions, since the models:

1. take into consideration the discrete character of the quantity ofcomponents and the inherently random character of thephenomena;

2. are in accordance with the theories of thermodynamics andstochastic processes; and

3. are appropriate to describe “small systems” and instabilityphenomena.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Stochastic: Random processes

• Whereas the deterministic approach outlined above isessentially an empirical law, derived from in vitro experiments,the stochastic approach is far more physically rigorous.

• Fundamental to the principle of stochastic modelling is theidea that molecular reactions are essentially randomprocesses; it is impossible to say with complete certainty thetime at which the next reaction within a volume will occur.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Stochastic: Predictability of macroscopic states

• In macroscopic systems, with a large number of interactingmolecules, the randomness of this behaviour averages out sothat the overall macroscopic state of the system becomeshighly predictable.

• It is this property of large scale random systems that enablesa deterministic approach to be adopted; however, the validityof this assumption becomes strained in in vivo conditions aswe examine small-scale cellular reaction environments withlimited reactant populations.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Stochastic: Propensity function

As explicitly derived by Gillespie, the stochastic model uses basicNewtonian physics and thermodynamics to arrive at a form oftentermed the propensity function that gives the probability aµ ofreaction µ occurring in time interval (t , t + dt).

aµdt = hµcµdt

where the M reaction mechanisms are given an arbitrary index µ(1 ≤ µ ≤ M), hµ denotes the number of possible combinations ofreactant molecules involved in reaction µ, and cµ is a stochasticrate constant.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Stochastic: Grand probability function

The stochastic formulation proceeds by considering the grandprobability function

Pr(X; t) ≡ probability that there will be present,

in the volume V at time t , Xi of species Si

Knowledge of this function provides a complete understanding ofthe probability distribution of all possible states at all times.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Stochastic: Infinitesimal time interval

By considering a discrete infinitesimal time interval (t , t + dt) inwhich either 0 or 1 reactions occur we see that there exist onlyM + 1 distinct configurations at time t that can lead to the state Xat time t + dt .

Pr(X; t + dt)

= Pr(X; t) Pr(no state change over dt)

+∑Mµ=1 Pr(X − vµ; t) Pr(state change to X over dt)

where vµ is a stoichiometric vector defining the result of reaction µon state vector X, i.e. X→ X + vµ after an occurrence of reaction µ.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Stochastic: State change probabilities

Pr(no state change over dt)

1 −M∑µ=1

aµ(X)dt

Pr(state change to X over dt)

M∑µ=1

Pr(X − vµ; t)aµ(X − vµ)dt

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Stochastic: Partial derivatives

We are considering the behaviour of the system in the limit as dttends to zero. This leads us to consider partial derivatives, whichare defined thus:

∂Pr(X; t)∂t

= limdt→0

Pr(X; t + dt) − Pr(X; t)dt

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Stochastic: Chemical Master Equation

Applying this, and re-arranging the former, leads us to an importantpartial differential equation (PDE) known as the Chemical MasterEquation (CME).

∂Pr(X; t)∂t

=M∑µ=1

aµ(X − vµ) Pr(X − vµ; t) − aµ(X) Pr(X; t)

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

The problem with the Chemical Master Equation

• The CME is really a set of nearly as many coupled ordinarydifferential equations as there are combinations of moleculesthat can exist in the system!

• The CME can be solved analytically for only a very few verysimple systems, and numerical solutions are usuallyprohibitively difficult.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Stochastic simulation algorithms

Gillespie’s Stochastic Simulation Algorithm (SSA) is an exactprocedure for numerically simulating the time evolution of awell-stirred chemically reacting system by taking proper account ofthe randomness inherent in such a system.

It is rigorously based on the same derivation as the CME and givesa more realistic representation of a system’s evolution than thedeterministic reaction rate equation (RRE) representedmathematically by ODEs.

As with the chemical master equation, the SSA converges, in thelimit of large numbers of reactants, to the same solution as theRRE.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Gillespie’s exact SSA (1977)

• The algorithm takes time steps of variable length, based onthe rate constants and population size of each chemicalspecies.

• The probability of one reaction occurring relative to another isdictated by their relative propensity functions.

• Two random numbers are used: one to determine how longthe step will last and one to choose which reaction will occur.

• The chemical populations are altered according to thestoichiometry of the reaction and the process is repeated.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Small digression on exponential distributions

If we have a number of activities (α1, a1), (α2, a2), . . . , (αn, an)enabled in the current state, then we know from the superpositionprinciple for the exponential distribution that the time untilsomething happens is governed by an exponential distribution withrate a1 + a2 + · · ·+ an.

We also know that the probability that it is the activity of type αj is

aj

a1 + a2 + · · ·+ an.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Gillespie’s Stochastic Simulation Algorithm

Thus we need only draw two random numbers for each step of thesimulation algorithm:

• the first determines the delay until the next activity completes(τ), according to an exponential distribution;

• the second determines which activity (j) that will be.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Calculating τ and j

Given a random number u, we generate the delay to the nextreaction as a same from the exponential distribution withparameter a0 where a0 =

∑ni=1 ai :

τ = −1a0

ln(u)

Given a second random number v, we choose which reactionoccurs (αj) as follows:

j = the smallest integer satisfyingj∑

k=1

ak > v a0

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Stochastic simulation: realisations and ensembles

The SSA computes one realisation of a dynamic trajectory of achemically reacting system. Often an ensemble of trajectories iscomputed, to obtain an estimate of the probability density functionof the system.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Computational cost of Gillespie’s exact algorithm

The cost of this detailed stochastic simulation algorithm is the likelylarge amounts of computing time.

The key issue is that the time step for the next reaction can be verysmall indeed if we are to guarantee that only one reaction can takeplace in a given time interval.

Increasing the molecular population or number of reactionmechanisms leads to smaller time intervals. The SSA can be verycomputationally inefficient especially when there are largenumbers of molecules or the propensity functions are large.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

From the microscopic to the macroscopic domain

Each specific run is individually in closer and closer agreementwith the deterministic approach as the number of molecules in thesystem increases.

This is a direct effect of the inherent averaging of macroscopicproperties of a system of many particles.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Comparing stochastic simulation and ODEs

Consider a Michaelis Menten reaction in which a substrate S istransformed to a product S via a complex C formed with anenzyme E.

b/u C c S

E

S

It is relatively straightforward to contrast the results of the twomethods. We compare the results of 2000 runs of the stochasticalgorithm simulating a system with initial molecular populationsS0 = 100,E0 = 10,C0 = 0,S0 = 0 and a volume of 1000 units.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Results for S0 = 100,E0 = 10,C0 = 0,S0 = 0 (vol 1000)

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Results for S0 = 100,E0 = 10,C0 = 0,S0 = 0 (vol 1000)

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Comparing results at lower population sizes

S0 = 10,E0 = 1,C0 = 0,S0 = 0 (vol 100)

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Mean results for 11, 110 and 1100 molecules

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Circadian clock

To adapt to natural periodicity, such as the alternation of day andnight, most living organisms have developed the capability ofgenerating oscillating expressions of proteins in their cells with aperiod close to 24 hours (circadian rhythm).

The Vilar-Kueh-Barkai-Leibler (VKBL in short) description of thecircadian oscillator incorporates an abstraction of a minimal set ofessential, experimentally determined mechanisms for the circadiansystem.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Circadian clock

• The VKBL model involves two genes, an activator A and arepressor R, which are transcribed into mRNA andsubsequently translated into proteins.

• The activator A binds to the A and R promoters andincreases their expression rate.

• Therefore, A implements a positive loop acting on its owntranscription.

• At the same time, R sequesters A to form a complex C,therefore inhibiting it from binding to the gene promoter andacting as a negative feedback loop.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Circadian clock (cartoon)

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Circadian clock (deterministically . . . )

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Circadian clock (. . . and stochastically)

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Circadian clock summary

• For some parameter values a differential equation modelexhibits autonomous oscillations.

• These oscillations disappear from the deterministic model asthe degradation rate of the repressor δR is decreased.

• The system of ODEs undergoes a bifurcation at this point andthe unique deterministic equilibrium of the system becomesstable.

• However, if the effects of molecular noise are incorporated theoscillations in the stochastic system pertain.

• This phenomenon is a manifestation of coherence resonance,and illustrates the crucial interplay between noise anddynamics.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Conclusions

• Stochastic simulation is a well-founded method for simulatingin vivo reactions.

• Gillespie’s SSA can be more accurate than ODEs at lowmolecular numbers; compatible with them at large molecularnumbers.

• Recent explosion of interest in the subject with many newvariants of the SSA algorithm.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

Ten things you should know about Stochastic Simulation

1. Stochastic simulation is not a replacement for ODEs.

2. Do not simulate because you cannot solve ODEs.

3. Simulation can be more accurate than ODEs.

4. The Stochastic Simulation Algorithm (SSA) is exact.

5. SSA is physically motivated by statistical thermodynamics.

6. Stochastic simulation methods can be very slow.

7. Results from one run can be significant.

8. Good approximation algorithms have been developed.

9. Challenges such as stiffness are being addressed.

10. Never argue with Daniel T. Gillespie.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

References

D.T. GillespieExact Stochastic Simulation of Coupled Chemical ReactionsJournal of Physical Chemistry, 81(25): 2340–2361, 1977.

D.T. GillespieStochastic Simulation of Chemical KineticsAnnual Review of Physical Chemistry, 58: 35–55, 2007.

J.M.G. Vilar, H.Y. Kueh, N. Barkai and S. LeiblerMechanisms of noise resistance in genetic oscillators.PNAS, 99: 5988–5992, 2002.

The deterministic and stochastic approaches Stochastic simulation algorithms Comparing stochastic simulation and ODEs References

References

T.E. Turner, S. Schnell, and K. Burrage.Stochastic approaches for modelling in vivo reactions.Computational Biology and Chemistry, 28:165–178, 2004.

D. Gillespie and L. Petzold.chapter Numerical Simulation for Biochemical Kinetics, in SystemModelling in Cellular Biology, editors Z. Szallasi, J. Stelling and V.Periwal.MIT Press, 2006.