Team:Grenoble/Projet/Modelling/Stochastic

From 2011.igem.org

Revision as of 21:59, 20 September 2011 by JeanBaptiste (Talk | contribs)

Grenoble 2011, Mercuro-Coli iGEM


Modelling - Stochastic

Gillespie algorithm

During a chemical reaction, the molecules move at random in the medium obeying brownian motion, and reactions happen randomly in the medium. On a macroscopic scale, the reactions can be seen as deterministic, and the statistical properties are summarized by constants in classical ODEs. However, at a cell's scale, the influence of the randomness of the reactions is no longer negligible, especially for biosensors. For an efficient measurement biosensor systems must provide the expected precision of the measure.

IMAGEEUH

Each reaction has a certain probability to occur in an interval of time, and this probability depends, for example, on the concentration of reactant species in the medium and on the affinity constants of the reactions.

In his algorithm Gillespie uses propensity theory to describe the behaviour of such a medium. Each reaction occuring in the cell, like construction or destruction of a protein, has a certain propensity. These propensities depend on the reactants concentrations and on other molecules in the cell (e.g. : The production of a protein from a gene placed after a pLac promoter depends on the concentrations of lacI and/or IPTG molecules in the cell).

  1. Propensity functions and the Gillespie Algorithm
  2. Our stochastic model only describes the stochastic behaviour of the Toggle switch genetical network. The toggle switch is the core of our system, it is the most sensitive part of the network and sets the precision, the behaviour and the limits of our system.

    The propensity functions used in our models are derived from the ODEs we have already written for deterministic modelling :

    Chemical reaction Propensity
    Φ TetR k plac P lac total 1 + lacI 1 + IPTG K lacI - IPTG n plac
    TetR Φ δ TetR TetR
    Φ lacI k pTet P Tet total 1 + TetR 1 + aTc K TetR - aTc n pTet
    lacI Φ δ lacI lacI

    The parameters are the same as those used in ODEs and can be found on the parameters page. In our Matlab code the propensities are computed at each time step in the file Stochastic_model.m.

    Then a pseudo-random number is generated in the interval [0;1] with Matlab function rand(). This number will set which one of the reactions will occur during this iteration, or time step. The interval of time that separates each iteration is set by the sum of all propensities. If all reactions have very high propensities, many iterations will happen in a certain amount of time – And many iterations means many reactions as well. By contrary, if all propensities are low, few reactions will occur during the same amount of time. The time interval is then inversely proportionnal to the sum of all propensities.

    This is the core of the algorithm. It can be found in the file Gillespie.m The species concentrations are finally changed according to the reaction fixed by the random number and the loop keeps running until the ending time of the simulation is reached (ending time fixed by the user).

    Reference : Daniel T. Gillespie (1977). "Exact Stochastic Simulation of Coupled Chemical Reactions". The Journal of Physical Chemistry 81 (25): 2340–2361

    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

  3. Runs and statistical properties
  4. In a Gillespie simulation, the information brought by a few instances of the Gillespie simulation is enough to get the general behaviour of the genetical system. However, it is not sufficient when the information that we want is the mean or the variance of the concentrations in each species.

    In this case a great number of runs is necessary to have a correct estimate of the expected values. This is why we had to write a Matlab code to iterate a great number of runs. This part of the code can be found in the file Main_gillespie.m.

    Once the runs are computed through Gillespie algorithm, we have to extract the information from them. In this purpose we wrote the Hist.m, test.m and Dynamicdistros.m files. These files are specific to our system, we hope they can give an idea of how to analyse the results obtained via our Gillespie code, but they are not as easily understandable as other files.

    Once the datasets are obtained we have to extract its statistical properties. Refer to the next section for more information.

IMPORTANT NOTE:

We tried to write a Matlab code that is as easily adaptable to any other system as possible. However, because of the lack of time and the great amount of work it requires, we could not build a completely generic MATLAB function handler for Gillespie simulations. We provide the source codes here of the Matlab stochastic scripts for our simulations and tried to comment them as much as possible. Note that, if you want to adapt our code to a completely different system, only the Stochastic_model.m and parameters.mat files need to be changed, but a good understanding of the whole code is necessary.

Mean, standard deviation and statistical properties

To get the number of bacteria and the minimal step for the IPTG gradient we get, we need to compute the mean and the standard deviation of each of the two species of the toggle switch.

X1 and X2 are here the matrices which will represent the two toggle switch ways in each bacterium on the whole plate. On eahc point of the plate are wells containing a great number of bacteria. Each way in each bacterium is a random variable. The X matrices are then matrices of nbcells*nbcell/well random variables.

Thanks to stochastic modelling we can obtain the mean and variance in each of the nbwells wells on the plate.

To design our final device we need to know the width of the interface between the two ways of the toggle switch. We also need to know the number of bacteria needed in the wells to have a proper measurement.

The interface which will be the colored part of our plate will turn red when populations in way 1 and populations in way 2 are in presence on the same point on the plate. We then need to know the statistical properties of the (X1X2)well random variable.

X1X2(well) is of course not continuous but discrete, we just want to highlight the deviation problem caused by σX1X2(well))

We want to know µX1X2(well) and σX1X2(well) to obtain respectively :

  1. The width of the "gaussian" function of µX1X2(well) to set the minimal definition (the ΔIPTG between wells) of our final device
  2. The minimum number of bacteria we want in the wells.
  3. We have nbcell/well independant random variables with the same probability density function. According to central limit theorem, the mean of X1X2 = (X1X2 cell1 + X1X2 cell2 + ... + X1X2 celln) / n is µX1X2(well) and its standard deviation is σX1X2(well)/n. The width of the gaussian is therefore easily calculable (µX1X2(well) = µX1(well) + µX2(well)), but it's not that easy for the standard deviation σX1X2(well)

    If we consider Y1 and Y2 two random variables correlated, with known mean and variance (µ1, µ2, σ1, σ2)
    Var(Y1Y2) = E[(Y1Y2 - E[(Y1Y2])2]
    = E[(Y1Y2)2 -2E[Y1Y2]Y1Y2 + E[Y1Y2]2]
    = E[(Y1Y2)] -2(µ1µ2)2 + µ1µ2

    and E[(Y1Y2)] is not reductible to function of µ1 and µ2. To obtian this value we then needed to create a composite random variable X3 wich will be calculated during for each run of our MATLAB stochastic algorithm (see previous section).
    x3 = x1 * x2
    We can thus get the variance and mean of X1X2 (X3) through simulation. If we want to get an error inferior to 10% for example around the µX1X2(well) curve, the number of bacteria n needed will be n so that : σ X 3 well n / µ X1X2 well < 10% With such a precision we can then calculate the IPTG definition between the wells.