http://2007.igem.org/wiki/index.php?title=Special:Contributions/Spicher&feed=atom&limit=50&target=Spicher&year=&month=2007.igem.org - User contributions [en]2024-03-29T12:38:29ZFrom 2007.igem.orgMediaWiki 1.16.5http://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2008-05-27T10:05:25Z<p>Spicher: /* MGS */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for Modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== Questions of Interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system ( [[Paris/Modeling#Proof_of_Principle:_Qualitative_Analysis_of_System.27s_Behavior| Section 2]]). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (<br />
[[Paris/Modeling#Exponential_growth_of_cellular_populations:_analytic_analysis_of_an_ODE_model|Section 2.1]]). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation ([[Paris/Modeling#Potential_macroscopic_effect_of_spatial_aspects_of_Dap_diffusion:_cellular_automaton_on_a_grid| Section 2.2]]), the other incorporating dynamical aspects of cell spatial organization ([[Paris/Modeling#Potential_macroscopic_effect_of_stochastic_and_spatial_aspects_of_Dap_diffusion_and_cell_growth|Section 2.3]]). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|DESIGN PROCESS]]:<br />
<br />
*A SMB with a fixed recombination rate<br />
*A SMB with a recombination rate depending on DAP starvation (feedback)<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness and tunability ( [[Paris/Modeling#Assessing_robustness_and_tunability_of_two_potential_designs:_numerical_simulations_of_ODE_models|Section 3.1]]). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior ([[Paris/Modeling#Potential_macroscopic_effect_of_stochastic_phenomena:_stochastic_simulations_with_Gillespie_algorithm|Section 3.2]]).<br />
<br />
=Proof of Principle: Qualitative Analysis of System's Behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing Robustness and Optimizing System's Behavior: Quantitative Analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part [[Paris/Modeling#Proof_of_Principle:_Qualitative_Analysis_of_System.27s_Behavior|2]], we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part [[Paris/Modeling#Assessing_Robustness_and_Optimizing_System.27s_Behavior:_Quantitative_Analysis|3]], our results indicated that the system's behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. This result is not surprising. Intuitively, even if SMB system is heterogeneous (because it is composed of two distinct populations of cells), the spatial distributions of both cells types are uniform; thus, the system evolution is space independent. Nevertheless, we were interested in checking the property using models and simulations. In fact this led us to use and develop original techniques (like [[Paris/Cell_auto_2|Delaunay triangulation]] or [[Paris/Stochastic_model|extended to nested membranes systems Gillespie algorithm]]). From a general point of view, developing such techniques is also of great interest for synthetic biology. Following the concepts of decoupling and abstraction that characterize biosynthetic developments, we have to ideally validate and study designs before constructing them physically. These validations appear at each step of a standard development, at the levels of systems, devices and bricks designing. We tried to follow and contribute to this methodology by considering at first phenomenological and global models, and molecules scaled models at last.<br />
<br />
Getting back to SMB, we would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally...<br />
<br />
:'''...all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.univ-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of MGS and Biocham programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2008-02-14T00:42:56Z<p>Spicher: /* SMB in Terms of Compartments and Chemical Reactions */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle a dynamic and heterogeneous population of bacteria in a stochastic context.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Stochastic Simulation Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approaches using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time, is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' of ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
[[Image:Modelsimpl.png|left|400px|right]]<br />
We start from the same representation of the system as presented in the [[Paris/Robustness_and_optimization|ODE based simulation]]. Obviously, bacteria are represented by compartments that contain molecules as shown on the picture of the previous section. Let now consider the figure next to this text in order to sum up the different molecules we have to deal with:<br />
<br />
* DAP: it is of course one of the major components of the system. It can be located in the bacteria or out of them in the environment. <br />
<br />
* Cre: it is the second main molecule to be considered. It remains in cells and cannot be exported or imported. <br />
<br />
* DNA: we focus only on the two parts of the DNA we are interested in:<br />
<br />
:* Both types of cell are able to produce Cre. This encoding region is under the control of a constitutive promoter. We then consider a molecule DAPAp that is an abstract representation of this part of the DNA. Thus every cell contains a DAPAp molecule. Following the two possible behaviors we consider, DAPAp can be inhibited or not by DAP (here is controlled the DAP (in)dependence of the differentiation). If the case occurs, the inhibited form of DAPAp is named DAPAp_i.<br />
<br />
:* The germ cells differentiate using a Cre controlled recombination of a DNA part. This part have two different states as the considered cell is either differentiated (somatic cell) or not (germ cells). See [[Paris/DesignProcess#How_will_auxotroph_germ_line_cells_differentiate_into_prototroph_somatic_cells.3F|here]] for a biological description of this mechanism. We can call these states LOX_Box for germ cells (the DNA part uses a LOX-Cre mechanism to recombine) and DAP_Box for somatic cells (after recombination the DNA is able to produce DAP). Once again each cell has to contain one molecule of DAP_Box or one molecule of LOX_Box.<br />
<br />
The other components are of course bacteria compartments. The two kinds of compartment differ only by the presence of either LOX_Box for germ cells or DNA_Box for soma cells. Using these molecules, we are able to model the dynamics by chemical reactions.<br />
<br />
<html><u>DAP and Cre degradation:</u></html><br />
<code><br />
Cre -><sub>K_CreD</sub> .<br />
DAP -><sub>K_DAPD</sub> .<br />
</code><br />
<br />
<html><u>DAPAp promoter activity for DAP dependence differentiation:</u></html> these rules prevent the production of Cre when DAP inhibits DAPAp<br />
<code><br />
DAPAp + DAP -><sub>K_DAPApI</sub> DAPAp_i<br />
DAPAp_i -><sub>K_DAPApA</sub> DAPAp + DAP<br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
<html><u>DAPAp promoter activity for independent differentiation:</u></html> DAPAp is never inhibited<br />
<code><br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
<html><u>Differentiation:</u></html> note that the differentiation is irreversible. Molecules of Cre have to bind the both LOX sites of the LOX_BOX. We name <code>LOXP_Box<sub>Cre</sub></code> the intermediary state<br />
<code><br />
LOXP_Box<sub> </sub> + Cre -><sub>K_Diff</sub> LOXP_Box<sub>Cre</sub><br />
LOXP_Box<sub>Cre</sub> + Cre -><sub>K_Diff</sub> DAP_Box<br />
</code><br />
<br />
<html><u>DAP production:</u></html> this only happens in somatic cells, germ cell does not contain DAP_Box. Therefore, only somatic cells are to feed germ cells<br />
<code><br />
DAP_Box -><sub>K_DAPiP</sub> DAP_Box + DAP<br />
</code><br />
<br />
<html><u>DAP import and export:</u></html> these rules are applied in the environment. The square brackets represent compartments (for example <code>[...]<sub>BactS</sub></code> is a somatic cell)<br />
<code><br />
[DAP, ...]<sub>Bact</sub> -><sub>K_DAPEx</sub> DAP + [...]<sub>Bact</sub><br />
DAP + [...]<sub>Bact</sub> -><sub>K_DAPIm</sub> [DAP, ...]<sub>Bact</sub><br />
</code><br />
<br />
<html><u>Bacteria macroscopic evolutions (division and death):</u></html> when a bacterium dies, its internal DAP molecules are released in the environment. As DAP is essential for germ cells division, we can envisage that the value of the kinetic constant <code>K_Div</code> is a function of the number <code>''n''</code> of DAP molecules in the cell<br />
<code><br />
[''n''.DAP, ...]<sub>BactG</sub> -><sub>K_Div </sub> [(''n''/2).DAP, ...]<sub>BactG</sub> + [(''n''/2).DAP, ...]<sub>BactG</sub><br />
[''n''.DAP, ...]<sub>Bact </sub> -><sub>K_Death</sub> ''n''.DAP<br />
</code><br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific [[Paris/mgs#Rules_Application_Strategies|rules application strategy]] implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''[[Paris/mgs#Topological_Collections|bag]]'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent well-mixed chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain one molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulations]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/User:SpicherUser:Spicher2007-11-26T20:24:34Z<p>Spicher: </p>
<hr />
<div>[[Image:Antoine_Spicher.jpg]]<br />
<br />
During my PhD at the [http://www.ibisc.univ-evry.fr IBISC laboratory] of the university of Evry, I have worked on the [http://mgs.ibisc.univ-evry.fr MGS project] that aims at developing an experimental programming language dedicated to [[Paris/mgs|the modeling and the simulation of dynamical systems with a dynamical structure]]. I am now interested in synthetic biology that is to me a computational approach of life. I particularly study to the programming of bacteria population using concepts of amorphous computing.</div>Spicherhttp://2007.igem.org/wiki/index.php/User:SpicherUser:Spicher2007-11-26T20:23:21Z<p>Spicher: </p>
<hr />
<div>[[Image:Antoine_Spicher.jpg]]<br />
<br />
During my PhD at the [http://www.ibisc.univ-evry.fr IBISC laboratory] of the university of Evry, I have worked on the [http://mgs.ibisc.univ-evry.fr MGS project] that aims at developing an experimental programming language dedicated to [[Paris/mgs|the modeling and the simulation of dynamical systems with a dynamical structure]]. I am now interested in synthetic biology that is to me a computational approach of life. I particularly study to the programming of bacteria population using concept of amorphous computing.</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-27T00:13:07Z<p>Spicher: </p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle a dynamic and heterogeneous population of bacteria in a stochastic context.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Stochastic Simulation Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approaches using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time, is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' of ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
[[Image:Modelsimpl.png|left|400px|right]]<br />
We start from the same representation of the system as presented in the [[Paris/Robustness_and_optimization|ODE based simulation]]. Obviously, bacteria are represented by compartments that contain molecules as shown on the picture of the previous section. Let now consider the figure next to this text in order to sum up the different molecules we have to deal with:<br />
<br />
* DAP: it is of course one of the major components of the system. It can be located in the bacteria or out of them in the environment. <br />
<br />
* Cre: it is the second main molecule to be considered. It remains in cells and cannot be exported or imported. <br />
<br />
* DNA: we focus only on the two parts of the DNA we are interested in:<br />
<br />
:* Both types of cell are able to produce Cre. This encoding region is under the control of a constitutive promoter. We then consider a molecule DAPAp that is an abstract representation of this part of the DNA. Thus every cell contains a DAPAp molecule. Following the two possible behaviors we consider, DAPAp can be inhibited or not by DAP (here is controlled the DAP (in)dependence of the differentiation). If the case occurs, the inhibited form of DAPAp is named DAPAp_i.<br />
<br />
:* The germ cells differentiate using a Cre controlled recombination of a DNA part. This part have two different states as the considered cell is either differentiated (somatic cell) or not (germ cells). See [[Paris/DesignProcess#How_will_auxotroph_germ_line_cells_differentiate_into_prototroph_somatic_cells.3F|here]] for a biological description of this mechanism. We can call these states LOX_Box for germ cells (the DNA part uses a LOX-Cre mechanism to recombine) and DAP_Box for somatic cells (after recombination the DNA is able to produce DAP). Once again each cell has to contain one molecule of DAP_Box or one molecule of LOX_Box.<br />
<br />
The other components are of course bacteria compartments. The two kinds of compartment differ only by the presence of either LOX_Box for germ cells or DNA_Box for soma cells. Using these molecules, we are able to model the dynamics by chemical reactions.<br />
<br />
<html><u>DAP and Cre degradation:</u></html><br />
<code><br />
Cre -><sub>K_CreD</sub> .<br />
DAP -><sub>K_DAPD</sub> .<br />
</code><br />
<br />
<html><u>DAPAp promoter activity for DAP dependence differentiation:</u></html> these rules prevent the production of Cre when DAP inhibits DAPAp<br />
<code><br />
DAPAp + DAP -><sub>K_DAPApI</sub> DAPAp_i<br />
DAPAp_i -><sub>K_DAPApA</sub> DAPAp + DAP<br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
<html><u>DAPAp promoter activity for independent differentiation:</u></html> DAPAp is never inhibited<br />
<code><br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
<html><u>Differentiation:</u></html> note that the differentiation is irreversible. Molecules of Cre have to bind the both LOX sites of the LOX_BOX. We name <code>LOXP_Box<sub>Cre</sub></code> the intermediary state<br />
<code><br />
LOXP_Box<sub> </sub> + Cre -><sub>K_Diff</sub> LOXP_Box<sub>Cre</sub><br />
LOXP_Box<sub>Cre</sub> + Cre -><sub>K_Diff</sub> DAP_Box<br />
</code><br />
<br />
<html><u>DAP production:</u></html> this only happens in somatic cells, germ cell does not contain DAP_Box. Therefore, only somatic cells are to feed germ cells<br />
<code><br />
DAP_Box -><sub>K_DAPiP</sub> DAP_Box + DAP<br />
</code><br />
<br />
<html><u>DAP import and export:</u></html> these rules are applied in the environment. The square brackets represent compartments (for example <code>[...]<sub>BactS</sub></code> is a somatic cell)<br />
<code><br />
[DAP, ...]<sub>Bact</sub> -><sub>K_DAPEx</sub> DAP + [...]<sub>Bact</sub><br />
DAP + [...]<sub>Bact</sub> -><sub>K_DAPIm</sub> [DAP, ...]<sub>Bact</sub><br />
</code><br />
<br />
<html><u>Bacteria macroscopic evolutions (division and death):</u></html> when a bacterium dies, its internal DAP molecules are released in the environment. As DAP is essential for germ cells division, we can envisage that the value of the kinetic constant <code>K_Div</code> is a function of the number <code>''n''</code> of DAP molecules in the cell<br />
<code><br />
[''n''.DAP, ...]<sub>BactG</sub> -><sub>K_Div </sub> [(''n''/2).DAP, ...]sub>BactG</sub> + [(''n''/2).DAP, ...]sub>BactG</sub><br />
[''n''.DAP, ...]<sub>Bact </sub> -><sub>K_Death</sub> ''n''.DAP<br />
</code><br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific [[Paris/mgs#Rules_Application_Strategies|rules application strategy]] implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''[[Paris/mgs#Topological_Collections|bag]]'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent well-mixed chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain one molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulations]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/mgsParis/mgs2007-10-26T23:53:41Z<p>Spicher: </p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br><br />
<br />
MGS is an experimental programming language developed at the university of Evry dedicated to the ''modeling'' and the ''simulation'' of ''dynamical systems with a dynamical structure''. We briefly present in this section the philosophy of MGS programming. A complete presentation of the language is available [http://mgs.ibisc.univ-evry.fr/ here].<br />
<br />
= Dynamical Systems with a Dynamical Structure =<br />
<br />
== Dynamical Structure ==<br />
<br />
Intuitively, characterizing a ''dynamical system'' (DS) is giving a formal description of how a point, the ''state'' of the system, moves in the ''phase space'', the set of all possible states of the system. This displacement specifies a rule, the ''evolution function'', saying where the point goes from its current position. A lot of formalisms have been developed to describe DS like differential equations, iterating of functions, cellular automata, ... providing the right formalism in accordance with the discrete or continuous nature of time and space.<br />
<br />
The state of a DS at a given <code>t</code> can be characterized by the elements that composed the system at <code>t</code>. The most of the time, interactions occur between parts that are neighbor in this partition of the system. So the definition of the evolution function (that specifies which parts are interacting) relies on this neighborhood and often corresponds to ''local evolution laws''.<br />
<br />
From the biological point of view, we can note that a lot of dynamical systems exhibit a ''dynamical structure'': not only do the values of state variables evolve, but the phase space and the definition of the evolution function do. The phase space has to be considered as an observable of the system. We call these systems ''Dynamical Systems with a Dynamical Structure'' (DS<sup>2</sup>).<br />
<br />
An obvious example of biological DS<sup>2</sup> is the embryo development. Initially, the state of the system is described by the chemical state of the egg (however complex is this description). After many divisions, the systems is not well described by the chemical state of '''one''' cell, but many cells. Moreover the spatial organization of the cells matter in the future (spatial) development of the organism. The number of cells, their spatial organization and the interactions continually evolve.<br />
<br />
In terms of simulation, DS<sup>2</sup> are very hard to model/implement cause the data structure required for the representation of the system state, can be topologically modified. MGS was developed to answer this question.<br />
<br />
== Rewriting to Model and Simulate DS<sup>2</sup> ==<br />
<br />
A rewriting system (RS) is a computational device. Computations are done by replacing a subpart of an object by another one. By iterating this process on an object, it can be transformed in another one with respect to a set of rewriting rules. A computational example is arithmetical expression evaluation: given an expression <code>e</code> (for example <code>e=1+0</code>), it is reduced in an other expression <code>e'</code> by a simplification rule like <code>x + 0 -> x</code> meaning that <code>0</code> is neutral for <code>+</code>.<br />
<br />
This computational process is suitable for specifying the evolution of a DS<sup>2</sup>. The relation between DS<sup>2</sup> and RS is given as follows:<br />
<br />
* the '''state''' of the system = a '''data structure''' (this structure fits the organization of the system)<br />
<br />
* the '''dynamics''' of the system = a set of '''rewriting rules'''. A rewriting rule <code>a => b</code> specifies a local evolution law. It is composed of two parts: the left hand side <code>a</code> is a pattern of interaction, and the right hand side <code>b</code> evaluates the products of the interaction. The application of a rule works as follows:<br />
<br />
:* <code>a</code> is used to select a subpart <code>A</code> of the system <code>S</code> where an interaction occurs,<br />
<br />
:* <code>b</code> is used to evaluate the product <code>B</code> of the interaction,<br />
<br />
:* <code>A</code> is finally replaced by <code>B</code> in <code>S</code>.<br />
<br />
= MGS Features =<br />
MGS embeds these notions through the concepts of ''topological collections'', ''transformations'' and ''rules application strategies''.<br />
<br />
== Topological Collections ==<br />
<br />
They are the only way to aggregate data in MGS. Collections are used to describe the state of a DS<sup>2</sup>. They are composed of a set of elements, the different parts of the system, together with a neighborhood relationship between elements, representing possible interactions. For example, if collection elements are molecules, when two molecules are neighbor that means they are "close" enough to react.<br />
<br />
There exist several types of topological collections in MGS. In this project we have used three of them:<br />
<br />
* '''square grids''': this collection is typically used to specify cellular automaton based models. The elements of the collection are the cases of the square grid and the neighborhood is regular: each case has four neighbors following north, south, east and west directions. We use them to simulate the [[Paris/Cell_auto|DAP diffusion]] in our system.<br />
<br />
* '''Delaunay triangulations''': a Delaunay triangulation is procedure that, given a finite set of points localized in an euclidean space, computes the triangulation between the points that is as regular as possible. This provides a very natural neighborhood between points. As the neighborhood depends on the localization of each element of the collection, Delaunay triangulations are useful to describe dynamical structure. We use this triangulation to represent the spatial organization of cells in [[Paris/Cell_auto_2|this model]]. The points used for the triangulation are the position of cells. As the cells are diffusing, dividing, dying, ... , the neighborhood is recomputed and updated. This example also considers that a spring exists between two neightbor cells in order to simulate the aggregation of the population.<br />
<br />
* '''bags''': the last collection is also called ''multi-sets''. They are collections when each element is neighbor of all the others. They are particularly suitable for representing well-mixed chemical solutions. We used them is the [[Paris/Stochastic_model|Gillespie based simulation]].<br />
<br />
== Transformations ==<br />
<br />
Transformations are functions of topological collections. They are defined by sets of rewriting rules; the following expression is a skeleton of a transformation definition:<br />
<br />
<code><br />
trans ''name'' = {<br />
pattern<sub>1</sub> => expression<sub>1</sub> ;<br />
...<br />
pattern<sub>N</sub> => expression<sub>N</sub> ;<br />
}<br />
</code><br />
<br />
Each rule is composed of a pattern used to specify an interaction, ''i.e.'' a subpart of the collection where an interaction occurs. Typically, the pattern <code>x, y</code> matches two elements of the collection (we can refer to these elements in the right hand side using <code>x</code> and <code>y</code> variables) that are neighbor (this is the meaning of the comma). The right hand side is an MGS expression that evaluates a sequence of values. This sequence will be put in the collection at the place of the matched sub-collection.<br />
<br />
A lot of examples of transformations are given in the [[Paris/Sources|sources]] of our programs. Example of MGS programs are also available in the MGS [http://mgs.ibisc.univ-evry.fr/ImageGallery/mgs_gallery.html official gallery].<br />
<br />
== Rules Application Strategies ==<br />
<br />
This last feature allows to parametrize the application of a transformation on a collection by a rules application strategy, that is a policy specifying the order, the number of applications, and the priority of the rules. Rules can for example be applied synchronously everywhere in the collection or asynchronously when only one rule is chosen and applied once. MGS provides some strategies. Our programs use two of them:<br />
<br />
* the ''maximal-parallel'' strategy: this strategy is standard in the simulation of DS. It consists in applying each rule (on separated sub-collection) as many times as possible. Intuitively, this means that the local evolution laws specified by the transformation rules are concurrent and act all together at each time step. This strategy is used in the [[Paris/Cell_auto|DAP diffusion]] model and in the [[Paris/Cell_auto_2|dynamical structure]] model.<br />
<br />
* the ''gillespie'' strategy: this strategy is specific to the exact stochastic simulation of chemical reactions. An introduction to Gillespie simulation method is given [[Paris/Stochastic_model#Gillespie.27s_SSA|here]]. Each rule of the transformation is considered to be a chemical reaction. An application of a transformation with this strategy consists in choosing the chemical reaction with the highest probability to occur as soon as possible (knowing the chemicals concentrations and the kinetics of the represented reaction), and to apply it once in the collection.<br />
<br />
= MGS Top-level =<br />
<br />
All our programs have been executed using the MGS top-level available [http://mgs.ibisc.univ-evry.fr here]. This implementation of the language is a prototype but it can be used to quickly design models of complex systems as we did for SMB. In fact, one of the major advantage of using MGS is time-saving when developing models. The concepts behind the three models have been programmed in about half a day each. All the rest of the time we spent in developing programs was dedicated to optimize execution time, generate outputs and tune parameters.</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ResultsParis/Results2007-10-26T23:17:05Z<p>Spicher: /* Modeling results */</p>
<hr />
<div>{{template:Paris_menu}}<br />
<br />
<br />
= Experimental results =<br />
<br />
== SMB related experiments ==<br />
<br />
=== dapA deletant growth ===<br />
<br />
We expect the somatic cells to excrete only a limited amount of DAP, it would thus be nice if our auxotroph strain could grow on limited amount of metabolite. Over night culture were diluted 100 time in LB suplemented with different amount of DAP.<br />
<br />
=== Survival of dapA deleted strain and Co-culture experiments ===<br />
<br />
<br />
If we want our system to be robust, the germ line cells should be able to live as long as possible when deprived of DAP. They may indeed face such a feat within our system if their is not enough somatic cells at a given time.<br />
<br />
Our dapA deleted strain was grown over night in LB + 300µM DAP. A culture was then launched diluting 100 time the ON culture in LB (+ Kanamycin). 100µL were plated each hour and the number of clone determined.<br />
<br />
We also want to know if the soma of our synthetic organism will be able to feed the germ line. Unfortunatly, this cannot properly be done without the final construct. Nevertheless, we can already check if in similar situations, dapA deleted strain can survive. <br />
<br />
Two different co-culture experiments were performed: <br />
* In the first one, the dapA deleted strain is grown with a prototroph strain. In this case, we know for sure that the prototroph cells will take the population over. Nervertheless it is interesting to see if dapA deleted strain survive longer in this condition than if alone and without DAP.<br />
<br />
[[Image:Paris_DapASurvival.jpg]]<br />
<br />
(the experiment has only been done once, and would be worth repeating to confirm the results)<br />
<br />
We can draw from this curves two important conclusions:<br />
<br />
1. Most of the cells die within the first 2 hours of culture, but a small fraction of the cells are still alive after 8 hours. A part of the dapA deleted cells can thus survive for quite long, which is a good point for us.<br />
<br />
2. When in coculture with a prototroph cell, around 100 time more cells have a long term survival. This means that the dapA deleted strain benefits a bit from the prototroph cell presence and its DAP production capacities.<br />
<br />
* In the second coculture experiment, the dapA deleted strain is grown with a strain bearing an auxotrophy to another metabolite. This experiment reproduces cross-feeding works done on the yeast by Shou W et al. (Synthetic cooperation in engineered yeast populations, PNAS). In this coculture there is a mutual dependence of each strain for the other. If this works, then we know for sure that dapA deleted strain can be rescued by a strain producing DAP!<br />
<br />
Our dapA- strain was grown with a tryptophan operon deleted strain. The culture was plated to check the presence of both strains after 8H. They were both present in concentration above 5*10^4 CFU/Ml. This clearly means that DAP is a good choice as our auxotrophy metabolite !<br />
<br />
=== DAP excretion by prototroph cells ===<br />
<br />
We want to know if prototroph cells are excreting DAP and in what amount. Instead of doing proper chemical dosages which are expensive, we had the idea to make a biological measurements. If we want to quantify DAP concentration of a given medium, we might be able to do so simply by looking at how well a dapA- strain grows into it.<br />
<br />
<br />
Prototroph MG1655 strain was grown in LB, and the medium was recovered at different stages of the culture and purified. The dapA deleted strain was then grown in the recovered medium. What we observed is that no enough DAP is present for any growth to happen. From this point we decided to add little concentration of DAP into the recovered medium, to see what is the minimum amount to add to obtain growth. If this amount is small then it means that there is already quite a lot of DAP present into the medium. Typically if we need to add 10µM of DAP to get a growth similar to LB supplemented with 20µM, we can estimate that the initial concentration is around 10µM.<br />
<br />
<br />
More rigorously, what we measure isn't really the DAP concentration of the medium, but rather what we could call DAP equivalents. This is mainly due to two points. First, dapA gene is the first out of 5 genes making the steps from aspartate-semialdehyde to DAP. So we measure in fact the sum of all intermediaries of the pathway that may be present in the medium and imported by the cells. This is not a problem for us since we do not really care with what exact compound the soma feeds the germline. Second, the recovered medium isn't really LB anymore, so it is not perfectly rigorous to compare it with LB. There might be other compounds excreted during growth, compensating for the DAP starvation. But we do not really care either if this is the case. What we really want to see is how much the excretions of a prototroph cell can favor the growth of a dapA- strain (regardless of what excreted compound matters). And we measure this as DAP equivalents.<br />
<br />
<br />
Here are representative results of what we got from this experiments:<br />
<br />
Medium recovered from MG1655 culture broth are annotated S0.2, S0.4, S0.6, S0.8 and were recovered at optical densities of respectively 0.2, 0.4, 0.6 and 0.8. The added DAP concentration is given.<br />
<br />
[[Image:Paris_Graph1_w121_070707.jpg|800px]]<br />
[[Image:Paris_Graph2_w121_070707.jpg|800px]]<br />
<br />
We clearly see that the latter we recover the medium in the prototroph growth, the less DAP we need to add to obtain growth. This is one more hint that DAP is a good choice for the SMB and we can also try to estimate DAP equivalents for our media. For instance the growth in S0.2 with 25µM of added DAP seems equivalent to the growth in LB with 37.5µM added DAP. This means that S0.2 contains around 12.5µM of DAP equivalents. Nevertheless it was quite hard to retrieve any reliable data from this experiment.<br />
<br />
Here are estimates of DAP equivalents gathered from several experiments:<br />
* S0.2=<br />
* S0.4=<br />
* S0.6=<br />
* S0.8=<br />
<br />
=== Recombination frequency measurements ===<br />
<br />
In the section “Design Process”, the question of the recombination frequency has been discussed. G to S differentiation frequency, and thus lox recombination frequency on which it is based, is a key aspect of our system. Indeed, optimal overall differentiation frequency lies somewhere between 0 and 50% per generation.<br />
<br />
We would like to have tuneable recombination device in order to find the optimal frequency, which lies somewhere between 0 and 50% of recombination per generation. We should be able to tune the recombination frequency by modulating the Cre recombinase expression. In order to do this, we have cloned Cre under the control of the pBAD promoter. We then wanted to characterize our "Cre generator device", and determine the relation between Cre expression level and recombination frequency.<br />
<br />
Three types of experiments were planned and partially performed in this regard:<br />
<br />
* Experiments using FX85 strain harbouring lox-KmR-lox casstte: indirectly measuring recombination frequency by plating on Kan plates after Cre expression assays.<br />
* Experiments using FX85 strain harbouring lox-KmR-lox casstte: indirectly measuring recombination frequency by studying growthrates.<br />
* Experiments using the recombination measurement biodevice.<br />
<br />
<br />
A) Experiments using FX85 strain harbouring lox-KmR-lox casstte: indirectly measuring<br />
<br />
We used FX85 strain (provided by Francois-Xavier Barre) carrying the cassette: lox-KmR-lox inserted into its chromosome. We transformed this strain with our pBad-Cre construct (carried by an Ampiciline resistance plasmid: pSB1A2). Inducing of Cre expression with different arabinose levels was performed. The last step is then spreading on selective plates (Amp or Amp+Kan). The ratio between the number of clones on the two types of plates should give us an estimate of the recombination frequency. When we tried to do this, we did not get any clones on the Amp+Kan plates, even without Cre induction. But this doesn't mean that the recombination frequency is 100%. In fact, if recombination frequency is around 50% per generation or higher, no colonies can grow on kan plates, simply because half or more of the cells will die at each generation (those who recombine are not resistant to Kanamycin any more after little time). <br />
<br />
This means that our Cre generator is quite leaky and gives quite high recombination rates without induction. <br />
<br />
B) Experiments using FX85 strain harbouring lox-KmR-lox casstte: indirectly measuring recombination frequency by studying growthrates.<br />
<br />
If recombination frequency is two high in owr experimental system, then no growth can be seen on Ampicilline (plasmid selection antibiotic)+ Kanamycin (screens against recombiants: cells having excised lox-kanR from their genome). We tested an alternative strategy in order to circumvent this problem.<br />
In order to approximately determine what recombination rate we had, we performed another experiment. FX85 strain was transformed with our pBad-Cre construct. Directly after transformation, liquid cultures were launched with either Amp or Amp+Kan. 100µl of the cultures were regularly plated on LB+Amp, giving the following growth curves:<br />
<br />
[[Image: recombination rate.png|center|500px]]<br />
<br />
C) The third strategy is based on a more direct observation of recombination rate. <br />
We have constructed a “Recombination frequency measurement” device. The schematic structure of this genetic construct is as follows:<br />
<br />
[[Image: recombi frequency.jpg|center|500px]]<br />
<br />
This consctruct has been generated, [[Recombination frequency device|SEE HERE]] the steps of it’s construction.<br />
<br />
This construct has yet to be inserted in the genome. Cre induced recombination frequency measurements will then be performed.<br />
Using this system, an event of recombination is accompanied by a switch in fluorescence from GFP to mRFP wich can be followed under microscope on small E.coli populations.<br />
<br />
=== dapAp characterisation ===<br />
<br />
[[Image: FACS.png|center|500px]]<br />
<br />
=== pBAD characterisation ===<br />
<br />
<br />
=== Comparing of dapA genes of E.coli & B.subtilis ===<br />
<br />
== DGAT cloning and triglyceride synthesis in E. Coli ==<br />
<br />
*'''TG synthesis experiment'''<br />
<br />
1. We transformed chemically competent E.coli (DH5alpha) with pBluescript SK minus vector (Stratagene) (ampicilline resistance and pLac promoter) baring DGAT gene (pKS::DGAT). In this vector, dgat transcription is induced by IPTG. <br />
<br />
Nile Red fluorescence dye was used, at a concentration of 5µg/mL to monitor lipid inclusions in different conditions of DGAT expression and fatty acid availability:<br />
<br />
(0.4mM IPTG induction in LB medium with or without sodium oleate 2mM). Results are shown below.<br />
<br />
[[Image: Coli dgat 07232007.jpg|center|900px]]<br />
<br />
Line 1 represents E.coli transformed with pKS::DGAT; and Line 2 the negative control (E.coli transformed by part B0015). Columns 1 and 2 are LB medium without sodium oleate supplementation; columns 3 and 4 are LB with sodium oleate supplementation (2mM). Columns 1 and 3 are without IPTG; columns 3 and 4 with IPTG induction (0.4mM). <br><br />
'''We can observe lipid inclusion into E.coli transformed by pKS::DGAT with IPTG induction'''. <br />
<br>No significant difference is seen between the +/- oleate cells. <br><br />
<br />
2. To exclude that the fluorescence observed is due to DGAT induced cell death. A cell death marker (green) is used. It can be seen below that cell death is not increased upon DGAT expression.<br />
<br />
[[Image: Coli_dgat_death_07232007.jpg|center|800px]]<br />
<br />
3. We started creating DGAT biobrick <bbpart>BBa_I718002</bbpart>: <br />
<br />
*PCR based mutagenesis was performed to eliminate a PstI site in dgat coding sequence. <br />
* We attempted adding biobrick prefix and suffix sites to dgat but have yet to finish the cloning process :-(<br />
<br />
<br />
<br />
= Modeling results =<br />
<br />
The goal of our [[Paris/Modeling|modeling work]] was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part [[Paris/Modeling#Proof_of_Principle:_Qualitative_Analysis_of_System.27s_Behavior|2]], we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part [[Paris/Modeling#Assessing_Robustness_and_Optimizing_System.27s_Behavior:_Quantitative_Analysis|3]], our results indicated that the system's behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. This result is not surprising. Intuitively, even if SMB system is heterogeneous (because it is composed of two distinct populations of cells), the spatial distributions of both cells types are uniform; thus, the system evolution is space independent. Nevertheless, we were interested in checking the property using models and simulations. In fact this led us to use and develop original techniques (like [[Paris/Cell_auto_2|Delaunay triangulation]] or [[Paris/Stochastic_model|extended to nested membranes systems Gillespie algorithm]]). From a general point of view, developing such techniques is also of great interest for synthetic biology. Following the concepts of decoupling and abstraction that characterize biosynthetic developments, we have to ideally validate and study designs before constructing them physically. These validations appear at each step of a standard development, at the levels of systems, devices and bricks designing. We tried to follow and contribute to this methodology by considering at first phenomenological and global models, and molecules scaled models at last.<br />
<br />
Getting back to SMB, we would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally...<br />
<br />
:'''...all these results corroborate our initial design'''.</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T23:16:55Z<p>Spicher: /* Summary */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for Modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== Questions of Interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section [[Paris/Modeling#Proof_of_Principle:_Qualitative_Analysis_of_System.27s_Behavior|2]]). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section [[Paris/Modeling#Exponential_growth_of_cellular_populations:_analytic_analysis_of_an_ODE_model|2.1]]). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section [[Paris/Modeling#Potential_macroscopic_effect_of_spatial_aspects_of_Dap_diffusion:_cellular_automaton_on_a_grid|2.2]]), the other incorporating dynamical aspects of cell spatial organization (Section [[Paris/Modeling#Potential_macroscopic_effect_of_stochastic_and_spatial_aspects_of_Dap_diffusion_and_cell_growth|2.3]]). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness and tunability (Section [[Paris/Modeling#Assessing_robustness_and_tunability_of_two_potential_designs:_numerical_simulations_of_ODE_models|3.1]]). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section [[Paris/Modeling#Potential_macroscopic_effect_of_stochastic_phenomena:_stochastic_simulations_with_Gillespie_algorithm|3.2]]).<br />
<br />
=Proof of Principle: Qualitative Analysis of System's Behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing Robustness and Optimizing System's Behavior: Quantitative Analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part [[Paris/Modeling#Proof_of_Principle:_Qualitative_Analysis_of_System.27s_Behavior|2]], we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part [[Paris/Modeling#Assessing_Robustness_and_Optimizing_System.27s_Behavior:_Quantitative_Analysis|3]], our results indicated that the system's behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. This result is not surprising. Intuitively, even if SMB system is heterogeneous (because it is composed of two distinct populations of cells), the spatial distributions of both cells types are uniform; thus, the system evolution is space independent. Nevertheless, we were interested in checking the property using models and simulations. In fact this led us to use and develop original techniques (like [[Paris/Cell_auto_2|Delaunay triangulation]] or [[Paris/Stochastic_model|extended to nested membranes systems Gillespie algorithm]]). From a general point of view, developing such techniques is also of great interest for synthetic biology. Following the concepts of decoupling and abstraction that characterize biosynthetic developments, we have to ideally validate and study designs before constructing them physically. These validations appear at each step of a standard development, at the levels of systems, devices and bricks designing. We tried to follow and contribute to this methodology by considering at first phenomenological and global models, and molecules scaled models at last.<br />
<br />
Getting back to SMB, we would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally...<br />
<br />
:'''...all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of MGS and Biocham programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T23:12:18Z<p>Spicher: /* Questions of Interest */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for Modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== Questions of Interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section [[Paris/Modeling#Proof_of_Principle:_Qualitative_Analysis_of_System.27s_Behavior|2]]). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section [[Paris/Modeling#Exponential_growth_of_cellular_populations:_analytic_analysis_of_an_ODE_model|2.1]]). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section [[Paris/Modeling#Potential_macroscopic_effect_of_spatial_aspects_of_Dap_diffusion:_cellular_automaton_on_a_grid|2.2]]), the other incorporating dynamical aspects of cell spatial organization (Section [[Paris/Modeling#Potential_macroscopic_effect_of_stochastic_and_spatial_aspects_of_Dap_diffusion_and_cell_growth|2.3]]). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness and tunability (Section [[Paris/Modeling#Assessing_robustness_and_tunability_of_two_potential_designs:_numerical_simulations_of_ODE_models|3.1]]). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section [[Paris/Modeling#Potential_macroscopic_effect_of_stochastic_phenomena:_stochastic_simulations_with_Gillespie_algorithm|3.2]]).<br />
<br />
=Proof of Principle: Qualitative Analysis of System's Behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing Robustness and Optimizing System's Behavior: Quantitative Analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part 2, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part 3, our results indicated that the system's behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. This result is not surprising. Intuitively, even if SMB system is heterogeneous (because it is composed of two distinct populations of cells), the spatial distributions of both cells types are uniform; thus, the system evolution is space independent. Nevertheless, we were interested in checking the property using models and simulations. In fact this led us to use and develop original techniques (like [[Paris/Cell_auto_2|Delaunay triangulation]] or [[Paris/Stochastic_model|extended to nested membranes systems Gillespie algorithm]]). From a general point of view, developing such techniques is also of great interest for synthetic biology. Following the concepts of decoupling and abstraction that characterize biosynthetic developments, we have to ideally validate and study designs before constructing them physically. These validations appear at each step of a standard development, at the levels of systems, devices and bricks designing. We tried to follow and contribute to this methodology by considering at first phenomenological and global models, and molecules scaled models at last.<br />
<br />
Getting back to SMB, we would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally...<br />
<br />
:'''...all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of MGS and Biocham programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T23:04:22Z<p>Spicher: /* Summary */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for Modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== Questions of Interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section 2). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of Principle: Qualitative Analysis of System's Behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing Robustness and Optimizing System's Behavior: Quantitative Analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part 2, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part 3, our results indicated that the system's behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. This result is not surprising. Intuitively, even if SMB system is heterogeneous (because it is composed of two distinct populations of cells), the spatial distributions of both cells types are uniform; thus, the system evolution is space independent. Nevertheless, we were interested in checking the property using models and simulations. In fact this led us to use and develop original techniques (like [[Paris/Cell_auto_2|Delaunay triangulation]] or [[Paris/Stochastic_model|extended to nested membranes systems Gillespie algorithm]]). From a general point of view, developing such techniques is also of great interest for synthetic biology. Following the concepts of decoupling and abstraction that characterize biosynthetic developments, we have to ideally validate and study designs before constructing them physically. These validations appear at each step of a standard development, at the levels of systems, devices and bricks designing. We tried to follow and contribute to this methodology by considering at first phenomenological and global models, and molecules scaled models at last.<br />
<br />
Getting back to SMB, we would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally...<br />
<br />
:'''...all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of MGS and Biocham programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T23:01:47Z<p>Spicher: /* Summary */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for Modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== Questions of Interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section 2). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of Principle: Qualitative Analysis of System's Behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing Robustness and Optimizing System's Behavior: Quantitative Analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part 2, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part 3, our results indicated that the system's behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. This result is not surprising. Intuitively, even if SMB system is heterogeneous (because it is composed of two distinct populations of cells), the spatial distributions of both types of cells are uniform; thus, the system evolution is space independent. Nevertheless, we were interested in checking the property using models and simulations. In fact this led us to use and develop original techniques (like [[Paris/Cell_auto_2|Delaunay triangulation]] or [[Paris/Stochastic_model|extended to nested membranes systems Gillespie algorithm]]). From a general point of view, developing such techniques is also of great interest for synthetic biology. Following the concepts of decoupling and abstraction that characterize biosynthetic developments, we have to ideally validate and study designs before constructing them physically. These validations appear at each step of a standard development, at the levels of systems, devices and bricks designing. We tried to follow and contribute to this methodology by considering at first phenomenological and global models, and molecules scaled models at last.<br />
<br />
Getting back to SMB, we would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of MGS and Biocham programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T22:52:48Z<p>Spicher: /* Summary */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for Modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== Questions of Interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section 2). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of Principle: Qualitative Analysis of System's Behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing Robustness and Optimizing System's Behavior: Quantitative Analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part 2, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part 3, our results indicated that the system's behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. This result is not surprising. Intuitively, even if SMB system is heterogeneous (because it is composed of two distinct populations of cells), the spatial distributions of both types of cells are uniform; thus, the system evolution is space independent. Nevertheless, we were interested in checking the property using models and simulations. In fact this led us to use and develop original techniques (like [[Paris/Cell_auto_2|Delaunay triangulation]] or [[Paris/Stochastic_model|extended to nested membranes systems Gillespie algorithm]]). From a general point of view, developing such techniques is also of great interest for synthetic biology. Following the concepts of decoupling and abstraction that characterize biosynthetic developments, we have to ideally validate and study designs before constructing them physically. These validations appear at each step of a standard development, at the levels of systems, devices and brick designing. We tried to follow and contribute this methodology by considering at first a phenomenological and global model, and a stochastic and molecules scaled model at last.<br />
<br />
Getting back to SMB, we would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of MGS and Biocham programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T22:50:39Z<p>Spicher: /* Summary */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for Modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== Questions of Interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section 2). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of Principle: Qualitative Analysis of System's Behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing Robustness and Optimizing System's Behavior: Quantitative Analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part 2, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part 3, our results indicated that the system's behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. This result is not surprising. Intuitively, even if SMB system is heterogeneous (because it is composed of two distinct populations of cells), the spatial distributions of both types of cells are uniform; thus, the system evolution is space independent. Nevertheless, we were interested in checking the property using models and simulations. In fact this led us to use and develop original techniques (like [[Paris/Cell_auto_2|Delaunay triangulation]] or [[Paris/Stochastic_model|extended to nested membranes systems Gillespie algorithm]]). From a general point of view, developing such techniques is also of great interest for synthetic biology. Following the concepts of decoupling and abstraction that characterize biosynthetic developments, we have to ideally validate and study designs before constructing them physically. These validations appear at each step of a standard development, at the levels of systems, devices and brick designing. We tried to follow and contribute this methodology by considering at first a phenomenological and global model, and a stochastic and molecules scaled model at last.<br />
<br />
We would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of MGS and Biocham programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/SourcesParis/Sources2007-10-26T21:48:03Z<p>Spicher: /* Biocham Modelling */</p>
<hr />
<div>{{Paris_menu_modeling}}<br><br />
<br />
=Cellular Automaton for DAP Diffusion=<br />
<code><pre><br />
!include "gbviewOutput.mgs" ;;<br />
<br />
N := 30;;<br />
<br />
gbf grille = <nord, est ; 30 * nord, 30 * est><br />
and record Bact = { DAP:float, DAPe:float }<br />
and record BactG = Bact + { bactG }<br />
and record BactS = Bact + { bactS} ;;<br />
<br />
fun iota_v(v,n) = map((\x.v), iota(n,seq:())) ;;<br />
fun new_grid(v) = iota_v(iota_v(v,N), N) following |nord>, |est> ;;<br />
<br />
fun majBactG[DAPexport = 0.2, DAPimport = 0.2, DAPconso= 1, SupDiff = 2.4, InfDiff = 2.02 ](x) = <br />
if ( ( x.DAP > InfDiff ) & ( x.DAP < SupDiff ) & (random(1) < 0.8) ) then<br />
{DAP = x.DAP , DAPe = x.DAPe, bactS} else<br />
let dap = if x.DAP - DAPconso > 0 then x.DAP - DAPconso else 0 fi<br />
and dape= x.DAPe<br />
in if dap > dape then <br />
x + {DAP = dap - DAPexport * dap, DAPe = dape + DAPexport * dap }<br />
else x + {DAP = dap + DAPimport * dape, DAPe = dape - DAPimport * dape }<br />
fi<br />
fi <br />
;;<br />
<br />
fun majBactS[DAPexport = 0.2, DAPimport = 0.2, DAPprod=10](x) = <br />
let dap = x.DAP + DAPprod<br />
and dape= x.DAPe<br />
in if dap > dape then <br />
x + {DAP = dap - DAPexport * dap, DAPe = dape + DAPexport * dap }<br />
else x + {DAP = dap + DAPimport * dape, DAPe = dape - DAPimport * dape }<br />
fi<br />
<br />
;;<br />
<br />
<br />
trans evol[Delta_t=0.1,DAPeDiff=1, DAPeDegrad = 0.2] = {<br />
<br />
<br />
<br />
(* production of DAP *)<br />
x:BactS => ( <br />
let d = neighborsfold(<br />
(\y.\acc.( DAPeDiff*Delta_t*(y.DAPe-x.DAPe) + acc)),<br />
x.DAPe,<br />
x)<br />
in majBactS( x + {DAPe = if ( d - DAPeDegrad * x.DAPe) > 0 then d - DAPeDegrad * x.DAPe else 0 fi } )<br />
);<br />
<br />
(* Diffirentiation and Consumption *)<br />
x:BactG => ( <br />
let d = neighborsfold(<br />
(\y.\acc.( DAPeDiff*Delta_t*(y.DAPe-x.DAPe) + acc)),<br />
x.DAPe,<br />
x)<br />
in majBactG(x + {DAPe = if ( d - DAPeDegrad * x.DAPe) > 0 then d - DAPeDegrad * x.DAPe else 0 fi } )<br />
<br />
<br />
)<br />
<br />
} ;;<br />
<br />
<br />
<br />
<br />
<br />
g := new_grid({DAP=6.0, DAPe=3.0, bactG}) ; 0 ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;; <br />
evol[iter=1000,interlude=GBVexport((\v.("DAPe = "+(12 * v.DAPe )+if BactS(v) then ", bactS= 255" else ", bactG = 255"fi )))](g) ;;<br />
</pre></code><br />
<br />
= Cells Spatial Organization =<br />
<br />
==Constant rate of differentiation==<br />
<br />
<code><pre><br />
record MecaBact = {x, y, vx, vy, fx, fy, radius}<br />
and record CellBact = {dap:float, soma:bool}<br />
and record Bact = MecaBact + CellBact;;<br />
<br />
<br />
delaunay(2) D2 = (\e.(e.x, e.y)) ;;<br />
<br />
fun noise(x) = x + 0.0005 - random(0.001) ;;<br />
// --- Mechanistic-------------------------------------------------------<br />
<br />
DT := 0.05;;<br />
K := 1.0;;<br />
MU := 1.8;;<br />
R0_Gm := 0.50;; //germinal cells minmal rayon <br />
R0_G :=0.75;;<br />
R0_S := 1.00;;<br />
<br />
// interaction : the effect of the cells between each others<br />
fun interaction(ref, src) = (<br />
let X = ref.x - src.x<br />
and Y = ref.y - src.y in<br />
let dist = sqrt(X*X+Y*Y) in<br />
let spring = 0.0-K*(dist-(ref.radius+src.radius))/dist in<br />
{fx=X*spring - ref.vx*MU, fy = Y*spring - ref.vy*MU}<br />
) ;;<br />
<br />
fun add_vect(u, v) = { fx = u.fx + v.fx, fy = u.fy + v.fy } ;;<br />
fun sum(x, u, acc) = add_vect(acc, interaction(x,u)) ;;<br />
<br />
<br />
trans Meca = {<br />
e => (<br />
let f = neighborsfold(sum(e), {fx=0,fy=0}, e) in<br />
e+{ x = noise(e.x + DT*e.vx),<br />
y = noise(e.y + DT*e.vy),<br />
vx = e.vx + DT*f.fx,<br />
vy = e.vy + DT*f.fy,<br />
fx = f.fx,<br />
fy = f.fy<br />
}<br />
)<br />
} ;;<br />
<br />
<br />
// --- Growth ------------------------------------------------------<br />
<br />
DIFF := 1.0 ;;<br />
CONS := 10.0 ;;<br />
DiffP := 0.00023 ;; <br />
DeathSP := 0.00001 ;;<br />
DivG := 0.00600 ;;<br />
DEPOT := 15.0 ;; <br />
CroitG :=0.004 ;; <br />
CroitS :=0.007;; <br />
<br />
<br />
//cell division function<br />
fun divide(b) = (<br />
b+{dap= b.dap/2, radius=R0_Gm },<br />
b + {dap= b.dap/2,x=noise(b.x),y=noise(b.y), radius=R0_Gm}<br />
) ;;<br />
<br />
<br />
<br />
trans Evol = {<br />
<br />
x / x.soma => if (random(1.0) <= DeathSP) then <undef> else if ( ( x.radius < R0_S ) & ( random(1.0) < CroitS) ) then x + <br />
{radius = x.radius + (R0_S - R0_G)/4} else x fi fi ; <br />
<br />
x => (<br />
let dap_diff = neighborsfold((\y.\acc.( {dap=DT*DIFF*(y.dap-x.dap) + acc.dap, n=acc.n+1} )), {dap=0.0,n=0}, x) in<br />
let dap' = if (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS >= 0 then (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS else 0 fi in<br />
<br />
if (random(1.0) <= DiffP)<br />
then x + {dap=DEPOT,soma=true,radius=x.radius} //la nouvelle cellule S a la taille de la cellule G dont elle provient<br />
else if x.radius >= R0_G then if ( (random(1.0) <= DivG) & dap'> 1 )then divide(x + {dap=dap'}) else (x + {dap=dap'}) fi<br />
else if random(1.0) < CroitG then x + {radius = x.radius + (R0_G - R0_Gm)/5 , dap=dap' } else x+{dap=dap'} fi fi fi<br />
) <br />
<br />
} ;;<br />
<br />
<br />
<br />
<br />
// --- Visualisation ----------------------------------------------------<br />
<br />
outname := "/tmp/sheet.imo" ;;<br />
outfile := (if (is_opened(outname)) then close(outname) else <undef> fi ; open(outname,1)) ;;<br />
<br />
<br />
<br />
<br />
fun show_cell(e) = (<br />
"\tTranslated { Translation <" + e.x + ", " + e.y + ", " + 0.0 + "> Geometry Sphere { Radius " + e.radius + " Slices 16 <br />
Stacks 16 " + "Color<" + if(e.soma) then 0 + ", " + 1.0 + ", " + 0 else if ((e.dap+0.4)*(0.5+R0_G/e.radius))< 1.0 then <br />
((e.dap+0.4)*(0.5+R0_G/e.radius)) else 1.0 fi+ ", " + 0 + ", " + 0 fi + "> } }"<br />
) ;;<br />
<br />
<br />
<br />
fun show[cpt=0](f, freq, c) = (<br />
cpt := 1 + cpt ;<br />
if (0 == cpt % freq)<br />
then (<br />
stdout << cpt << "\n" ;<br />
print_coll(f,<br />
c,<br />
show_cell,<br />
"Scene a"+cpt+" {\n",<br />
"\n",<br />
"}\nReplace { Show a"+cpt+"}\n\n")<br />
) else <undef> fi ;<br />
c<br />
) ;;<br />
<br />
// --- Etat initial ----------------------------------------------------<br />
<br />
v0 := {vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=14.0,soma=false,radius=R0_Gm} ;;<br />
v1 :={vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=DEPOT,soma=true,radius=R0_S} ;;<br />
pre_init :=<br />
v1+{x = 1.01, y = 1.023, z = 0.101},<br />
v1+{x = 0.07, y = 1.0, z = 0.095},<br />
v1+{x = 1.0, y = 0.01, z = 0.098},<br />
v1+{x = 0.52, y = 0.53, z = 0.1},<br />
v1+{x = 0.01, y = 0.02, z = 0.099},<br />
v0+{x = -0.4, y = 0.02, z = 0.099},<br />
v0+{x = 1.4, y = 0.02, z = 0.099}<br />
;;<br />
<br />
init := Meca[iter=1000](delaunayfy(D2:(), pre_init)) ;;<br />
<br />
//show(outfile, 1, init);;<br />
//system("imoview "+outname);;<br />
<br />
// --- Evolution -------------------------------------------------------<br />
<br />
fun step(sys) = (<br />
Evol(Meca(sys))<br />
) ;;<br />
<br />
step[iter=100000,interlude=show(outfile,10)](init) ;;<br />
<br />
system("./imoview_black "+outname);;<br />
!quit ;;<br />
</pre></code><br />
<br />
==Differentiation DAP dependent==<br />
<br />
<code><pre><br />
record MecaBact = {x, y, vx, vy, fx, fy, radius}<br />
and record CellBact = {dap:float, soma:bool}<br />
and record Bact = MecaBact + CellBact;;<br />
<br />
<br />
delaunay(2) D2 = (\e.(e.x, e.y)) ;;<br />
<br />
fun noise(x) = x + 0.0005 - random(0.001) ;;<br />
// --- Mechanistic-------------------------------------------------------<br />
<br />
DT := 0.05;;<br />
K := 1.0;;<br />
MU := 1.8;;<br />
R0_Gm := 0.50;; //germinal cells minmal rayon <br />
R0_G :=0.75;;<br />
R0_S := 1.00;;<br />
<br />
// interaction : the effect of the cells between each others<br />
fun interaction(ref, src) = (<br />
let X = ref.x - src.x<br />
and Y = ref.y - src.y in<br />
let dist = sqrt(X*X+Y*Y) in<br />
let spring = 0.0-K*(dist-(ref.radius+src.radius))/dist in<br />
{fx=X*spring - ref.vx*MU, fy = Y*spring - ref.vy*MU}<br />
) ;;<br />
<br />
fun add_vect(u, v) = { fx = u.fx + v.fx, fy = u.fy + v.fy } ;;<br />
fun sum(x, u, acc) = add_vect(acc, interaction(x,u)) ;;<br />
<br />
<br />
trans Meca = {<br />
e => (<br />
let f = neighborsfold(sum(e), {fx=0,fy=0}, e) in<br />
e+{ x = noise(e.x + DT*e.vx),<br />
y = noise(e.y + DT*e.vy),<br />
vx = e.vx + DT*f.fx,<br />
vy = e.vy + DT*f.fy,<br />
fx = f.fx,<br />
fy = f.fy<br />
}<br />
)<br />
} ;;<br />
<br />
<br />
// --- Growth -----------------------------------------------------<br />
<br />
<br />
DIFF := 1.0 ;;<br />
CONS := 10.0 ;;<br />
DiffP := 0.005 ;;<br />
DeathSP := 0.00001 ;;<br />
DivG := 0.00300 ;;<br />
DEPOT := 16 ;;<br />
CroitG :=0.002 ;; re<br />
CroitS :=0.007;; <br />
<br />
fun divide(b) = (<br />
b+{dap= b.dap/2, radius=R0_Gm },<br />
b + {dap= b.dap/2,x=noise(b.x),y=noise(b.y), radius=R0_Gm}<br />
) ;;<br />
<br />
<br />
<br />
trans Evol = {<br />
<br />
x / x.soma => if (random(1.0) <= DeathSP) then <undef> else if ( ( x.radius < R0_S ) & ( random(1.0) < CroitS) ) then x + {radius<br />
= x.radius + (R0_S - R0_G)/4} else x fi fi ; r)<br />
<br />
x => (<br />
let dap_diff = neighborsfold((\y.\acc.( {dap=DT*DIFF*(y.dap-x.dap) + acc.dap, n=acc.n+1} )), {dap=0.0,n=0}, x) in<br />
let dap' = if (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS >= 0 then (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS else 0 fi in<br />
if (dap'<=0.0)<br />
then (<br />
if (random(1.0) <= DiffP)<br />
then x + {dap=DEPOT,soma=true,radius=x.radius} //la nouvelle cellule S a la taille de la cellule G dont elle provient<br />
else x + {dap=dap'} fi<br />
) else if x.radius >= R0_G then if ( (random(1.0) <= DivG) & dap'> 2 )then divide(x + {dap=dap'}) else (x + {dap=dap'}) fi <br />
else if random(1.0) < CroitG then x + {radius = x.radius + (R0_G - R0_Gm)/5 , dap=dap' } else x+{dap=dap'} fi fi fi <br />
) <br />
} ;;<br />
<br />
<br />
<br />
<br />
// --- Visualisation ----------------------------------------------------<br />
<br />
outname := "/tmp/sheet.imo" ;;<br />
outfile := (if (is_opened(outname)) then close(outname) else <undef> fi ; open(outname,1)) ;;<br />
<br />
<br />
<br />
<br />
fun show_cell(e) = (<br />
"\tTranslated { Translation <" + e.x + ", " + e.y + ", " + 0.0 + "> Geometry Sphere { Radius " + e.radius + " Slices 16 <br />
Stacks 16 " + "Color<" + if(e.soma) then 0 + ", " + 1.0 + ", " + 0 else if ((e.dap+0.4)*(0.5+R0_G/e.radius))< 1.0 then<br />
<br />
((e.dap+0.4)*(0.5+R0_G/e.radius)) else 1.0 fi+ ", " + 0 + ", " + 0 fi + "> } }"<br />
) ;;<br />
<br />
<br />
<br />
fun show[cpt=0](f, freq, c) = (<br />
cpt := 1 + cpt ;<br />
if (0 == cpt % freq)<br />
then (<br />
stdout << cpt << "\n" ;<br />
print_coll(f,<br />
c,<br />
show_cell,<br />
"Scene a"+cpt+" {\n",<br />
"\n",<br />
"}\nReplace { Show a"+cpt+"}\n\n")<br />
) else <undef> fi ;<br />
c<br />
) ;;<br />
<br />
// --- Etat initial ----------------------------------------------------<br />
<br />
v0 := {vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=14.0,soma=false,radius=R0_Gm} ;;<br />
v1 :={vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=DEPOT,soma=true,radius=R0_S} ;;<br />
pre_init :=<br />
v1+{x = 1.01, y = 1.023, z = 0.101},<br />
v1+{x = 0.07, y = 1.0, z = 0.095},<br />
v1+{x = 1.0, y = 0.01, z = 0.098},<br />
v1+{x = 0.52, y = 0.53, z = 0.1},<br />
v1+{x = 0.01, y = 0.02, z = 0.099},<br />
v0+{x = -0.4, y = 0.02, z = 0.099},<br />
v0+{x = 1.4, y = 0.02, z = 0.099}<br />
;;<br />
<br />
init := Meca[iter=1000](delaunayfy(D2:(), pre_init)) ;;<br />
<br />
//show(outfile, 1, init);;<br />
//system("imoview "+outname);;<br />
<br />
// --- Evolution -------------------------------------------------------<br />
<br />
fun step(sys) = (<br />
Evol(Meca(sys))<br />
) ;;<br />
<br />
step[iter=100000,interlude=show(outfile,10)](init) ;;<br />
<br />
system("./imoview_black "+outname);;<br />
!quit ;;<br />
</pre></code><br />
<br />
=Gillespie Based Simulation=<br />
<br />
==Global Variables==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* Global constants *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
Na := 6.0221415e23 ;;<br />
VolumeUnit := 1/Na ;;<br />
fun gamma(V) = V ;; // actually Gamma(V)=V*VolumeUnit*Na, but VolumeUnit has been choosen in such a way that Gamma(V)=V waiting for the right volume (mean volume of a germinal bacterium)<br />
<br />
K_CreD := 0.2 ;; // Cre degradation<br />
K_DAPiD := 0.2 ;; // DAP degradation<br />
K_DAPApI := 0.5 ;; // DAPAp inhibition by DAP<br />
K_DAPApA := 0.1 ;; // DAPAp desinhibition releasing a DAP molecule<br />
K_CreP1 := 1.0 ;; // Cre production (DAPAp not inhibited)<br />
K_CreP2 := 0.001 ;; // Cre production (DAPAp inhibited)<br />
K_Diff := 0.05 ;; // Differentiation<br />
K_DAPiP := 1.0 ;; // DAP production<br />
K_DAPEx := 0.5 ;; // DAP export<br />
K_DAPIm := 1.0 ;; // DAP import<br />
K_DAPeD := 0.1 ;; // DAP degradation<br />
<br />
K_Div := 0.02 ;; // Mitosis rate<br />
K_Death := 0.01 ;; // Death rate<br />
<br />
nb_dape := 0 ;; // Number of DAP molecule in the environment (initial condition)<br />
<br />
fun globals_help() = (<br />
stdout << "\n** Help of the \"global\" module **\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- Na (float): Avogadro number [6.0221415e23]\n\n" ;<br />
stdout << "\t- VolumeUnit (float): mean volume of a bacterium [1/Na]\n\n" ;<br />
stdout << "\t- K_CreD (float): Cre degradation reaction rate in bacteria [0.01]\n\n" ;<br />
stdout << "\t- K_DAPiD (float): DAP degradation reaction rate in bacteria [0.01]\n\n" ;<br />
stdout << "\t- K_DAPApI (float): DAPAp inhibition by DAP [2.0]\n\n" ;<br />
stdout << "\t- K_DAPApA (float): DAPAp re-activation [0.001]\n\n" ;<br />
stdout << "\t- K_CreP1 (float): Cre production with activated DAPAp [0.01]\n\n" ;<br />
stdout << "\t- K_CreP2 (float): Cre production with inhibited DAPAp [0.0]\n\n" ;<br />
stdout << "\t- K_Diff (float): bacteria differentition [0.1]\n\n" ;<br />
stdout << "\t- K_DAPiP (float): DAP production in bacteria [0.5]\n\n" ;<br />
stdout << "\t- K_DAPEx (float): DAP exportation [0.1]\n\n" ;<br />
stdout << "\t- K_DAPIm (float): DAP importation [0.1]\n\n" ;<br />
stdout << "\t- K_DAPeD (float): DAP degradation reaction rate in the environment [1.0]\n\n" ;<br />
<br />
stdout << "Functions\n" ;<br />
stdout << "\t- gamma(V) (float -> float):\n\t\tgamma function for reaction to stochastic constants translation\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Structure==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* State of the system *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* The system is composed of bacteria of different kinds: germinal and somatic *)<br />
(* *)<br />
(* It is modeled by nested multi-sets. The super multi-set corresponds to the environment where *)<br />
(* chemicals and bacteria are diffusing. *)<br />
(* A set of functions is added to memorize the quantity of chemicals in the system in order not *)<br />
(* to evaluate it at each time. *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
<br />
cptCre := 0 ;;<br />
cptDAPe := 0 ;;<br />
cptDAPi := 0.0 ;;<br />
cptDAP := 0 ;;<br />
cptBactS := 0 ;;<br />
cptBactG := 0 ;;<br />
cptBact := 0 ;;<br />
fun incrCre() = (cptCre := cptCre + 1) ;;<br />
fun decrCre() = (cptCre := cptCre - 1) ;;<br />
fun incrDAP() = (cptDAP := cptDAP + 1) ;;<br />
fun decrDAP() = (cptDAP := cptDAP - 1) ;;<br />
fun incrDAPe() = (cptDAPe := cptDAPe + 1) ;;<br />
fun decrDAPe() = (cptDAPe := cptDAPe - 1) ;;<br />
fun incrDAPi() = (cptDAPi := cptDAPi + 1) ;;<br />
fun decrDAPi() = (cptDAPi := cptDAPi - 1) ;;<br />
fun DAPe_DAPi() = (incrDAPi() ; decrDAPe()) ;;<br />
fun DAPi_DAPe() = (incrDAPe() ; decrDAPi()) ;;<br />
fun incrNCre(N) = (cptCre := cptCre + N) ;;<br />
fun decrNCre(N) = (cptCre := cptCre - N) ;;<br />
fun incrNDAP(N) = (cptDAP := cptDAP + N) ;;<br />
fun decrNDAP(N) = (cptDAP := cptDAP - N) ;;<br />
fun incrNDAPe(N) = (cptDAPe := cptDAPe + N) ;;<br />
fun decrNDAPe(N) = (cptDAPe := cptDAPe - N) ;;<br />
fun incrNDAPi(N) = (cptDAPi := cptDAPi + N) ;;<br />
fun decrNDAPi(N) = (cptDAPi := cptDAPi - N) ;;<br />
<br />
fun incrBact() = (cptBact := cptBact + 1) ;;<br />
fun decrBact() = (cptBact := cptBact - 1) ;;<br />
fun incrBactS() = (cptBactS := cptBactS + 1) ;;<br />
fun decrBactS() = (cptBactS := cptBactS - 1) ;;<br />
fun incrBactG() = (cptBactG := cptBactG + 1) ;;<br />
fun decrBactG() = (cptBactG := cptBactG - 1) ;;<br />
fun BactS_BactG() = (raise (`Erreur "Impossible S to G differentiation.")) ;;<br />
fun BactG_BactS() = (incrBactS() ; decrBactG()) ;;<br />
fun incrNBact(N) = (cptBact := cptBact + N) ;;<br />
fun decrNBact(N) = (cptBact := cptBact - N) ;;<br />
fun incrNBactS(N) = (cptBactS := cptBactS + N) ;;<br />
fun decrNBactS(N) = (cptBactS := cptBactS - N) ;;<br />
fun incrNBactG(N) = (cptBactG := cptBactG + N) ;;<br />
fun decrNBactG(N) = (cptBactG := cptBactG - N) ;;<br />
<br />
collection Bact = bag<br />
and constraint BactG = [~`DAP_Box]Bact<br />
and constraint BactS = [~`LOXP_Box && ~`LOXP_Box_Cre]Bact<br />
and collection Env = bag ;;<br />
<br />
id := 0 ;;<br />
fun new_bactId() = (id := id+1 ; id) ;;<br />
fun new_bact(t) = (incrBact() ; Bactify({birth=t, date=0.0, id=new_bactId(), next_state=`Unknown}::seq:()) ) ;;<br />
fun new_bactS(t) = (incrBactS() ; `DAPAp :: `DAP_Box :: new_bact(t)) ;;<br />
fun new_bactG(t) = (incrBactG() ; (*incrDAPi() ; incrDAP() ;*) `DAPAp :: `LOXP_Box :: new_bact(t)) ;;<br />
fun new_env(t, nbG, nbS) = (<br />
incrNDAP(nb_dape) ;<br />
incrNDAPe(nb_dape) ;<br />
let env = fold((\i.\acc.((new_bactG(t))::acc)),Envify(fold((\n.\acc.(`DAP::acc)),seq:(),nb_dape)), nbG) in<br />
fold((\i.\acc.((new_bactS(t))::acc)),env, nbS)<br />
) ;;<br />
fun map_bact(f,env) = (<br />
map((\e.(if Bact(e) then f(e) else e fi)),env) //update_bact<br />
) ;;<br />
<br />
fun divide_bactG(t,b,id) = (<br />
let id' = new_bactId() in<br />
let nbDAP = count(`DAP,b)<br />
and nbCre = count(`Cre,b) in<br />
let bact1_core = Bactify({birth=t, date=0.0, id=id, next_state=`Unknown}::seq:())<br />
and bact2_core = Bactify({birth=t, date=0.0, id=id', next_state=`Unknown}::seq:()) in<br />
let bact1_core = fold((\n.\acc.(`DAP::acc)),bact1_core,nbDAP/2)<br />
and bact2_core = fold((\n.\acc.(`DAP::acc)),bact2_core,nbDAP - nbDAP/2) in<br />
let bact2_core = fold((\n.\acc.(`Cre::acc)),bact2_core,nbCre/2)<br />
and bact1_core = fold((\n.\acc.(`Cre::acc)),bact1_core,nbCre - nbCre/2) in<br />
let bact1_core = if (member(`DAPAp_i,b)) then (`DAPAp_i) else (`DAPAp) fi :: bact1_core<br />
and bact2_core = `DAPAp :: bact2_core in<br />
let bact2_core = if (member(`LOXP_Box_Cre,b)) then (`LOXP_Box_Cre) else (`LOXP_Box) fi :: bact2_core<br />
and bact1_core = `LOXP_Box :: bact1_core in<br />
bact1_core :: bact2_core :: seq:()<br />
) ;;<br />
<br />
fun set_DAPe(N,env) = (<br />
let dDAP = cptDAPe - N in<br />
if (dDAP > 0)<br />
then (<br />
(* cptDAPe > N : trop de DAP *)<br />
cptDAPe := N ;<br />
cptDAP := cptDAP - dDAP ;<br />
diff(env, fold((\n.\acc.(`DAP::acc)),Env:(),dDAP))<br />
)<br />
else (<br />
if (dDAP < 0)<br />
then (<br />
(* cptDAPe < N : pas assez de DAP *)<br />
cptDAPe := N ;<br />
cptDAP := cptDAP - dDAP ;<br />
join(env, fold((\n.\acc.(`DAP::acc)),Env:(),-1*dDAP))<br />
)<br />
else (env) fi<br />
) fi<br />
) ;;<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
fun static_help() = (<br />
stdout << "\n** Help of the \"static\" module **\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- cptCre (cptCre): `Cre counter\n\n" ;<br />
stdout << "\t- cptDAP (cptDAP): `DAP counter\n\n" ;<br />
stdout << "\t- cptDAPe (cptDAPe): `DAP counter (in the environment)\n\n" ;<br />
stdout << "\t- cptDAPi (cptDAPi): `DAP counter (in bacteria)\n\n" ;<br />
stdout << "\t- cptBact (cptBact): bacteria counter\n\n" ;<br />
stdout << "\t- cptBactG (cptBactG): germinal bacteria counter\n\n" ;<br />
stdout << "\t- cptBactS (cptBactS): somatic bacteria counter\n\n" ;<br />
<br />
stdout << "Functions\n" ;<br />
stdout << "\t- incrCre() (unit -> int):\n\t\tincrement cptCre\n\n" ;<br />
stdout << "\t- decrCre() (unit -> int):\n\t\tdecrement cptCre\n\n" ;<br />
stdout << "\t- incrDAP() (unit -> int):\n\t\tincrement cptDAP\n\n" ;<br />
stdout << "\t- decrDAP() (unit -> int):\n\t\tdecrement cptDAP\n\n" ;<br />
stdout << "\t- incrDAPe() (unit -> int):\n\t\tincrement cptDAPe\n\n" ;<br />
stdout << "\t- decrDAPe() (unit -> int):\n\t\tdecrement cptDAPe\n\n" ;<br />
stdout << "\t- incrDAPi() (unit -> int):\n\t\tincrement cptDAPi\n\n" ;<br />
stdout << "\t- decrDAPi() (unit -> int):\n\t\tdecrement cptDAPi\n\n" ;<br />
stdout << "\t- DAPe_DAPi() (unit -> int):\n\t\tdecrement cptDAPe, increment cptDAPi\n\n" ;<br />
stdout << "\t- DAPi_DAPe() (unit -> int):\n\t\tdecrement cptDAPi, increment cptDAPe\n\n" ;<br />
stdout << "\t- incrBact() (unit -> int):\n\t\tincrement cptBact\n\n" ;<br />
stdout << "\t- decrBact() (unit -> int):\n\t\tdecrement cptBact\n\n" ;<br />
stdout << "\t- incrBactG() (unit -> int):\n\t\tincrement cptBactG\n\n" ;<br />
stdout << "\t- decrBactG() (unit -> int):\n\t\tdecrement cptBactG\n\n" ;<br />
stdout << "\t- incrBactS() (unit -> int):\n\t\tincrement cptBactS\n\n" ;<br />
stdout << "\t- decrBactS() (unit -> int):\n\t\tdecrement cptBactS\n\n" ;<br />
stdout << "\t- BactG_BactS() (unit -> int):\n\t\tdecrement cptBactG, increment cptBactS\n\n" ;<br />
<br />
stdout << "\t- new_Bact(t) (float -> Bact):\n\t\tcreate a new bacterium at time t\n\n" ;<br />
stdout << "\t- new_BactG(t) (float -> BactG):\n\t\tcreate a new germinal bacterium at time t\n\n" ;<br />
stdout << "\t- new_BactS(t) (float -> BactS):\n\t\tcreate a new somatic bacterium at time t\n\n" ;<br />
stdout << "\t- new_env(t,ng,ns) (float * int * int -> Env):\n\t\tcreate a new environment containing ng germinal bacteria and ns somatic bacteria at time t\n\n" ;<br />
stdout << "\t- map_bact(f,env) ((Bact -> Bact) * Env -> Env):\n\t\tapply the function f on each bacterium of env\n\n" ;<br />
stdout << "\t- set_DAPe(N,env) (int * Env -> Env):\n\t\tchange env, cptDAP and cptDAPe to N `DAP\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Scheduling==<br />
<code><pre><br />
constraint schedule = `Empty_SC | schedule_entry<br />
<br />
and record schedule_entry = { date:float, id:int, sc:schedule, rule:int } ;;<br />
<br />
fun schedule_empty() = `Empty_SC ;;<br />
<br />
fun schedule_add_entry(id,date,rule,sc) = (<br />
switch (sc)<br />
case `Empty_SC : {date=date,id=id,rule=rule,sc=sc}<br />
default : (<br />
if (sc.date > date)<br />
then {date=date,id=id,rule=rule,sc=sc}<br />
else {date=sc.date,id=sc.id,rule=sc.rule,sc=schedule_add_entry(id,date,rule,sc.sc)} fi<br />
)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_remove_entry(id,sc) = (<br />
switch (sc)<br />
case `Empty_SC : `Empty_SC<br />
default : (<br />
if (sc.id == id)<br />
then sc.sc<br />
else {date=sc.date,id=sc.id,rule=sc.rule,sc=schedule_remove_entry(id,sc.sc)} fi<br />
)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_size(sc) = (<br />
switch (sc)<br />
case `Empty_SC : 0<br />
default : 1 + schedule_size(sc.sc)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_replace_entry(id,date,rule,sc) = (<br />
switch (sc)<br />
case `Empty_SC : {date=date,id=id,rule=rule,sc=sc}<br />
default : (<br />
if (sc.id == id)<br />
then schedule_add_entry(id,date,rule,sc.sc)<br />
else (<br />
if (sc.date > date)<br />
then {date=date,id=id,rule=rule,sc=schedule_remove_entry(id,sc)}<br />
else {date=sc.date,id=sc.id,rule=sc.rule,sc=schedule_replace_entry(id,date,rule,sc.sc)} fi<br />
) fi<br />
)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_remove_first_entry(sc) = sc.sc ;;<br />
<br />
fun schedule_print(sc) = (<br />
switch (sc)<br />
case `Empty_SC : stdout << "\n"<br />
default : (<br />
stdout << sc.id << "\t(" << sc.rule << ", " << sc.date << ") \n" ;<br />
schedule_print(sc.sc)<br />
)<br />
endswitch<br />
) ;;<br />
<br />
schedule := schedule_empty() ;;<br />
<br />
fun schedule_help() = (<br />
stdout << "\n** Help of the \"schedule\" module **\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- schedule (schedule): the main schedule initilized with value `Empty_SC\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- schedule_empty() (unit -> schedule):\n\t\treturns the empty schedule\n\n" ;<br />
stdout << "\t- schedule_add_entry(id,d,r,sc) (int * float * int * schedule -> schedule):\n\t\tadd an entry in the schedule sc corresponding to the\n\t\tapplication of the rule r on the bacterium id at the date d\n\n" ;<br />
stdout << "\t- schedule_add_entry(id,d,r,sc) (int * float * int * schedule -> schedule):\n\t\treplace (or add if not existing) an entry in the\n\t\tschedule sc corresponding to the application of the rule r on the bacterium id at the date d\n\n" ;<br />
stdout << "\t- schedule_remove_entry(id,sc) (int * schedule -> schedule):\n\t\tremove in sc the first occurence of an event in bacterium id\n\n" ;<br />
stdout << "\t- schedule_remove_first(sc) (schedule -> schedule):\n\t\tremove the first entry of sc\n\n" ;<br />
stdout << "\t- schedule_print(sc) (schedule -> stdout):\n\t\tprint sc\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Dynamics==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* Dynamics of the system *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* It exists two kinds of dynamics. The first is related to the chemical reactions that occur *)<br />
(* everywhere in the system (inside and outside the bacteria + transport of proteins between the *)<br />
(* outside and inside). This parts will be simulated using a sotchastic process based on the *)<br />
(* Gillespie's algorithm. The second part of the dynamics to be modeled corresponds to the *)<br />
(* bacteria behavior like divisions and cells death. In fact, a lot of processes appearing in *)<br />
(* bacteria and belonging to their normal dynamics are skipped/abstracted as functions of the *)<br />
(* chemical state of bacteria. For example, a too high concentration of DAP is lethal ; we *)<br />
(* reprensent this dependance by a function that deletes all bacteria where the threshold is *)<br />
(* exceeded. These behavior functions have to be evaluated after each chemical update. *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
<br />
constraint ruleId = `CreD | `DAPiD | `DAPApI | `DAPApA | `CreP1 | `CreP2 | `Diff1 | `Diff2 | `DAPiP | `DAPEx | `DAPIm | `DAPeD | `Div | `Death | `Unknown ;;<br />
<br />
fun fstOrder(k,v) = k ;;<br />
fun sndOrder(k,v) = k/gamma(v) ;;<br />
<br />
//fun count(p,c) = fold((\e.\acc.(acc + if p(e) then 1 else 0 fi)),0,c) ;;<br />
//fun countAll(p1,p2,c) = fold((\e.\acc.(acc + if p2(e) then count(p1,e) else 0 fi)),0,c) ;;<br />
<br />
<br />
appliedBactRule := `Unkown ;;<br />
trans inBact = {<br />
<br />
(* Chemicals degradation *)<br />
`Cre ={ C = fstOrder(K_CreD,1.0) }=> (appliedBactRule := `CreD ; <undef>) ;<br />
`DAP ={ C = fstOrder(K_DAPiD,1.0) }=> (appliedBactRule := `DAPiD ; <undef>) ;<br />
<br />
(* Promotor activity *)<br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> (appliedBactRule := `DAPApI ; `DAPAp_i) ;<br />
`DAPAp_i ={ C = fstOrder(K_DAPApA,1.0) }=> (appliedBactRule := `DAPApA ; `DAPAp, `DAP) ;<br />
`DAPAp ={ C = \c.(fstOrder(K_CreP1* if (member(`DAP,c)) then 1.0 else 1.0 fi,1.0)) }=> (appliedBactRule := `CreP1 ; `DAPAp, `Cre) ;<br />
`DAPAp_i ={ C = fstOrder(K_CreP2,1.0) }=> (appliedBactRule := `CreP2 ; `DAPAp_i, `Cre) ;<br />
<br />
(* Differentiation *)<br />
`LOXP_Box, `Cre ={ C = sndOrder(2.0*K_Diff,1.0) }=> (appliedBactRule := `Diff1 ; `LOXP_Box_Cre) ;<br />
`LOXP_Box_Cre, `Cre ={ C = sndOrder(K_Diff,1.0) }=> (appliedBactRule := `Diff2 ; `DAP_Box) ;<br />
<br />
(* DAP production (exclusively for somatic cells) *)<br />
`DAP_Box ={ C = fstOrder(K_DAPiP,1.0) }=> (appliedBactRule := `DAPiP ; `DAP_Box, `DAP) ;<br />
<br />
(* DAP externalization *)<br />
`DAP ={ C = fstOrder(K_DAPEx,1.0) }=> (appliedBactRule := `DAPEx ; return(`DAP :: (diff(self,`DAP)) :: seq:())) ;<br />
<br />
} ;;<br />
<br />
appliedEnvRule := `Unkown ;;<br />
nbReleasedDAP := 0 ;;<br />
deadBactId := -1 ;;<br />
trans inEnv[upBact,current_t,current_sc] = {<br />
<br />
(* DAP internalization *)<br />
`DAP, b:Bact ={ A = (\c.(sndOrder(K_DAPIm,1.0) * cptDAPe * cptBact)) }=> (appliedEnvRule := `DAPIm ; (upBact(current_sc,(`DAP :: b))) ) ;<br />
<br />
(* DAP external degradation *)<br />
`DAP ={ C = fstOrder(K_DAPeD,1.0) }=> (appliedEnvRule := `DAPeD ; <undef>) ;<br />
<br />
(* BactS death *)<br />
(x:BactS \/ {id=id}) as b ={ A = (\c.(fstOrder(K_Death,1.0)*cptBactS)) }=> (<br />
let nbDAP = count(`DAP,b) in<br />
nbReleasedDAP := nbDAP ;<br />
appliedEnvRule := `Death ;<br />
deadBactId := id ;<br />
map((\e.(`DAP)),iota(nbDAP,seq:()))<br />
) ;<br />
<br />
(* BactG mitosis *)<br />
(_:BactG \/ ({id=id})) as b ={ A = (\c.(fstOrder(K_Div,1.0)*cptBactG)) }=> (<br />
appliedEnvRule := `Div ;<br />
let b1b2 = divide_bactG(current_t+'tau,b,id) in<br />
let b1 = upBact(current_sc,b1b2.(0)) in<br />
let b2 = upBact(schedule,b1b2.(1)) in<br />
b1 :: (b2 :: seq:())<br />
) ;<br />
<br />
} ;;<br />
<br />
fun cptUpdate[nbRD](r) = ( // Stochiometric update for the output<br />
switch (r)<br />
case `CreD: decrCre()<br />
case `DAPiD: (decrDAPi() ; decrDAP())<br />
case `DAPApI: (decrDAPi() ; decrDAP())<br />
case `DAPApA: (incrDAPi() ; incrDAP())<br />
case `CreP1: incrCre()<br />
case `CreP2: incrCre()<br />
case `Diff1: decrCre()<br />
case `Diff2: (decrCre(); BactG_BactS())<br />
case `DAPiP: (incrDAPi() ; incrDAP())<br />
case `DAPEx: DAPi_DAPe()<br />
case `DAPIm: DAPe_DAPi()<br />
case `DAPeD: (decrDAPe() ; decrDAP())<br />
case `Death: (decrNDAPi(nbRD) ; incrNDAPe(nbRD) ; decrBactS() ; decrBact())<br />
case `Div: (incrBactG() ; incrBact())<br />
default: raise (`Erreur ("Diet_coli: Not yet implemented: rule "+r))<br />
endswitch<br />
) ;;<br />
<br />
<br />
<br />
<br />
<br />
fun dynamic_help() = (<br />
stdout << "\n** Help of the \"dynamic\" module **\n\n" ;<br />
stdout << "Requirements\n" ;<br />
stdout << "\t- module \"globals\"\n" ;<br />
stdout << "\t- module \"static\"\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- appliedBactRule (ruleId): takes the id of a rule after the application of inBact [`Ùnknown]\n\n" ;<br />
stdout << "\t- appliedEnvRule (ruleId): takes the id of a rule after the application of inEnv [`Ùnknown]\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- fstOrder(k,v) (float * float -> float):\n\t\tkinetics to stochastic conversion\n\n" ;<br />
stdout << "\t- sndOrder(k,v) (float * float -> float):\n\t\tkinetics to stochastic conversion\n\n" ;<br />
stdout << "\t- sndOrder(k,v) (float * float -> float):\n\t\tkinetics to stochastic conversion\n\n" ;<br />
stdout << "\t- inBact(b) (Bact -> Bact | `DAP*Bact):\n\t\tchemical reactions in bacteria ; to be applied with strategy `gillespie\n\n" ;<br />
stdout << "\t- inEnv[update_bact(Bact -> Bact)](e) (Env -> Env):\n\t\tchemical reactions in environment ; the option update_bact is to update the state of a bacterium modified by the application of the rule\n\n" ;<br />
stdout << "\t- cptUpdate(r) (ruleId -> unit):\n\t\tupdate of the global counters from \"static\" w.r.t. the applied rule r\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==ExtSSA==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* System evolution algorithm *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* The model is a one depth level P system. Our alogrithm consists in applying the gillespie SSA *)<br />
(* on each bacterium. A bacterium contains the current state together with the next step and the *)<br />
(* corresponding reaction delay. The SSA is applied on the environment providing a reaction time. *)<br />
(* The evolution is done where the delay is the smallest. *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
<br />
trans no_next_state = { { next_state } as x => x + { next_state = `Unknown, date=0.0 } } ;;<br />
<br />
trans update_bact[t,sc] = {<br />
{ id=id } as x => (<br />
let date = 0.0 in<br />
let nx_state = inBact[strategy=`gillespie,<br />
postlude=(\c.(date := t+'tau ; c)),<br />
iter=1](no_next_state(self))<br />
in<br />
schedule := schedule_replace_entry(id,date,appliedBactRule,sc) ;<br />
appliedBactRule := `Unkown ;<br />
x + { date=date, next_state = nx_state }<br />
)<br />
} ;;<br />
<br />
trans evolve_bact[t,sc,idEv] = {<br />
((b:Bact \/ ({id=x,next_state=nxs}))) as bb / (idEv == x) => (<br />
if (Bact(nxs))<br />
then update_bact[t=t,sc=sc](nxs)<br />
else (nxs.(0)::(update_bact[t=t,sc=sc](nxs.(1)) :: seq:())) fi<br />
)<br />
} ;;<br />
<br />
fun step[get_global_time,set_global_time,sc](env) = (<br />
t := get_global_time() ;<br />
let date' = 0.0 in<br />
let env' = inEnv[upBact=(\sc.\x.(let t' = t+'tau in update_bact[t=t',sc=sc,strategy=`default](x))),<br />
current_t = t,<br />
current_sc = sc,<br />
strategy=`gillespie,<br />
postlude=(\c.(date' := t + 'tau ; c)),<br />
iter=1](env)<br />
in<br />
//!! (stdout << "schedule.date=" << schedule.date << " > date'=" << date' << "\n" ; (date' == infinity) || (date' < schedule.date)) ;<br />
if (date' < sc.date)<br />
then (<br />
//stdout << "envionment evolution (applied rule = " << appliedEnvRule << "(" << nbReleasedDAP << "), date = " << date' << "(" << t << "))\n" ;<br />
cptUpdate[nbRD=nbReleasedDAP](appliedEnvRule) ;<br />
schedule := if (appliedEnvRule==`Death) then schedule_remove_entry(deadBactId,schedule) else schedule fi ;<br />
nbReleasedDAP := 0 ;<br />
deadBactId := -1 ;<br />
appliedEnvRule := `Unkown<br />
)<br />
else (<br />
//stdout << "bacterium evolution (id = " << sc.id << ", applied rule = " << sc.rule << ", date = " << sc.date << "(" << t << "))\n" ;<br />
cptUpdate(sc.rule) ;<br />
nbReleasedDAP := 0 ;<br />
deadBactId := -1 ;<br />
appliedEnvRule := `Unkown ;<br />
date' := sc.date ;<br />
env' := evolve_bact[strategy=`asynchronous,sc=sc,idEv=sc.id,t=date'](env)<br />
) fi ;<br />
//stdout << env' << "\n" ;<br />
sc := schedule ;<br />
set_global_time(date') ;<br />
env'<br />
) ;;<br />
<br />
<br />
fun evol_algo_help() = (<br />
stdout << "\n** Help of the \"evol_algo\" module **\n\n" ;<br />
stdout << "Requirements\n" ;<br />
stdout << "\t- module \"schedule\"\n" ;<br />
stdout << "\t- module \"dynamic\"\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- update_bact[t=t(float),sc=sc(schedule)](b) (Bact -> Bact):\n\t\tcompute the next Gillespie step of a bacterium b. The schedule sc is updated and the new value of sc is returned in the global variable schedule. The option t has to be set to the global date.\n\n" ;<br />
stdout << "\t- evolve_bact[t=t(float),sc=sc(schedule),idEv=id(int)](env) (Env -> Env):\n\t\tmake the bacterium with identifiant id evolve. The schedule sc is updated and the new value of sc is returned in the global variable schedule. The option t has to be set to the global date.\n\n" ;<br />
stdout << "\t- step[t=t(float),sc=sc(schedule)](env) (Env -> Env):\n\t\tOne step evolution of the whole system. The earliest event is applied in the environment env w.r.t. the schedule sc. The option t has to be set to the global date.\n\n"<br />
<br />
) ;;<br />
</pre></code><br />
<br />
==Output for Gnuplot==<br />
<code><pre><br />
GPoutput := "/tmp/sortie.dat" ;;<br />
PNGoutput := "/tmp/sortie.png" ;;<br />
gnuplot := "/usr/bin/gnuplot" ;;<br />
<br />
fun export_cpt[get_global_time](freq, env) = (<br />
if (('iteration % freq) == 0)<br />
then (<br />
let tg = get_global_time() in<br />
GPoutput << get_global_time() << "\t" <<<br />
cptCre << "\t" <<<br />
cptDAP << "\t" <<<br />
cptDAPe << "\t" <<<br />
(cptDAPi/cptBact) << "\t" <<<br />
cptBact << "\t" <<<br />
cptBactS << "\t" <<<br />
cptBactG << "\n" ;<br />
stdout << "Iteration: " << 'iteration << " and Global time: " << tg << " and bacteria population: " << cptBact << " (G/S = " << cptBactG << "/" << cptBactS << ")\n"<br />
)<br />
else <undef> fi ;<br />
env<br />
) ;;<br />
<br />
fun dataToPng() = (<br />
gnuplot << "set key outside\n";<br />
gnuplot << "set xlabel \"Time (arbitrary unit)\"\n";<br />
gnuplot << "set ylabel \"Number of molecules or structures\"\n";<br />
gnuplot << "set output \""+ PNGoutput + "\"\n";<br />
gnuplot << "set term png\n";<br />
<br />
gnuplot << "plot " +<br />
"\""+ GPoutput +"\" using 1:4 title ' DAPe' with lines 3," +<br />
"\""+ GPoutput +"\" using 1:5 title ' DAPi' with lines 4," +<br />
"\""+ GPoutput +"\" using 1:6 title ' Bact' with lines 5," +<br />
"\""+ GPoutput +"\" using 1:7 title ' BactS' with lines 6," +<br />
"\""+ GPoutput +"\" using 1:8 title ' BactG' with lines 7" +<br />
"" ;<br />
gnuplot << "\nquit" ;<br />
gnuplot << "\n"<br />
<br />
) ;;<br />
<br />
fun dataToPngDAP() = (<br />
gnuplot << "set key outside\n";<br />
gnuplot << "set xlabel \"Time (arbitrary unit)\"\n";<br />
gnuplot << "set ylabel \"Number of molecules or structures\"\n";<br />
gnuplot << "set output \""+ PNGoutput + "\"\n";<br />
gnuplot << "set term png\n";<br />
<br />
gnuplot << "plot " +<br />
"\""+ GPoutput +"\" using 1:5 title ' DAPi' with lines 4" +<br />
"" ;<br />
gnuplot << "\nquit" ;<br />
gnuplot << "\n"<br />
<br />
) ;;<br />
<br />
fun dataToPngBact() = (<br />
gnuplot << "set key outside\n";<br />
gnuplot << "set xlabel \"Time (arbitrary unit)\"\n";<br />
gnuplot << "set ylabel \"Number of molecules or structures\"\n";<br />
gnuplot << "set output \""+ PNGoutput + "\"\n";<br />
gnuplot << "set term png\n";<br />
<br />
gnuplot << "plot " +<br />
"\""+ GPoutput +"\" using 1:6 title ' Bact' with lines 5," +<br />
"\""+ GPoutput +"\" using 1:7 title ' BactS' with lines 6," +<br />
"\""+ GPoutput +"\" using 1:8 title ' BactG' with lines 7" +<br />
"" ;<br />
gnuplot << "\nquit" ;<br />
gnuplot << "\n"<br />
<br />
) ;;<br />
<br />
fun output_help() = (<br />
stdout << "\n** Help of the \"output\" module **\n\n" ;<br />
stdout << "Requirements\n" ;<br />
stdout << "\t- module \"static\"\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- GPoutput (string): Gnuplot formatted output file [\"/tmp/sortie.dat\"]\n\n" ;<br />
stdout << "\t- PNGoutput (string): PNG file for Gnuplot exporting (see function dataToPng) [\"/tmp/sortie.png\"]\n\n" ;<br />
stdout << "\t- gnuplot (string): absolute path to Gnuplot executable [\"/usr/bin/gnuplot\"]\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- export_cpt[get_global_time](freq, env) (int * Env -> Env):\n\t\tExport in GPoutput the state of global module counters (to be used as interlude of an iterated function)\n\n" ;<br />
stdout << "\t- dataToPng() (unit -> unit):\n\t\texport GPoutput to the PNG file PNGoutput using Gnuplot (located at path gnuplot)\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Main program==<br />
<code><pre><br />
!set match_random := 100 ;;<br />
<br />
duration := 1500.0 ;;<br />
gt := 0.0 ;; //global time<br />
fun ggt() = gt ;; //global time set and get function... an assert is used to check that time only increases<br />
fun sgt(x) = (!! (gt <= x) ; gt := x) ;;<br />
<br />
!include "globals.mgs" ;;<br />
!include "static.mgs" ;;<br />
!include "schedule.mgs" ;;<br />
!include "dynamic.mgs" ;;<br />
!include "evol_algo.mgs" ;;<br />
!include "output.mgs" ;;<br />
<br />
schedule := schedule_empty() ;;<br />
<br />
env := map_bact((\b.(update_bact[t=gt,sc=schedule](b))),new_env(gt,10,0)) ;;<br />
<br />
step[fixpoint=(\c1.\c2.(gt > duration || cptBact == 0)), interlude=B(export_cpt[get_global_time=ggt](10),I(*set_DAPe(nb_dape)*)), sc=schedule, get_global_time=ggt, set_global_time=sgt](env) ;;<br />
<br />
dataToPng() ;;<br />
</pre></code><br />
<br />
<br />
= Biocham Modelling =<br />
[http://biosynthetique.free.fr/model/AMFI.xml Here] is available the source code of the Biocham based model. This XML formatted file can be imported by the [http://contraintes.inria.fr/BIOCHAM/ Biocham executable].</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/SourcesParis/Sources2007-10-26T21:47:05Z<p>Spicher: /* Main program */</p>
<hr />
<div>{{Paris_menu_modeling}}<br><br />
<br />
=Cellular Automaton for DAP Diffusion=<br />
<code><pre><br />
!include "gbviewOutput.mgs" ;;<br />
<br />
N := 30;;<br />
<br />
gbf grille = <nord, est ; 30 * nord, 30 * est><br />
and record Bact = { DAP:float, DAPe:float }<br />
and record BactG = Bact + { bactG }<br />
and record BactS = Bact + { bactS} ;;<br />
<br />
fun iota_v(v,n) = map((\x.v), iota(n,seq:())) ;;<br />
fun new_grid(v) = iota_v(iota_v(v,N), N) following |nord>, |est> ;;<br />
<br />
fun majBactG[DAPexport = 0.2, DAPimport = 0.2, DAPconso= 1, SupDiff = 2.4, InfDiff = 2.02 ](x) = <br />
if ( ( x.DAP > InfDiff ) & ( x.DAP < SupDiff ) & (random(1) < 0.8) ) then<br />
{DAP = x.DAP , DAPe = x.DAPe, bactS} else<br />
let dap = if x.DAP - DAPconso > 0 then x.DAP - DAPconso else 0 fi<br />
and dape= x.DAPe<br />
in if dap > dape then <br />
x + {DAP = dap - DAPexport * dap, DAPe = dape + DAPexport * dap }<br />
else x + {DAP = dap + DAPimport * dape, DAPe = dape - DAPimport * dape }<br />
fi<br />
fi <br />
;;<br />
<br />
fun majBactS[DAPexport = 0.2, DAPimport = 0.2, DAPprod=10](x) = <br />
let dap = x.DAP + DAPprod<br />
and dape= x.DAPe<br />
in if dap > dape then <br />
x + {DAP = dap - DAPexport * dap, DAPe = dape + DAPexport * dap }<br />
else x + {DAP = dap + DAPimport * dape, DAPe = dape - DAPimport * dape }<br />
fi<br />
<br />
;;<br />
<br />
<br />
trans evol[Delta_t=0.1,DAPeDiff=1, DAPeDegrad = 0.2] = {<br />
<br />
<br />
<br />
(* production of DAP *)<br />
x:BactS => ( <br />
let d = neighborsfold(<br />
(\y.\acc.( DAPeDiff*Delta_t*(y.DAPe-x.DAPe) + acc)),<br />
x.DAPe,<br />
x)<br />
in majBactS( x + {DAPe = if ( d - DAPeDegrad * x.DAPe) > 0 then d - DAPeDegrad * x.DAPe else 0 fi } )<br />
);<br />
<br />
(* Diffirentiation and Consumption *)<br />
x:BactG => ( <br />
let d = neighborsfold(<br />
(\y.\acc.( DAPeDiff*Delta_t*(y.DAPe-x.DAPe) + acc)),<br />
x.DAPe,<br />
x)<br />
in majBactG(x + {DAPe = if ( d - DAPeDegrad * x.DAPe) > 0 then d - DAPeDegrad * x.DAPe else 0 fi } )<br />
<br />
<br />
)<br />
<br />
} ;;<br />
<br />
<br />
<br />
<br />
<br />
g := new_grid({DAP=6.0, DAPe=3.0, bactG}) ; 0 ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;; <br />
evol[iter=1000,interlude=GBVexport((\v.("DAPe = "+(12 * v.DAPe )+if BactS(v) then ", bactS= 255" else ", bactG = 255"fi )))](g) ;;<br />
</pre></code><br />
<br />
= Cells Spatial Organization =<br />
<br />
==Constant rate of differentiation==<br />
<br />
<code><pre><br />
record MecaBact = {x, y, vx, vy, fx, fy, radius}<br />
and record CellBact = {dap:float, soma:bool}<br />
and record Bact = MecaBact + CellBact;;<br />
<br />
<br />
delaunay(2) D2 = (\e.(e.x, e.y)) ;;<br />
<br />
fun noise(x) = x + 0.0005 - random(0.001) ;;<br />
// --- Mechanistic-------------------------------------------------------<br />
<br />
DT := 0.05;;<br />
K := 1.0;;<br />
MU := 1.8;;<br />
R0_Gm := 0.50;; //germinal cells minmal rayon <br />
R0_G :=0.75;;<br />
R0_S := 1.00;;<br />
<br />
// interaction : the effect of the cells between each others<br />
fun interaction(ref, src) = (<br />
let X = ref.x - src.x<br />
and Y = ref.y - src.y in<br />
let dist = sqrt(X*X+Y*Y) in<br />
let spring = 0.0-K*(dist-(ref.radius+src.radius))/dist in<br />
{fx=X*spring - ref.vx*MU, fy = Y*spring - ref.vy*MU}<br />
) ;;<br />
<br />
fun add_vect(u, v) = { fx = u.fx + v.fx, fy = u.fy + v.fy } ;;<br />
fun sum(x, u, acc) = add_vect(acc, interaction(x,u)) ;;<br />
<br />
<br />
trans Meca = {<br />
e => (<br />
let f = neighborsfold(sum(e), {fx=0,fy=0}, e) in<br />
e+{ x = noise(e.x + DT*e.vx),<br />
y = noise(e.y + DT*e.vy),<br />
vx = e.vx + DT*f.fx,<br />
vy = e.vy + DT*f.fy,<br />
fx = f.fx,<br />
fy = f.fy<br />
}<br />
)<br />
} ;;<br />
<br />
<br />
// --- Growth ------------------------------------------------------<br />
<br />
DIFF := 1.0 ;;<br />
CONS := 10.0 ;;<br />
DiffP := 0.00023 ;; <br />
DeathSP := 0.00001 ;;<br />
DivG := 0.00600 ;;<br />
DEPOT := 15.0 ;; <br />
CroitG :=0.004 ;; <br />
CroitS :=0.007;; <br />
<br />
<br />
//cell division function<br />
fun divide(b) = (<br />
b+{dap= b.dap/2, radius=R0_Gm },<br />
b + {dap= b.dap/2,x=noise(b.x),y=noise(b.y), radius=R0_Gm}<br />
) ;;<br />
<br />
<br />
<br />
trans Evol = {<br />
<br />
x / x.soma => if (random(1.0) <= DeathSP) then <undef> else if ( ( x.radius < R0_S ) & ( random(1.0) < CroitS) ) then x + <br />
{radius = x.radius + (R0_S - R0_G)/4} else x fi fi ; <br />
<br />
x => (<br />
let dap_diff = neighborsfold((\y.\acc.( {dap=DT*DIFF*(y.dap-x.dap) + acc.dap, n=acc.n+1} )), {dap=0.0,n=0}, x) in<br />
let dap' = if (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS >= 0 then (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS else 0 fi in<br />
<br />
if (random(1.0) <= DiffP)<br />
then x + {dap=DEPOT,soma=true,radius=x.radius} //la nouvelle cellule S a la taille de la cellule G dont elle provient<br />
else if x.radius >= R0_G then if ( (random(1.0) <= DivG) & dap'> 1 )then divide(x + {dap=dap'}) else (x + {dap=dap'}) fi<br />
else if random(1.0) < CroitG then x + {radius = x.radius + (R0_G - R0_Gm)/5 , dap=dap' } else x+{dap=dap'} fi fi fi<br />
) <br />
<br />
} ;;<br />
<br />
<br />
<br />
<br />
// --- Visualisation ----------------------------------------------------<br />
<br />
outname := "/tmp/sheet.imo" ;;<br />
outfile := (if (is_opened(outname)) then close(outname) else <undef> fi ; open(outname,1)) ;;<br />
<br />
<br />
<br />
<br />
fun show_cell(e) = (<br />
"\tTranslated { Translation <" + e.x + ", " + e.y + ", " + 0.0 + "> Geometry Sphere { Radius " + e.radius + " Slices 16 <br />
Stacks 16 " + "Color<" + if(e.soma) then 0 + ", " + 1.0 + ", " + 0 else if ((e.dap+0.4)*(0.5+R0_G/e.radius))< 1.0 then <br />
((e.dap+0.4)*(0.5+R0_G/e.radius)) else 1.0 fi+ ", " + 0 + ", " + 0 fi + "> } }"<br />
) ;;<br />
<br />
<br />
<br />
fun show[cpt=0](f, freq, c) = (<br />
cpt := 1 + cpt ;<br />
if (0 == cpt % freq)<br />
then (<br />
stdout << cpt << "\n" ;<br />
print_coll(f,<br />
c,<br />
show_cell,<br />
"Scene a"+cpt+" {\n",<br />
"\n",<br />
"}\nReplace { Show a"+cpt+"}\n\n")<br />
) else <undef> fi ;<br />
c<br />
) ;;<br />
<br />
// --- Etat initial ----------------------------------------------------<br />
<br />
v0 := {vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=14.0,soma=false,radius=R0_Gm} ;;<br />
v1 :={vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=DEPOT,soma=true,radius=R0_S} ;;<br />
pre_init :=<br />
v1+{x = 1.01, y = 1.023, z = 0.101},<br />
v1+{x = 0.07, y = 1.0, z = 0.095},<br />
v1+{x = 1.0, y = 0.01, z = 0.098},<br />
v1+{x = 0.52, y = 0.53, z = 0.1},<br />
v1+{x = 0.01, y = 0.02, z = 0.099},<br />
v0+{x = -0.4, y = 0.02, z = 0.099},<br />
v0+{x = 1.4, y = 0.02, z = 0.099}<br />
;;<br />
<br />
init := Meca[iter=1000](delaunayfy(D2:(), pre_init)) ;;<br />
<br />
//show(outfile, 1, init);;<br />
//system("imoview "+outname);;<br />
<br />
// --- Evolution -------------------------------------------------------<br />
<br />
fun step(sys) = (<br />
Evol(Meca(sys))<br />
) ;;<br />
<br />
step[iter=100000,interlude=show(outfile,10)](init) ;;<br />
<br />
system("./imoview_black "+outname);;<br />
!quit ;;<br />
</pre></code><br />
<br />
==Differentiation DAP dependent==<br />
<br />
<code><pre><br />
record MecaBact = {x, y, vx, vy, fx, fy, radius}<br />
and record CellBact = {dap:float, soma:bool}<br />
and record Bact = MecaBact + CellBact;;<br />
<br />
<br />
delaunay(2) D2 = (\e.(e.x, e.y)) ;;<br />
<br />
fun noise(x) = x + 0.0005 - random(0.001) ;;<br />
// --- Mechanistic-------------------------------------------------------<br />
<br />
DT := 0.05;;<br />
K := 1.0;;<br />
MU := 1.8;;<br />
R0_Gm := 0.50;; //germinal cells minmal rayon <br />
R0_G :=0.75;;<br />
R0_S := 1.00;;<br />
<br />
// interaction : the effect of the cells between each others<br />
fun interaction(ref, src) = (<br />
let X = ref.x - src.x<br />
and Y = ref.y - src.y in<br />
let dist = sqrt(X*X+Y*Y) in<br />
let spring = 0.0-K*(dist-(ref.radius+src.radius))/dist in<br />
{fx=X*spring - ref.vx*MU, fy = Y*spring - ref.vy*MU}<br />
) ;;<br />
<br />
fun add_vect(u, v) = { fx = u.fx + v.fx, fy = u.fy + v.fy } ;;<br />
fun sum(x, u, acc) = add_vect(acc, interaction(x,u)) ;;<br />
<br />
<br />
trans Meca = {<br />
e => (<br />
let f = neighborsfold(sum(e), {fx=0,fy=0}, e) in<br />
e+{ x = noise(e.x + DT*e.vx),<br />
y = noise(e.y + DT*e.vy),<br />
vx = e.vx + DT*f.fx,<br />
vy = e.vy + DT*f.fy,<br />
fx = f.fx,<br />
fy = f.fy<br />
}<br />
)<br />
} ;;<br />
<br />
<br />
// --- Growth -----------------------------------------------------<br />
<br />
<br />
DIFF := 1.0 ;;<br />
CONS := 10.0 ;;<br />
DiffP := 0.005 ;;<br />
DeathSP := 0.00001 ;;<br />
DivG := 0.00300 ;;<br />
DEPOT := 16 ;;<br />
CroitG :=0.002 ;; re<br />
CroitS :=0.007;; <br />
<br />
fun divide(b) = (<br />
b+{dap= b.dap/2, radius=R0_Gm },<br />
b + {dap= b.dap/2,x=noise(b.x),y=noise(b.y), radius=R0_Gm}<br />
) ;;<br />
<br />
<br />
<br />
trans Evol = {<br />
<br />
x / x.soma => if (random(1.0) <= DeathSP) then <undef> else if ( ( x.radius < R0_S ) & ( random(1.0) < CroitS) ) then x + {radius<br />
= x.radius + (R0_S - R0_G)/4} else x fi fi ; r)<br />
<br />
x => (<br />
let dap_diff = neighborsfold((\y.\acc.( {dap=DT*DIFF*(y.dap-x.dap) + acc.dap, n=acc.n+1} )), {dap=0.0,n=0}, x) in<br />
let dap' = if (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS >= 0 then (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS else 0 fi in<br />
if (dap'<=0.0)<br />
then (<br />
if (random(1.0) <= DiffP)<br />
then x + {dap=DEPOT,soma=true,radius=x.radius} //la nouvelle cellule S a la taille de la cellule G dont elle provient<br />
else x + {dap=dap'} fi<br />
) else if x.radius >= R0_G then if ( (random(1.0) <= DivG) & dap'> 2 )then divide(x + {dap=dap'}) else (x + {dap=dap'}) fi <br />
else if random(1.0) < CroitG then x + {radius = x.radius + (R0_G - R0_Gm)/5 , dap=dap' } else x+{dap=dap'} fi fi fi <br />
) <br />
} ;;<br />
<br />
<br />
<br />
<br />
// --- Visualisation ----------------------------------------------------<br />
<br />
outname := "/tmp/sheet.imo" ;;<br />
outfile := (if (is_opened(outname)) then close(outname) else <undef> fi ; open(outname,1)) ;;<br />
<br />
<br />
<br />
<br />
fun show_cell(e) = (<br />
"\tTranslated { Translation <" + e.x + ", " + e.y + ", " + 0.0 + "> Geometry Sphere { Radius " + e.radius + " Slices 16 <br />
Stacks 16 " + "Color<" + if(e.soma) then 0 + ", " + 1.0 + ", " + 0 else if ((e.dap+0.4)*(0.5+R0_G/e.radius))< 1.0 then<br />
<br />
((e.dap+0.4)*(0.5+R0_G/e.radius)) else 1.0 fi+ ", " + 0 + ", " + 0 fi + "> } }"<br />
) ;;<br />
<br />
<br />
<br />
fun show[cpt=0](f, freq, c) = (<br />
cpt := 1 + cpt ;<br />
if (0 == cpt % freq)<br />
then (<br />
stdout << cpt << "\n" ;<br />
print_coll(f,<br />
c,<br />
show_cell,<br />
"Scene a"+cpt+" {\n",<br />
"\n",<br />
"}\nReplace { Show a"+cpt+"}\n\n")<br />
) else <undef> fi ;<br />
c<br />
) ;;<br />
<br />
// --- Etat initial ----------------------------------------------------<br />
<br />
v0 := {vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=14.0,soma=false,radius=R0_Gm} ;;<br />
v1 :={vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=DEPOT,soma=true,radius=R0_S} ;;<br />
pre_init :=<br />
v1+{x = 1.01, y = 1.023, z = 0.101},<br />
v1+{x = 0.07, y = 1.0, z = 0.095},<br />
v1+{x = 1.0, y = 0.01, z = 0.098},<br />
v1+{x = 0.52, y = 0.53, z = 0.1},<br />
v1+{x = 0.01, y = 0.02, z = 0.099},<br />
v0+{x = -0.4, y = 0.02, z = 0.099},<br />
v0+{x = 1.4, y = 0.02, z = 0.099}<br />
;;<br />
<br />
init := Meca[iter=1000](delaunayfy(D2:(), pre_init)) ;;<br />
<br />
//show(outfile, 1, init);;<br />
//system("imoview "+outname);;<br />
<br />
// --- Evolution -------------------------------------------------------<br />
<br />
fun step(sys) = (<br />
Evol(Meca(sys))<br />
) ;;<br />
<br />
step[iter=100000,interlude=show(outfile,10)](init) ;;<br />
<br />
system("./imoview_black "+outname);;<br />
!quit ;;<br />
</pre></code><br />
<br />
=Gillespie Based Simulation=<br />
<br />
==Global Variables==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* Global constants *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
Na := 6.0221415e23 ;;<br />
VolumeUnit := 1/Na ;;<br />
fun gamma(V) = V ;; // actually Gamma(V)=V*VolumeUnit*Na, but VolumeUnit has been choosen in such a way that Gamma(V)=V waiting for the right volume (mean volume of a germinal bacterium)<br />
<br />
K_CreD := 0.2 ;; // Cre degradation<br />
K_DAPiD := 0.2 ;; // DAP degradation<br />
K_DAPApI := 0.5 ;; // DAPAp inhibition by DAP<br />
K_DAPApA := 0.1 ;; // DAPAp desinhibition releasing a DAP molecule<br />
K_CreP1 := 1.0 ;; // Cre production (DAPAp not inhibited)<br />
K_CreP2 := 0.001 ;; // Cre production (DAPAp inhibited)<br />
K_Diff := 0.05 ;; // Differentiation<br />
K_DAPiP := 1.0 ;; // DAP production<br />
K_DAPEx := 0.5 ;; // DAP export<br />
K_DAPIm := 1.0 ;; // DAP import<br />
K_DAPeD := 0.1 ;; // DAP degradation<br />
<br />
K_Div := 0.02 ;; // Mitosis rate<br />
K_Death := 0.01 ;; // Death rate<br />
<br />
nb_dape := 0 ;; // Number of DAP molecule in the environment (initial condition)<br />
<br />
fun globals_help() = (<br />
stdout << "\n** Help of the \"global\" module **\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- Na (float): Avogadro number [6.0221415e23]\n\n" ;<br />
stdout << "\t- VolumeUnit (float): mean volume of a bacterium [1/Na]\n\n" ;<br />
stdout << "\t- K_CreD (float): Cre degradation reaction rate in bacteria [0.01]\n\n" ;<br />
stdout << "\t- K_DAPiD (float): DAP degradation reaction rate in bacteria [0.01]\n\n" ;<br />
stdout << "\t- K_DAPApI (float): DAPAp inhibition by DAP [2.0]\n\n" ;<br />
stdout << "\t- K_DAPApA (float): DAPAp re-activation [0.001]\n\n" ;<br />
stdout << "\t- K_CreP1 (float): Cre production with activated DAPAp [0.01]\n\n" ;<br />
stdout << "\t- K_CreP2 (float): Cre production with inhibited DAPAp [0.0]\n\n" ;<br />
stdout << "\t- K_Diff (float): bacteria differentition [0.1]\n\n" ;<br />
stdout << "\t- K_DAPiP (float): DAP production in bacteria [0.5]\n\n" ;<br />
stdout << "\t- K_DAPEx (float): DAP exportation [0.1]\n\n" ;<br />
stdout << "\t- K_DAPIm (float): DAP importation [0.1]\n\n" ;<br />
stdout << "\t- K_DAPeD (float): DAP degradation reaction rate in the environment [1.0]\n\n" ;<br />
<br />
stdout << "Functions\n" ;<br />
stdout << "\t- gamma(V) (float -> float):\n\t\tgamma function for reaction to stochastic constants translation\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Structure==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* State of the system *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* The system is composed of bacteria of different kinds: germinal and somatic *)<br />
(* *)<br />
(* It is modeled by nested multi-sets. The super multi-set corresponds to the environment where *)<br />
(* chemicals and bacteria are diffusing. *)<br />
(* A set of functions is added to memorize the quantity of chemicals in the system in order not *)<br />
(* to evaluate it at each time. *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
<br />
cptCre := 0 ;;<br />
cptDAPe := 0 ;;<br />
cptDAPi := 0.0 ;;<br />
cptDAP := 0 ;;<br />
cptBactS := 0 ;;<br />
cptBactG := 0 ;;<br />
cptBact := 0 ;;<br />
fun incrCre() = (cptCre := cptCre + 1) ;;<br />
fun decrCre() = (cptCre := cptCre - 1) ;;<br />
fun incrDAP() = (cptDAP := cptDAP + 1) ;;<br />
fun decrDAP() = (cptDAP := cptDAP - 1) ;;<br />
fun incrDAPe() = (cptDAPe := cptDAPe + 1) ;;<br />
fun decrDAPe() = (cptDAPe := cptDAPe - 1) ;;<br />
fun incrDAPi() = (cptDAPi := cptDAPi + 1) ;;<br />
fun decrDAPi() = (cptDAPi := cptDAPi - 1) ;;<br />
fun DAPe_DAPi() = (incrDAPi() ; decrDAPe()) ;;<br />
fun DAPi_DAPe() = (incrDAPe() ; decrDAPi()) ;;<br />
fun incrNCre(N) = (cptCre := cptCre + N) ;;<br />
fun decrNCre(N) = (cptCre := cptCre - N) ;;<br />
fun incrNDAP(N) = (cptDAP := cptDAP + N) ;;<br />
fun decrNDAP(N) = (cptDAP := cptDAP - N) ;;<br />
fun incrNDAPe(N) = (cptDAPe := cptDAPe + N) ;;<br />
fun decrNDAPe(N) = (cptDAPe := cptDAPe - N) ;;<br />
fun incrNDAPi(N) = (cptDAPi := cptDAPi + N) ;;<br />
fun decrNDAPi(N) = (cptDAPi := cptDAPi - N) ;;<br />
<br />
fun incrBact() = (cptBact := cptBact + 1) ;;<br />
fun decrBact() = (cptBact := cptBact - 1) ;;<br />
fun incrBactS() = (cptBactS := cptBactS + 1) ;;<br />
fun decrBactS() = (cptBactS := cptBactS - 1) ;;<br />
fun incrBactG() = (cptBactG := cptBactG + 1) ;;<br />
fun decrBactG() = (cptBactG := cptBactG - 1) ;;<br />
fun BactS_BactG() = (raise (`Erreur "Impossible S to G differentiation.")) ;;<br />
fun BactG_BactS() = (incrBactS() ; decrBactG()) ;;<br />
fun incrNBact(N) = (cptBact := cptBact + N) ;;<br />
fun decrNBact(N) = (cptBact := cptBact - N) ;;<br />
fun incrNBactS(N) = (cptBactS := cptBactS + N) ;;<br />
fun decrNBactS(N) = (cptBactS := cptBactS - N) ;;<br />
fun incrNBactG(N) = (cptBactG := cptBactG + N) ;;<br />
fun decrNBactG(N) = (cptBactG := cptBactG - N) ;;<br />
<br />
collection Bact = bag<br />
and constraint BactG = [~`DAP_Box]Bact<br />
and constraint BactS = [~`LOXP_Box && ~`LOXP_Box_Cre]Bact<br />
and collection Env = bag ;;<br />
<br />
id := 0 ;;<br />
fun new_bactId() = (id := id+1 ; id) ;;<br />
fun new_bact(t) = (incrBact() ; Bactify({birth=t, date=0.0, id=new_bactId(), next_state=`Unknown}::seq:()) ) ;;<br />
fun new_bactS(t) = (incrBactS() ; `DAPAp :: `DAP_Box :: new_bact(t)) ;;<br />
fun new_bactG(t) = (incrBactG() ; (*incrDAPi() ; incrDAP() ;*) `DAPAp :: `LOXP_Box :: new_bact(t)) ;;<br />
fun new_env(t, nbG, nbS) = (<br />
incrNDAP(nb_dape) ;<br />
incrNDAPe(nb_dape) ;<br />
let env = fold((\i.\acc.((new_bactG(t))::acc)),Envify(fold((\n.\acc.(`DAP::acc)),seq:(),nb_dape)), nbG) in<br />
fold((\i.\acc.((new_bactS(t))::acc)),env, nbS)<br />
) ;;<br />
fun map_bact(f,env) = (<br />
map((\e.(if Bact(e) then f(e) else e fi)),env) //update_bact<br />
) ;;<br />
<br />
fun divide_bactG(t,b,id) = (<br />
let id' = new_bactId() in<br />
let nbDAP = count(`DAP,b)<br />
and nbCre = count(`Cre,b) in<br />
let bact1_core = Bactify({birth=t, date=0.0, id=id, next_state=`Unknown}::seq:())<br />
and bact2_core = Bactify({birth=t, date=0.0, id=id', next_state=`Unknown}::seq:()) in<br />
let bact1_core = fold((\n.\acc.(`DAP::acc)),bact1_core,nbDAP/2)<br />
and bact2_core = fold((\n.\acc.(`DAP::acc)),bact2_core,nbDAP - nbDAP/2) in<br />
let bact2_core = fold((\n.\acc.(`Cre::acc)),bact2_core,nbCre/2)<br />
and bact1_core = fold((\n.\acc.(`Cre::acc)),bact1_core,nbCre - nbCre/2) in<br />
let bact1_core = if (member(`DAPAp_i,b)) then (`DAPAp_i) else (`DAPAp) fi :: bact1_core<br />
and bact2_core = `DAPAp :: bact2_core in<br />
let bact2_core = if (member(`LOXP_Box_Cre,b)) then (`LOXP_Box_Cre) else (`LOXP_Box) fi :: bact2_core<br />
and bact1_core = `LOXP_Box :: bact1_core in<br />
bact1_core :: bact2_core :: seq:()<br />
) ;;<br />
<br />
fun set_DAPe(N,env) = (<br />
let dDAP = cptDAPe - N in<br />
if (dDAP > 0)<br />
then (<br />
(* cptDAPe > N : trop de DAP *)<br />
cptDAPe := N ;<br />
cptDAP := cptDAP - dDAP ;<br />
diff(env, fold((\n.\acc.(`DAP::acc)),Env:(),dDAP))<br />
)<br />
else (<br />
if (dDAP < 0)<br />
then (<br />
(* cptDAPe < N : pas assez de DAP *)<br />
cptDAPe := N ;<br />
cptDAP := cptDAP - dDAP ;<br />
join(env, fold((\n.\acc.(`DAP::acc)),Env:(),-1*dDAP))<br />
)<br />
else (env) fi<br />
) fi<br />
) ;;<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
fun static_help() = (<br />
stdout << "\n** Help of the \"static\" module **\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- cptCre (cptCre): `Cre counter\n\n" ;<br />
stdout << "\t- cptDAP (cptDAP): `DAP counter\n\n" ;<br />
stdout << "\t- cptDAPe (cptDAPe): `DAP counter (in the environment)\n\n" ;<br />
stdout << "\t- cptDAPi (cptDAPi): `DAP counter (in bacteria)\n\n" ;<br />
stdout << "\t- cptBact (cptBact): bacteria counter\n\n" ;<br />
stdout << "\t- cptBactG (cptBactG): germinal bacteria counter\n\n" ;<br />
stdout << "\t- cptBactS (cptBactS): somatic bacteria counter\n\n" ;<br />
<br />
stdout << "Functions\n" ;<br />
stdout << "\t- incrCre() (unit -> int):\n\t\tincrement cptCre\n\n" ;<br />
stdout << "\t- decrCre() (unit -> int):\n\t\tdecrement cptCre\n\n" ;<br />
stdout << "\t- incrDAP() (unit -> int):\n\t\tincrement cptDAP\n\n" ;<br />
stdout << "\t- decrDAP() (unit -> int):\n\t\tdecrement cptDAP\n\n" ;<br />
stdout << "\t- incrDAPe() (unit -> int):\n\t\tincrement cptDAPe\n\n" ;<br />
stdout << "\t- decrDAPe() (unit -> int):\n\t\tdecrement cptDAPe\n\n" ;<br />
stdout << "\t- incrDAPi() (unit -> int):\n\t\tincrement cptDAPi\n\n" ;<br />
stdout << "\t- decrDAPi() (unit -> int):\n\t\tdecrement cptDAPi\n\n" ;<br />
stdout << "\t- DAPe_DAPi() (unit -> int):\n\t\tdecrement cptDAPe, increment cptDAPi\n\n" ;<br />
stdout << "\t- DAPi_DAPe() (unit -> int):\n\t\tdecrement cptDAPi, increment cptDAPe\n\n" ;<br />
stdout << "\t- incrBact() (unit -> int):\n\t\tincrement cptBact\n\n" ;<br />
stdout << "\t- decrBact() (unit -> int):\n\t\tdecrement cptBact\n\n" ;<br />
stdout << "\t- incrBactG() (unit -> int):\n\t\tincrement cptBactG\n\n" ;<br />
stdout << "\t- decrBactG() (unit -> int):\n\t\tdecrement cptBactG\n\n" ;<br />
stdout << "\t- incrBactS() (unit -> int):\n\t\tincrement cptBactS\n\n" ;<br />
stdout << "\t- decrBactS() (unit -> int):\n\t\tdecrement cptBactS\n\n" ;<br />
stdout << "\t- BactG_BactS() (unit -> int):\n\t\tdecrement cptBactG, increment cptBactS\n\n" ;<br />
<br />
stdout << "\t- new_Bact(t) (float -> Bact):\n\t\tcreate a new bacterium at time t\n\n" ;<br />
stdout << "\t- new_BactG(t) (float -> BactG):\n\t\tcreate a new germinal bacterium at time t\n\n" ;<br />
stdout << "\t- new_BactS(t) (float -> BactS):\n\t\tcreate a new somatic bacterium at time t\n\n" ;<br />
stdout << "\t- new_env(t,ng,ns) (float * int * int -> Env):\n\t\tcreate a new environment containing ng germinal bacteria and ns somatic bacteria at time t\n\n" ;<br />
stdout << "\t- map_bact(f,env) ((Bact -> Bact) * Env -> Env):\n\t\tapply the function f on each bacterium of env\n\n" ;<br />
stdout << "\t- set_DAPe(N,env) (int * Env -> Env):\n\t\tchange env, cptDAP and cptDAPe to N `DAP\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Scheduling==<br />
<code><pre><br />
constraint schedule = `Empty_SC | schedule_entry<br />
<br />
and record schedule_entry = { date:float, id:int, sc:schedule, rule:int } ;;<br />
<br />
fun schedule_empty() = `Empty_SC ;;<br />
<br />
fun schedule_add_entry(id,date,rule,sc) = (<br />
switch (sc)<br />
case `Empty_SC : {date=date,id=id,rule=rule,sc=sc}<br />
default : (<br />
if (sc.date > date)<br />
then {date=date,id=id,rule=rule,sc=sc}<br />
else {date=sc.date,id=sc.id,rule=sc.rule,sc=schedule_add_entry(id,date,rule,sc.sc)} fi<br />
)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_remove_entry(id,sc) = (<br />
switch (sc)<br />
case `Empty_SC : `Empty_SC<br />
default : (<br />
if (sc.id == id)<br />
then sc.sc<br />
else {date=sc.date,id=sc.id,rule=sc.rule,sc=schedule_remove_entry(id,sc.sc)} fi<br />
)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_size(sc) = (<br />
switch (sc)<br />
case `Empty_SC : 0<br />
default : 1 + schedule_size(sc.sc)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_replace_entry(id,date,rule,sc) = (<br />
switch (sc)<br />
case `Empty_SC : {date=date,id=id,rule=rule,sc=sc}<br />
default : (<br />
if (sc.id == id)<br />
then schedule_add_entry(id,date,rule,sc.sc)<br />
else (<br />
if (sc.date > date)<br />
then {date=date,id=id,rule=rule,sc=schedule_remove_entry(id,sc)}<br />
else {date=sc.date,id=sc.id,rule=sc.rule,sc=schedule_replace_entry(id,date,rule,sc.sc)} fi<br />
) fi<br />
)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_remove_first_entry(sc) = sc.sc ;;<br />
<br />
fun schedule_print(sc) = (<br />
switch (sc)<br />
case `Empty_SC : stdout << "\n"<br />
default : (<br />
stdout << sc.id << "\t(" << sc.rule << ", " << sc.date << ") \n" ;<br />
schedule_print(sc.sc)<br />
)<br />
endswitch<br />
) ;;<br />
<br />
schedule := schedule_empty() ;;<br />
<br />
fun schedule_help() = (<br />
stdout << "\n** Help of the \"schedule\" module **\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- schedule (schedule): the main schedule initilized with value `Empty_SC\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- schedule_empty() (unit -> schedule):\n\t\treturns the empty schedule\n\n" ;<br />
stdout << "\t- schedule_add_entry(id,d,r,sc) (int * float * int * schedule -> schedule):\n\t\tadd an entry in the schedule sc corresponding to the\n\t\tapplication of the rule r on the bacterium id at the date d\n\n" ;<br />
stdout << "\t- schedule_add_entry(id,d,r,sc) (int * float * int * schedule -> schedule):\n\t\treplace (or add if not existing) an entry in the\n\t\tschedule sc corresponding to the application of the rule r on the bacterium id at the date d\n\n" ;<br />
stdout << "\t- schedule_remove_entry(id,sc) (int * schedule -> schedule):\n\t\tremove in sc the first occurence of an event in bacterium id\n\n" ;<br />
stdout << "\t- schedule_remove_first(sc) (schedule -> schedule):\n\t\tremove the first entry of sc\n\n" ;<br />
stdout << "\t- schedule_print(sc) (schedule -> stdout):\n\t\tprint sc\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Dynamics==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* Dynamics of the system *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* It exists two kinds of dynamics. The first is related to the chemical reactions that occur *)<br />
(* everywhere in the system (inside and outside the bacteria + transport of proteins between the *)<br />
(* outside and inside). This parts will be simulated using a sotchastic process based on the *)<br />
(* Gillespie's algorithm. The second part of the dynamics to be modeled corresponds to the *)<br />
(* bacteria behavior like divisions and cells death. In fact, a lot of processes appearing in *)<br />
(* bacteria and belonging to their normal dynamics are skipped/abstracted as functions of the *)<br />
(* chemical state of bacteria. For example, a too high concentration of DAP is lethal ; we *)<br />
(* reprensent this dependance by a function that deletes all bacteria where the threshold is *)<br />
(* exceeded. These behavior functions have to be evaluated after each chemical update. *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
<br />
constraint ruleId = `CreD | `DAPiD | `DAPApI | `DAPApA | `CreP1 | `CreP2 | `Diff1 | `Diff2 | `DAPiP | `DAPEx | `DAPIm | `DAPeD | `Div | `Death | `Unknown ;;<br />
<br />
fun fstOrder(k,v) = k ;;<br />
fun sndOrder(k,v) = k/gamma(v) ;;<br />
<br />
//fun count(p,c) = fold((\e.\acc.(acc + if p(e) then 1 else 0 fi)),0,c) ;;<br />
//fun countAll(p1,p2,c) = fold((\e.\acc.(acc + if p2(e) then count(p1,e) else 0 fi)),0,c) ;;<br />
<br />
<br />
appliedBactRule := `Unkown ;;<br />
trans inBact = {<br />
<br />
(* Chemicals degradation *)<br />
`Cre ={ C = fstOrder(K_CreD,1.0) }=> (appliedBactRule := `CreD ; <undef>) ;<br />
`DAP ={ C = fstOrder(K_DAPiD,1.0) }=> (appliedBactRule := `DAPiD ; <undef>) ;<br />
<br />
(* Promotor activity *)<br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> (appliedBactRule := `DAPApI ; `DAPAp_i) ;<br />
`DAPAp_i ={ C = fstOrder(K_DAPApA,1.0) }=> (appliedBactRule := `DAPApA ; `DAPAp, `DAP) ;<br />
`DAPAp ={ C = \c.(fstOrder(K_CreP1* if (member(`DAP,c)) then 1.0 else 1.0 fi,1.0)) }=> (appliedBactRule := `CreP1 ; `DAPAp, `Cre) ;<br />
`DAPAp_i ={ C = fstOrder(K_CreP2,1.0) }=> (appliedBactRule := `CreP2 ; `DAPAp_i, `Cre) ;<br />
<br />
(* Differentiation *)<br />
`LOXP_Box, `Cre ={ C = sndOrder(2.0*K_Diff,1.0) }=> (appliedBactRule := `Diff1 ; `LOXP_Box_Cre) ;<br />
`LOXP_Box_Cre, `Cre ={ C = sndOrder(K_Diff,1.0) }=> (appliedBactRule := `Diff2 ; `DAP_Box) ;<br />
<br />
(* DAP production (exclusively for somatic cells) *)<br />
`DAP_Box ={ C = fstOrder(K_DAPiP,1.0) }=> (appliedBactRule := `DAPiP ; `DAP_Box, `DAP) ;<br />
<br />
(* DAP externalization *)<br />
`DAP ={ C = fstOrder(K_DAPEx,1.0) }=> (appliedBactRule := `DAPEx ; return(`DAP :: (diff(self,`DAP)) :: seq:())) ;<br />
<br />
} ;;<br />
<br />
appliedEnvRule := `Unkown ;;<br />
nbReleasedDAP := 0 ;;<br />
deadBactId := -1 ;;<br />
trans inEnv[upBact,current_t,current_sc] = {<br />
<br />
(* DAP internalization *)<br />
`DAP, b:Bact ={ A = (\c.(sndOrder(K_DAPIm,1.0) * cptDAPe * cptBact)) }=> (appliedEnvRule := `DAPIm ; (upBact(current_sc,(`DAP :: b))) ) ;<br />
<br />
(* DAP external degradation *)<br />
`DAP ={ C = fstOrder(K_DAPeD,1.0) }=> (appliedEnvRule := `DAPeD ; <undef>) ;<br />
<br />
(* BactS death *)<br />
(x:BactS \/ {id=id}) as b ={ A = (\c.(fstOrder(K_Death,1.0)*cptBactS)) }=> (<br />
let nbDAP = count(`DAP,b) in<br />
nbReleasedDAP := nbDAP ;<br />
appliedEnvRule := `Death ;<br />
deadBactId := id ;<br />
map((\e.(`DAP)),iota(nbDAP,seq:()))<br />
) ;<br />
<br />
(* BactG mitosis *)<br />
(_:BactG \/ ({id=id})) as b ={ A = (\c.(fstOrder(K_Div,1.0)*cptBactG)) }=> (<br />
appliedEnvRule := `Div ;<br />
let b1b2 = divide_bactG(current_t+'tau,b,id) in<br />
let b1 = upBact(current_sc,b1b2.(0)) in<br />
let b2 = upBact(schedule,b1b2.(1)) in<br />
b1 :: (b2 :: seq:())<br />
) ;<br />
<br />
} ;;<br />
<br />
fun cptUpdate[nbRD](r) = ( // Stochiometric update for the output<br />
switch (r)<br />
case `CreD: decrCre()<br />
case `DAPiD: (decrDAPi() ; decrDAP())<br />
case `DAPApI: (decrDAPi() ; decrDAP())<br />
case `DAPApA: (incrDAPi() ; incrDAP())<br />
case `CreP1: incrCre()<br />
case `CreP2: incrCre()<br />
case `Diff1: decrCre()<br />
case `Diff2: (decrCre(); BactG_BactS())<br />
case `DAPiP: (incrDAPi() ; incrDAP())<br />
case `DAPEx: DAPi_DAPe()<br />
case `DAPIm: DAPe_DAPi()<br />
case `DAPeD: (decrDAPe() ; decrDAP())<br />
case `Death: (decrNDAPi(nbRD) ; incrNDAPe(nbRD) ; decrBactS() ; decrBact())<br />
case `Div: (incrBactG() ; incrBact())<br />
default: raise (`Erreur ("Diet_coli: Not yet implemented: rule "+r))<br />
endswitch<br />
) ;;<br />
<br />
<br />
<br />
<br />
<br />
fun dynamic_help() = (<br />
stdout << "\n** Help of the \"dynamic\" module **\n\n" ;<br />
stdout << "Requirements\n" ;<br />
stdout << "\t- module \"globals\"\n" ;<br />
stdout << "\t- module \"static\"\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- appliedBactRule (ruleId): takes the id of a rule after the application of inBact [`Ùnknown]\n\n" ;<br />
stdout << "\t- appliedEnvRule (ruleId): takes the id of a rule after the application of inEnv [`Ùnknown]\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- fstOrder(k,v) (float * float -> float):\n\t\tkinetics to stochastic conversion\n\n" ;<br />
stdout << "\t- sndOrder(k,v) (float * float -> float):\n\t\tkinetics to stochastic conversion\n\n" ;<br />
stdout << "\t- sndOrder(k,v) (float * float -> float):\n\t\tkinetics to stochastic conversion\n\n" ;<br />
stdout << "\t- inBact(b) (Bact -> Bact | `DAP*Bact):\n\t\tchemical reactions in bacteria ; to be applied with strategy `gillespie\n\n" ;<br />
stdout << "\t- inEnv[update_bact(Bact -> Bact)](e) (Env -> Env):\n\t\tchemical reactions in environment ; the option update_bact is to update the state of a bacterium modified by the application of the rule\n\n" ;<br />
stdout << "\t- cptUpdate(r) (ruleId -> unit):\n\t\tupdate of the global counters from \"static\" w.r.t. the applied rule r\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==ExtSSA==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* System evolution algorithm *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* The model is a one depth level P system. Our alogrithm consists in applying the gillespie SSA *)<br />
(* on each bacterium. A bacterium contains the current state together with the next step and the *)<br />
(* corresponding reaction delay. The SSA is applied on the environment providing a reaction time. *)<br />
(* The evolution is done where the delay is the smallest. *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
<br />
trans no_next_state = { { next_state } as x => x + { next_state = `Unknown, date=0.0 } } ;;<br />
<br />
trans update_bact[t,sc] = {<br />
{ id=id } as x => (<br />
let date = 0.0 in<br />
let nx_state = inBact[strategy=`gillespie,<br />
postlude=(\c.(date := t+'tau ; c)),<br />
iter=1](no_next_state(self))<br />
in<br />
schedule := schedule_replace_entry(id,date,appliedBactRule,sc) ;<br />
appliedBactRule := `Unkown ;<br />
x + { date=date, next_state = nx_state }<br />
)<br />
} ;;<br />
<br />
trans evolve_bact[t,sc,idEv] = {<br />
((b:Bact \/ ({id=x,next_state=nxs}))) as bb / (idEv == x) => (<br />
if (Bact(nxs))<br />
then update_bact[t=t,sc=sc](nxs)<br />
else (nxs.(0)::(update_bact[t=t,sc=sc](nxs.(1)) :: seq:())) fi<br />
)<br />
} ;;<br />
<br />
fun step[get_global_time,set_global_time,sc](env) = (<br />
t := get_global_time() ;<br />
let date' = 0.0 in<br />
let env' = inEnv[upBact=(\sc.\x.(let t' = t+'tau in update_bact[t=t',sc=sc,strategy=`default](x))),<br />
current_t = t,<br />
current_sc = sc,<br />
strategy=`gillespie,<br />
postlude=(\c.(date' := t + 'tau ; c)),<br />
iter=1](env)<br />
in<br />
//!! (stdout << "schedule.date=" << schedule.date << " > date'=" << date' << "\n" ; (date' == infinity) || (date' < schedule.date)) ;<br />
if (date' < sc.date)<br />
then (<br />
//stdout << "envionment evolution (applied rule = " << appliedEnvRule << "(" << nbReleasedDAP << "), date = " << date' << "(" << t << "))\n" ;<br />
cptUpdate[nbRD=nbReleasedDAP](appliedEnvRule) ;<br />
schedule := if (appliedEnvRule==`Death) then schedule_remove_entry(deadBactId,schedule) else schedule fi ;<br />
nbReleasedDAP := 0 ;<br />
deadBactId := -1 ;<br />
appliedEnvRule := `Unkown<br />
)<br />
else (<br />
//stdout << "bacterium evolution (id = " << sc.id << ", applied rule = " << sc.rule << ", date = " << sc.date << "(" << t << "))\n" ;<br />
cptUpdate(sc.rule) ;<br />
nbReleasedDAP := 0 ;<br />
deadBactId := -1 ;<br />
appliedEnvRule := `Unkown ;<br />
date' := sc.date ;<br />
env' := evolve_bact[strategy=`asynchronous,sc=sc,idEv=sc.id,t=date'](env)<br />
) fi ;<br />
//stdout << env' << "\n" ;<br />
sc := schedule ;<br />
set_global_time(date') ;<br />
env'<br />
) ;;<br />
<br />
<br />
fun evol_algo_help() = (<br />
stdout << "\n** Help of the \"evol_algo\" module **\n\n" ;<br />
stdout << "Requirements\n" ;<br />
stdout << "\t- module \"schedule\"\n" ;<br />
stdout << "\t- module \"dynamic\"\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- update_bact[t=t(float),sc=sc(schedule)](b) (Bact -> Bact):\n\t\tcompute the next Gillespie step of a bacterium b. The schedule sc is updated and the new value of sc is returned in the global variable schedule. The option t has to be set to the global date.\n\n" ;<br />
stdout << "\t- evolve_bact[t=t(float),sc=sc(schedule),idEv=id(int)](env) (Env -> Env):\n\t\tmake the bacterium with identifiant id evolve. The schedule sc is updated and the new value of sc is returned in the global variable schedule. The option t has to be set to the global date.\n\n" ;<br />
stdout << "\t- step[t=t(float),sc=sc(schedule)](env) (Env -> Env):\n\t\tOne step evolution of the whole system. The earliest event is applied in the environment env w.r.t. the schedule sc. The option t has to be set to the global date.\n\n"<br />
<br />
) ;;<br />
</pre></code><br />
<br />
==Output for Gnuplot==<br />
<code><pre><br />
GPoutput := "/tmp/sortie.dat" ;;<br />
PNGoutput := "/tmp/sortie.png" ;;<br />
gnuplot := "/usr/bin/gnuplot" ;;<br />
<br />
fun export_cpt[get_global_time](freq, env) = (<br />
if (('iteration % freq) == 0)<br />
then (<br />
let tg = get_global_time() in<br />
GPoutput << get_global_time() << "\t" <<<br />
cptCre << "\t" <<<br />
cptDAP << "\t" <<<br />
cptDAPe << "\t" <<<br />
(cptDAPi/cptBact) << "\t" <<<br />
cptBact << "\t" <<<br />
cptBactS << "\t" <<<br />
cptBactG << "\n" ;<br />
stdout << "Iteration: " << 'iteration << " and Global time: " << tg << " and bacteria population: " << cptBact << " (G/S = " << cptBactG << "/" << cptBactS << ")\n"<br />
)<br />
else <undef> fi ;<br />
env<br />
) ;;<br />
<br />
fun dataToPng() = (<br />
gnuplot << "set key outside\n";<br />
gnuplot << "set xlabel \"Time (arbitrary unit)\"\n";<br />
gnuplot << "set ylabel \"Number of molecules or structures\"\n";<br />
gnuplot << "set output \""+ PNGoutput + "\"\n";<br />
gnuplot << "set term png\n";<br />
<br />
gnuplot << "plot " +<br />
"\""+ GPoutput +"\" using 1:4 title ' DAPe' with lines 3," +<br />
"\""+ GPoutput +"\" using 1:5 title ' DAPi' with lines 4," +<br />
"\""+ GPoutput +"\" using 1:6 title ' Bact' with lines 5," +<br />
"\""+ GPoutput +"\" using 1:7 title ' BactS' with lines 6," +<br />
"\""+ GPoutput +"\" using 1:8 title ' BactG' with lines 7" +<br />
"" ;<br />
gnuplot << "\nquit" ;<br />
gnuplot << "\n"<br />
<br />
) ;;<br />
<br />
fun dataToPngDAP() = (<br />
gnuplot << "set key outside\n";<br />
gnuplot << "set xlabel \"Time (arbitrary unit)\"\n";<br />
gnuplot << "set ylabel \"Number of molecules or structures\"\n";<br />
gnuplot << "set output \""+ PNGoutput + "\"\n";<br />
gnuplot << "set term png\n";<br />
<br />
gnuplot << "plot " +<br />
"\""+ GPoutput +"\" using 1:5 title ' DAPi' with lines 4" +<br />
"" ;<br />
gnuplot << "\nquit" ;<br />
gnuplot << "\n"<br />
<br />
) ;;<br />
<br />
fun dataToPngBact() = (<br />
gnuplot << "set key outside\n";<br />
gnuplot << "set xlabel \"Time (arbitrary unit)\"\n";<br />
gnuplot << "set ylabel \"Number of molecules or structures\"\n";<br />
gnuplot << "set output \""+ PNGoutput + "\"\n";<br />
gnuplot << "set term png\n";<br />
<br />
gnuplot << "plot " +<br />
"\""+ GPoutput +"\" using 1:6 title ' Bact' with lines 5," +<br />
"\""+ GPoutput +"\" using 1:7 title ' BactS' with lines 6," +<br />
"\""+ GPoutput +"\" using 1:8 title ' BactG' with lines 7" +<br />
"" ;<br />
gnuplot << "\nquit" ;<br />
gnuplot << "\n"<br />
<br />
) ;;<br />
<br />
fun output_help() = (<br />
stdout << "\n** Help of the \"output\" module **\n\n" ;<br />
stdout << "Requirements\n" ;<br />
stdout << "\t- module \"static\"\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- GPoutput (string): Gnuplot formatted output file [\"/tmp/sortie.dat\"]\n\n" ;<br />
stdout << "\t- PNGoutput (string): PNG file for Gnuplot exporting (see function dataToPng) [\"/tmp/sortie.png\"]\n\n" ;<br />
stdout << "\t- gnuplot (string): absolute path to Gnuplot executable [\"/usr/bin/gnuplot\"]\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- export_cpt[get_global_time](freq, env) (int * Env -> Env):\n\t\tExport in GPoutput the state of global module counters (to be used as interlude of an iterated function)\n\n" ;<br />
stdout << "\t- dataToPng() (unit -> unit):\n\t\texport GPoutput to the PNG file PNGoutput using Gnuplot (located at path gnuplot)\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Main program==<br />
<code><pre><br />
!set match_random := 100 ;;<br />
<br />
duration := 1500.0 ;;<br />
gt := 0.0 ;; //global time<br />
fun ggt() = gt ;; //global time set and get function... an assert is used to check that time only increases<br />
fun sgt(x) = (!! (gt <= x) ; gt := x) ;;<br />
<br />
!include "globals.mgs" ;;<br />
!include "static.mgs" ;;<br />
!include "schedule.mgs" ;;<br />
!include "dynamic.mgs" ;;<br />
!include "evol_algo.mgs" ;;<br />
!include "output.mgs" ;;<br />
<br />
schedule := schedule_empty() ;;<br />
<br />
env := map_bact((\b.(update_bact[t=gt,sc=schedule](b))),new_env(gt,10,0)) ;;<br />
<br />
step[fixpoint=(\c1.\c2.(gt > duration || cptBact == 0)), interlude=B(export_cpt[get_global_time=ggt](10),I(*set_DAPe(nb_dape)*)), sc=schedule, get_global_time=ggt, set_global_time=sgt](env) ;;<br />
<br />
dataToPng() ;;<br />
</pre></code><br />
<br />
<br />
= Biocham Modelling =<br />
[http://biosynthetique.free.fr/model/AMFI.xml|Here] is available the source code of the Biocham based model. This XMF formatted file can be imported by the [[http://contraintes.inria.fr/BIOCHAM/ Biocham executable]]</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T21:42:13Z<p>Spicher: /* Sources of the MGS programs 50px */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for Modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== Questions of Interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section 2). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of Principle: Qualitative Analysis of System's Behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing Robustness and Optimizing System's Behavior: Quantitative Analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part 2, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part 3, our results indicated that the system’s behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. <br />
<br />
We would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of MGS and Biocham programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T21:41:03Z<p>Spicher: /* Biocham */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for Modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== Questions of Interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section 2). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of Principle: Qualitative Analysis of System's Behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing Robustness and Optimizing System's Behavior: Quantitative Analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part 2, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part 3, our results indicated that the system’s behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. <br />
<br />
We would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of the MGS programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Cell_autoParis/Cell auto2007-10-26T21:27:12Z<p>Spicher: /* Dynamics */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
<br><br />
<br />
= Introduction =<br />
<br />
DAP feeding between somatic and germ cells is based on an indirect communication process: soma cells produce DAP and release it in the environment; DAP molecules freely diffuse outside until they are captured by a germ cell. As the diffusion takes place in the environment, a somatic cell feed first the germ cells that are close to it. Then an well mixed hypothesis as the one used in the our [[Paris/Continuous_model|growth of population analysis]] is hard to assume. We are interesting here in the case where the differentiation of a germ into a soma is DAP dependent. In order to figure out the relation between DAP diffusion and differentiation we propose a simple cellular automaton on square grid. Each cell of the automaton contains a bacterium. We first detail some hypotheses used in this model, then we specify the local behavior rules following by each automaton cell. Finally, the generated simulation is presented.<br />
<br />
= Hypotheses =<br />
<br />
The chosen approach consists in observing the DAP diffusion and differentiation frontwaves. In order to focus on these phenomenon, we work on a ''constant'' population (no death, no division). So we assume that without DAP in its surrounding, a germ cell does not die but remain in passive state (we can imagine that they are at a stationary phase or between to division cycle). It will seem that DAP ''wake up'' bacteria but it's just an artifact due to this assumption.<br />
<br />
It may happen that a germ cell as enough DAP to evolve (typically when it is touched by a DAP diffusion front) but we assume that the contribution is not enough for the cell to divide.<br />
<br />
Finally, we assume then that DAP is produced in somatic cells only and consumed by germ cells. The communication is done by distinguishing in the automaton intra and extra cellular DAP (respectively named DAPi and DAPe).<br />
<br />
= Model Description =<br />
<br />
In this we focus on the elaboration of the cellular automaton.<br />
<br />
== Structure ==<br />
<br />
As we have previously announced, we design cellular automaton on a square grid. More precisely, in order to avoid boundary effects, we assume that the grid is actually wrapped in such a way the grid topology is a 2D torus. Each cell of the automaton contains a bacterium, either germ or somatic, together with the external DAP concentration. So we represent the different states of the automaton cell by tuple of values <code>{DAPe,DAPi,Type}</code>:<br />
<br />
* <code>DAPe</code> is the external DAP concentration,<br />
<br />
* <code>DAPi</code> is the internal DAP concentration in the bacterium,<br />
<br />
* <code>Type</code> represents if the bacterium is differentiated or not; it can take two values <code>BactG</code> and <code>BactS</code>.<br />
<br />
== Dynamics ==<br />
<br />
The following rules specify the local evolution of each cell of the automaton. We distinguished to evolution laws depending on what kind of bacterium is in the cell:<br />
<br />
*<html><u>In the case of a somatic cell</u></html>: we have to consider the diffusion of <code>DAPe</code> between the considered cell and its neighbors, the export of DAP from the inside to the outside, and finally the production of <code>DAPi</code>. The rule can be presented as follows:<br />
<br />
DAPe <- DAPe + (DAPe diffused in the neighborhood) + (DAPi lost by export)<br />
DAPi <- DAPi + (DAPi produced) - (DAPi lost by export)<br />
Type <- BactS<br />
<br />
*<html><u>In the case of a germ cell</u></html>: we have to consider the diffusion of <code>DAPe</code> between the considered cell and its neighbors, the import of DAP from the outside to the inside, the consumption of <code>DAPi</code>, and finally the differentiation when DAP concentration reaches a right range of values. The rule can be presented as follows:<br />
<br />
DAPe <- DAPe + (DAPe diffused in the neighborhood) - (DAPi gain by import)<br />
DAPi <- DAPi - (DAPi consumed) + (DAPi gain by import)<br />
Type <- '''if''' (min_threshold) < DAPi < (max_threshold) '''then''' BactS '''else''' BactG<br />
<br />
== Parameters ==<br />
<br />
We consider 8 parameters. They are used with some noise during the evolution to avoid a deterministic behavior.<br />
<br />
* In <code>BactS</code> cells:<br />
<br />
:* Dap export rate in somatic bacteria<br />
<br />
:* Dap import rate in somatic bacteria<br />
<br />
:* Dap production rate of somatic bacteria<br />
<br />
* In <code>BactG</code> cells:<br />
<br />
:* Dap export rate in germ bacteria<br />
<br />
:* Dap import rate in germ bacteria<br />
<br />
:* Dap consummation rate of germ bacteria<br />
<br />
:* Minimal threshold for differentiation<br />
<br />
:* Maximal threshold for differentiation<br />
<br />
== Initial state ==<br />
<br />
Our initial state is 30x30 2D toric cellular automaton where all cells are initialized by value <code>{DAPe=0,DAPi=0,Type=BactG}</code> but four <code>{DAPe=0,DAPi=0,Type=BactS}</code> are randomly placed in the grid.<br />
<br />
<br />
<br />
= Output [[Image:MGS-inside.png|50px]]=<br />
<br />
Our implementation was done in [[Paris/mgs|MGS]] and the output was generated by [http://www.sciences.univ-nantes.fr/info/perso/permanents/cohen/SOFTWARE/GBVIEW/index.html GBView].<br />
<br />
The output is two animated pictures: the first one shows the differentiation, the other the diffusion of DAPe<br><br />
<center>[[Image:Paris\Diff_DAP.gif|Dap diffusion]][[Image:Paris\Diffe.gif|Bact differentiation]]</center><br><br />
<br />
*The first picture shows the diffusion of DAP: the front wave is figured in light blue; the dark blue area corresponds to stable parts of the system where concentration do not evolve anymore.<br />
<br />
*The second picture presents the differentiation: red and blue cells are respectively germ and somatic bacteria.<br />
<br />
= Results =<br />
<br />
As we can see, the differentiation and DAP diffusion wave fronts are superposed. This simulation is obviously out of reality but the underlying model have been developed in order to consider that low concentration of DAP induces differentiation (cells become green - dark blue), while with high DAP concentration, the differentiation is inhibited. Without this second threshold, all cells would differentiate. But some germ cells remain because they are enough fed to stay over the threshold. This property is of course crucial as only germ cells can reproduce.<br />
<br />
In the considered model of the system, the inhibition must be strong and effective for not all the cells differentiate. Bad thresholds make the system collapse: a too strong inhibition prevents germ cells to differentiate, and on the opposite, a too weak inhibition make all them switch to a somatic state.<br />
<br />
By tuning the constant of diffusion, we have noted that the 3 steps communication process (export, diffusion, import) is of main interest. For a few molecules of DAP imported in germ cells, an important amount of produced DAP has to be produced: there is a lot of lost during the process. So in order to keep a coherent rate of production, a germ cell must be surrounded by a lot of somatic bacteria: the ratio of 1:1 of differentiated and germ cell is not viable, that is why a lot of somatic cells feed isolated germ bacteria as enlighten by the animations.<br />
<br />
= [[Paris\Sources#Cell auto|Sources]] =</div>Spicherhttp://2007.igem.org/wiki/index.php/User:SpicherUser:Spicher2007-10-26T17:43:49Z<p>Spicher: </p>
<hr />
<div>[[Image:Antoine_Spicher.jpg]]<br />
<br />
During my PhD at the [http://www.ibisc.univ-evry.fr IBISC laboratory] of the university of Evry, I have worked on the [http://mgs.ibisc.univ-evry.fr MGS project] that aims at developing a experimental programming language dedicated to [[Paris/mgs|the modeling and the simulation of dynamical systems with a dynamical structure]]. I am now interested in synthetic biology that is to me a computational approach of life. I particularly study to the programming of bacteria population using concept of amorphous computing.</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/SourcesParis/Sources2007-10-26T17:10:37Z<p>Spicher: /* Output for Gnuplot */</p>
<hr />
<div>{{Paris_menu_modeling}}<br><br />
<br />
=Cellular Automaton for DAP Diffusion=<br />
<code><pre><br />
!include "gbviewOutput.mgs" ;;<br />
<br />
N := 30;;<br />
<br />
gbf grille = <nord, est ; 30 * nord, 30 * est><br />
and record Bact = { DAP:float, DAPe:float }<br />
and record BactG = Bact + { bactG }<br />
and record BactS = Bact + { bactS} ;;<br />
<br />
fun iota_v(v,n) = map((\x.v), iota(n,seq:())) ;;<br />
fun new_grid(v) = iota_v(iota_v(v,N), N) following |nord>, |est> ;;<br />
<br />
fun majBactG[DAPexport = 0.2, DAPimport = 0.2, DAPconso= 1, SupDiff = 2.4, InfDiff = 2.02 ](x) = <br />
if ( ( x.DAP > InfDiff ) & ( x.DAP < SupDiff ) & (random(1) < 0.8) ) then<br />
{DAP = x.DAP , DAPe = x.DAPe, bactS} else<br />
let dap = if x.DAP - DAPconso > 0 then x.DAP - DAPconso else 0 fi<br />
and dape= x.DAPe<br />
in if dap > dape then <br />
x + {DAP = dap - DAPexport * dap, DAPe = dape + DAPexport * dap }<br />
else x + {DAP = dap + DAPimport * dape, DAPe = dape - DAPimport * dape }<br />
fi<br />
fi <br />
;;<br />
<br />
fun majBactS[DAPexport = 0.2, DAPimport = 0.2, DAPprod=10](x) = <br />
let dap = x.DAP + DAPprod<br />
and dape= x.DAPe<br />
in if dap > dape then <br />
x + {DAP = dap - DAPexport * dap, DAPe = dape + DAPexport * dap }<br />
else x + {DAP = dap + DAPimport * dape, DAPe = dape - DAPimport * dape }<br />
fi<br />
<br />
;;<br />
<br />
<br />
trans evol[Delta_t=0.1,DAPeDiff=1, DAPeDegrad = 0.2] = {<br />
<br />
<br />
<br />
(* production of DAP *)<br />
x:BactS => ( <br />
let d = neighborsfold(<br />
(\y.\acc.( DAPeDiff*Delta_t*(y.DAPe-x.DAPe) + acc)),<br />
x.DAPe,<br />
x)<br />
in majBactS( x + {DAPe = if ( d - DAPeDegrad * x.DAPe) > 0 then d - DAPeDegrad * x.DAPe else 0 fi } )<br />
);<br />
<br />
(* Diffirentiation and Consumption *)<br />
x:BactG => ( <br />
let d = neighborsfold(<br />
(\y.\acc.( DAPeDiff*Delta_t*(y.DAPe-x.DAPe) + acc)),<br />
x.DAPe,<br />
x)<br />
in majBactG(x + {DAPe = if ( d - DAPeDegrad * x.DAPe) > 0 then d - DAPeDegrad * x.DAPe else 0 fi } )<br />
<br />
<br />
)<br />
<br />
} ;;<br />
<br />
<br />
<br />
<br />
<br />
g := new_grid({DAP=6.0, DAPe=3.0, bactG}) ; 0 ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;;<br />
g := set_gbfpos(g, (random(30)*|nord> + random(30)*|est>), {DAP = 6.0, DAPe=3.0, bactS}) ;; <br />
evol[iter=1000,interlude=GBVexport((\v.("DAPe = "+(12 * v.DAPe )+if BactS(v) then ", bactS= 255" else ", bactG = 255"fi )))](g) ;;<br />
</pre></code><br />
<br />
= Cells Spatial Organization =<br />
<br />
==Constant rate of differentiation==<br />
<br />
<code><pre><br />
record MecaBact = {x, y, vx, vy, fx, fy, radius}<br />
and record CellBact = {dap:float, soma:bool}<br />
and record Bact = MecaBact + CellBact;;<br />
<br />
<br />
delaunay(2) D2 = (\e.(e.x, e.y)) ;;<br />
<br />
fun noise(x) = x + 0.0005 - random(0.001) ;;<br />
// --- Mechanistic-------------------------------------------------------<br />
<br />
DT := 0.05;;<br />
K := 1.0;;<br />
MU := 1.8;;<br />
R0_Gm := 0.50;; //germinal cells minmal rayon <br />
R0_G :=0.75;;<br />
R0_S := 1.00;;<br />
<br />
// interaction : the effect of the cells between each others<br />
fun interaction(ref, src) = (<br />
let X = ref.x - src.x<br />
and Y = ref.y - src.y in<br />
let dist = sqrt(X*X+Y*Y) in<br />
let spring = 0.0-K*(dist-(ref.radius+src.radius))/dist in<br />
{fx=X*spring - ref.vx*MU, fy = Y*spring - ref.vy*MU}<br />
) ;;<br />
<br />
fun add_vect(u, v) = { fx = u.fx + v.fx, fy = u.fy + v.fy } ;;<br />
fun sum(x, u, acc) = add_vect(acc, interaction(x,u)) ;;<br />
<br />
<br />
trans Meca = {<br />
e => (<br />
let f = neighborsfold(sum(e), {fx=0,fy=0}, e) in<br />
e+{ x = noise(e.x + DT*e.vx),<br />
y = noise(e.y + DT*e.vy),<br />
vx = e.vx + DT*f.fx,<br />
vy = e.vy + DT*f.fy,<br />
fx = f.fx,<br />
fy = f.fy<br />
}<br />
)<br />
} ;;<br />
<br />
<br />
// --- Growth ------------------------------------------------------<br />
<br />
DIFF := 1.0 ;;<br />
CONS := 10.0 ;;<br />
DiffP := 0.00023 ;; <br />
DeathSP := 0.00001 ;;<br />
DivG := 0.00600 ;;<br />
DEPOT := 15.0 ;; <br />
CroitG :=0.004 ;; <br />
CroitS :=0.007;; <br />
<br />
<br />
//cell division function<br />
fun divide(b) = (<br />
b+{dap= b.dap/2, radius=R0_Gm },<br />
b + {dap= b.dap/2,x=noise(b.x),y=noise(b.y), radius=R0_Gm}<br />
) ;;<br />
<br />
<br />
<br />
trans Evol = {<br />
<br />
x / x.soma => if (random(1.0) <= DeathSP) then <undef> else if ( ( x.radius < R0_S ) & ( random(1.0) < CroitS) ) then x + <br />
{radius = x.radius + (R0_S - R0_G)/4} else x fi fi ; <br />
<br />
x => (<br />
let dap_diff = neighborsfold((\y.\acc.( {dap=DT*DIFF*(y.dap-x.dap) + acc.dap, n=acc.n+1} )), {dap=0.0,n=0}, x) in<br />
let dap' = if (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS >= 0 then (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS else 0 fi in<br />
<br />
if (random(1.0) <= DiffP)<br />
then x + {dap=DEPOT,soma=true,radius=x.radius} //la nouvelle cellule S a la taille de la cellule G dont elle provient<br />
else if x.radius >= R0_G then if ( (random(1.0) <= DivG) & dap'> 1 )then divide(x + {dap=dap'}) else (x + {dap=dap'}) fi<br />
else if random(1.0) < CroitG then x + {radius = x.radius + (R0_G - R0_Gm)/5 , dap=dap' } else x+{dap=dap'} fi fi fi<br />
) <br />
<br />
} ;;<br />
<br />
<br />
<br />
<br />
// --- Visualisation ----------------------------------------------------<br />
<br />
outname := "/tmp/sheet.imo" ;;<br />
outfile := (if (is_opened(outname)) then close(outname) else <undef> fi ; open(outname,1)) ;;<br />
<br />
<br />
<br />
<br />
fun show_cell(e) = (<br />
"\tTranslated { Translation <" + e.x + ", " + e.y + ", " + 0.0 + "> Geometry Sphere { Radius " + e.radius + " Slices 16 <br />
Stacks 16 " + "Color<" + if(e.soma) then 0 + ", " + 1.0 + ", " + 0 else if ((e.dap+0.4)*(0.5+R0_G/e.radius))< 1.0 then <br />
((e.dap+0.4)*(0.5+R0_G/e.radius)) else 1.0 fi+ ", " + 0 + ", " + 0 fi + "> } }"<br />
) ;;<br />
<br />
<br />
<br />
fun show[cpt=0](f, freq, c) = (<br />
cpt := 1 + cpt ;<br />
if (0 == cpt % freq)<br />
then (<br />
stdout << cpt << "\n" ;<br />
print_coll(f,<br />
c,<br />
show_cell,<br />
"Scene a"+cpt+" {\n",<br />
"\n",<br />
"}\nReplace { Show a"+cpt+"}\n\n")<br />
) else <undef> fi ;<br />
c<br />
) ;;<br />
<br />
// --- Etat initial ----------------------------------------------------<br />
<br />
v0 := {vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=14.0,soma=false,radius=R0_Gm} ;;<br />
v1 :={vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=DEPOT,soma=true,radius=R0_S} ;;<br />
pre_init :=<br />
v1+{x = 1.01, y = 1.023, z = 0.101},<br />
v1+{x = 0.07, y = 1.0, z = 0.095},<br />
v1+{x = 1.0, y = 0.01, z = 0.098},<br />
v1+{x = 0.52, y = 0.53, z = 0.1},<br />
v1+{x = 0.01, y = 0.02, z = 0.099},<br />
v0+{x = -0.4, y = 0.02, z = 0.099},<br />
v0+{x = 1.4, y = 0.02, z = 0.099}<br />
;;<br />
<br />
init := Meca[iter=1000](delaunayfy(D2:(), pre_init)) ;;<br />
<br />
//show(outfile, 1, init);;<br />
//system("imoview "+outname);;<br />
<br />
// --- Evolution -------------------------------------------------------<br />
<br />
fun step(sys) = (<br />
Evol(Meca(sys))<br />
) ;;<br />
<br />
step[iter=100000,interlude=show(outfile,10)](init) ;;<br />
<br />
system("./imoview_black "+outname);;<br />
!quit ;;<br />
</pre></code><br />
<br />
==Differentiation DAP dependent==<br />
<br />
<code><pre><br />
record MecaBact = {x, y, vx, vy, fx, fy, radius}<br />
and record CellBact = {dap:float, soma:bool}<br />
and record Bact = MecaBact + CellBact;;<br />
<br />
<br />
delaunay(2) D2 = (\e.(e.x, e.y)) ;;<br />
<br />
fun noise(x) = x + 0.0005 - random(0.001) ;;<br />
// --- Mechanistic-------------------------------------------------------<br />
<br />
DT := 0.05;;<br />
K := 1.0;;<br />
MU := 1.8;;<br />
R0_Gm := 0.50;; //germinal cells minmal rayon <br />
R0_G :=0.75;;<br />
R0_S := 1.00;;<br />
<br />
// interaction : the effect of the cells between each others<br />
fun interaction(ref, src) = (<br />
let X = ref.x - src.x<br />
and Y = ref.y - src.y in<br />
let dist = sqrt(X*X+Y*Y) in<br />
let spring = 0.0-K*(dist-(ref.radius+src.radius))/dist in<br />
{fx=X*spring - ref.vx*MU, fy = Y*spring - ref.vy*MU}<br />
) ;;<br />
<br />
fun add_vect(u, v) = { fx = u.fx + v.fx, fy = u.fy + v.fy } ;;<br />
fun sum(x, u, acc) = add_vect(acc, interaction(x,u)) ;;<br />
<br />
<br />
trans Meca = {<br />
e => (<br />
let f = neighborsfold(sum(e), {fx=0,fy=0}, e) in<br />
e+{ x = noise(e.x + DT*e.vx),<br />
y = noise(e.y + DT*e.vy),<br />
vx = e.vx + DT*f.fx,<br />
vy = e.vy + DT*f.fy,<br />
fx = f.fx,<br />
fy = f.fy<br />
}<br />
)<br />
} ;;<br />
<br />
<br />
// --- Growth -----------------------------------------------------<br />
<br />
<br />
DIFF := 1.0 ;;<br />
CONS := 10.0 ;;<br />
DiffP := 0.005 ;;<br />
DeathSP := 0.00001 ;;<br />
DivG := 0.00300 ;;<br />
DEPOT := 16 ;;<br />
CroitG :=0.002 ;; re<br />
CroitS :=0.007;; <br />
<br />
fun divide(b) = (<br />
b+{dap= b.dap/2, radius=R0_Gm },<br />
b + {dap= b.dap/2,x=noise(b.x),y=noise(b.y), radius=R0_Gm}<br />
) ;;<br />
<br />
<br />
<br />
trans Evol = {<br />
<br />
x / x.soma => if (random(1.0) <= DeathSP) then <undef> else if ( ( x.radius < R0_S ) & ( random(1.0) < CroitS) ) then x + {radius<br />
= x.radius + (R0_S - R0_G)/4} else x fi fi ; r)<br />
<br />
x => (<br />
let dap_diff = neighborsfold((\y.\acc.( {dap=DT*DIFF*(y.dap-x.dap) + acc.dap, n=acc.n+1} )), {dap=0.0,n=0}, x) in<br />
let dap' = if (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS >= 0 then (x.dap + dap_diff.dap/dap_diff.n) - DT*CONS else 0 fi in<br />
if (dap'<=0.0)<br />
then (<br />
if (random(1.0) <= DiffP)<br />
then x + {dap=DEPOT,soma=true,radius=x.radius} //la nouvelle cellule S a la taille de la cellule G dont elle provient<br />
else x + {dap=dap'} fi<br />
) else if x.radius >= R0_G then if ( (random(1.0) <= DivG) & dap'> 2 )then divide(x + {dap=dap'}) else (x + {dap=dap'}) fi <br />
else if random(1.0) < CroitG then x + {radius = x.radius + (R0_G - R0_Gm)/5 , dap=dap' } else x+{dap=dap'} fi fi fi <br />
) <br />
} ;;<br />
<br />
<br />
<br />
<br />
// --- Visualisation ----------------------------------------------------<br />
<br />
outname := "/tmp/sheet.imo" ;;<br />
outfile := (if (is_opened(outname)) then close(outname) else <undef> fi ; open(outname,1)) ;;<br />
<br />
<br />
<br />
<br />
fun show_cell(e) = (<br />
"\tTranslated { Translation <" + e.x + ", " + e.y + ", " + 0.0 + "> Geometry Sphere { Radius " + e.radius + " Slices 16 <br />
Stacks 16 " + "Color<" + if(e.soma) then 0 + ", " + 1.0 + ", " + 0 else if ((e.dap+0.4)*(0.5+R0_G/e.radius))< 1.0 then<br />
<br />
((e.dap+0.4)*(0.5+R0_G/e.radius)) else 1.0 fi+ ", " + 0 + ", " + 0 fi + "> } }"<br />
) ;;<br />
<br />
<br />
<br />
fun show[cpt=0](f, freq, c) = (<br />
cpt := 1 + cpt ;<br />
if (0 == cpt % freq)<br />
then (<br />
stdout << cpt << "\n" ;<br />
print_coll(f,<br />
c,<br />
show_cell,<br />
"Scene a"+cpt+" {\n",<br />
"\n",<br />
"}\nReplace { Show a"+cpt+"}\n\n")<br />
) else <undef> fi ;<br />
c<br />
) ;;<br />
<br />
// --- Etat initial ----------------------------------------------------<br />
<br />
v0 := {vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=14.0,soma=false,radius=R0_Gm} ;;<br />
v1 :={vx=0, vy=0, vz=0, fx=0, fy=0, fz=0, dap=DEPOT,soma=true,radius=R0_S} ;;<br />
pre_init :=<br />
v1+{x = 1.01, y = 1.023, z = 0.101},<br />
v1+{x = 0.07, y = 1.0, z = 0.095},<br />
v1+{x = 1.0, y = 0.01, z = 0.098},<br />
v1+{x = 0.52, y = 0.53, z = 0.1},<br />
v1+{x = 0.01, y = 0.02, z = 0.099},<br />
v0+{x = -0.4, y = 0.02, z = 0.099},<br />
v0+{x = 1.4, y = 0.02, z = 0.099}<br />
;;<br />
<br />
init := Meca[iter=1000](delaunayfy(D2:(), pre_init)) ;;<br />
<br />
//show(outfile, 1, init);;<br />
//system("imoview "+outname);;<br />
<br />
// --- Evolution -------------------------------------------------------<br />
<br />
fun step(sys) = (<br />
Evol(Meca(sys))<br />
) ;;<br />
<br />
step[iter=100000,interlude=show(outfile,10)](init) ;;<br />
<br />
system("./imoview_black "+outname);;<br />
!quit ;;<br />
</pre></code><br />
<br />
=Gillespie Based Simulation=<br />
<br />
==Global Variables==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* Global constants *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
Na := 6.0221415e23 ;;<br />
VolumeUnit := 1/Na ;;<br />
fun gamma(V) = V ;; // actually Gamma(V)=V*VolumeUnit*Na, but VolumeUnit has been choosen in such a way that Gamma(V)=V waiting for the right volume (mean volume of a germinal bacterium)<br />
<br />
K_CreD := 0.2 ;; // Cre degradation<br />
K_DAPiD := 0.2 ;; // DAP degradation<br />
K_DAPApI := 0.5 ;; // DAPAp inhibition by DAP<br />
K_DAPApA := 0.1 ;; // DAPAp desinhibition releasing a DAP molecule<br />
K_CreP1 := 1.0 ;; // Cre production (DAPAp not inhibited)<br />
K_CreP2 := 0.001 ;; // Cre production (DAPAp inhibited)<br />
K_Diff := 0.05 ;; // Differentiation<br />
K_DAPiP := 1.0 ;; // DAP production<br />
K_DAPEx := 0.5 ;; // DAP export<br />
K_DAPIm := 1.0 ;; // DAP import<br />
K_DAPeD := 0.1 ;; // DAP degradation<br />
<br />
K_Div := 0.02 ;; // Mitosis rate<br />
K_Death := 0.01 ;; // Death rate<br />
<br />
nb_dape := 0 ;; // Number of DAP molecule in the environment (initial condition)<br />
<br />
fun globals_help() = (<br />
stdout << "\n** Help of the \"global\" module **\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- Na (float): Avogadro number [6.0221415e23]\n\n" ;<br />
stdout << "\t- VolumeUnit (float): mean volume of a bacterium [1/Na]\n\n" ;<br />
stdout << "\t- K_CreD (float): Cre degradation reaction rate in bacteria [0.01]\n\n" ;<br />
stdout << "\t- K_DAPiD (float): DAP degradation reaction rate in bacteria [0.01]\n\n" ;<br />
stdout << "\t- K_DAPApI (float): DAPAp inhibition by DAP [2.0]\n\n" ;<br />
stdout << "\t- K_DAPApA (float): DAPAp re-activation [0.001]\n\n" ;<br />
stdout << "\t- K_CreP1 (float): Cre production with activated DAPAp [0.01]\n\n" ;<br />
stdout << "\t- K_CreP2 (float): Cre production with inhibited DAPAp [0.0]\n\n" ;<br />
stdout << "\t- K_Diff (float): bacteria differentition [0.1]\n\n" ;<br />
stdout << "\t- K_DAPiP (float): DAP production in bacteria [0.5]\n\n" ;<br />
stdout << "\t- K_DAPEx (float): DAP exportation [0.1]\n\n" ;<br />
stdout << "\t- K_DAPIm (float): DAP importation [0.1]\n\n" ;<br />
stdout << "\t- K_DAPeD (float): DAP degradation reaction rate in the environment [1.0]\n\n" ;<br />
<br />
stdout << "Functions\n" ;<br />
stdout << "\t- gamma(V) (float -> float):\n\t\tgamma function for reaction to stochastic constants translation\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Structure==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* State of the system *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* The system is composed of bacteria of different kinds: germinal and somatic *)<br />
(* *)<br />
(* It is modeled by nested multi-sets. The super multi-set corresponds to the environment where *)<br />
(* chemicals and bacteria are diffusing. *)<br />
(* A set of functions is added to memorize the quantity of chemicals in the system in order not *)<br />
(* to evaluate it at each time. *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
<br />
cptCre := 0 ;;<br />
cptDAPe := 0 ;;<br />
cptDAPi := 0.0 ;;<br />
cptDAP := 0 ;;<br />
cptBactS := 0 ;;<br />
cptBactG := 0 ;;<br />
cptBact := 0 ;;<br />
fun incrCre() = (cptCre := cptCre + 1) ;;<br />
fun decrCre() = (cptCre := cptCre - 1) ;;<br />
fun incrDAP() = (cptDAP := cptDAP + 1) ;;<br />
fun decrDAP() = (cptDAP := cptDAP - 1) ;;<br />
fun incrDAPe() = (cptDAPe := cptDAPe + 1) ;;<br />
fun decrDAPe() = (cptDAPe := cptDAPe - 1) ;;<br />
fun incrDAPi() = (cptDAPi := cptDAPi + 1) ;;<br />
fun decrDAPi() = (cptDAPi := cptDAPi - 1) ;;<br />
fun DAPe_DAPi() = (incrDAPi() ; decrDAPe()) ;;<br />
fun DAPi_DAPe() = (incrDAPe() ; decrDAPi()) ;;<br />
fun incrNCre(N) = (cptCre := cptCre + N) ;;<br />
fun decrNCre(N) = (cptCre := cptCre - N) ;;<br />
fun incrNDAP(N) = (cptDAP := cptDAP + N) ;;<br />
fun decrNDAP(N) = (cptDAP := cptDAP - N) ;;<br />
fun incrNDAPe(N) = (cptDAPe := cptDAPe + N) ;;<br />
fun decrNDAPe(N) = (cptDAPe := cptDAPe - N) ;;<br />
fun incrNDAPi(N) = (cptDAPi := cptDAPi + N) ;;<br />
fun decrNDAPi(N) = (cptDAPi := cptDAPi - N) ;;<br />
<br />
fun incrBact() = (cptBact := cptBact + 1) ;;<br />
fun decrBact() = (cptBact := cptBact - 1) ;;<br />
fun incrBactS() = (cptBactS := cptBactS + 1) ;;<br />
fun decrBactS() = (cptBactS := cptBactS - 1) ;;<br />
fun incrBactG() = (cptBactG := cptBactG + 1) ;;<br />
fun decrBactG() = (cptBactG := cptBactG - 1) ;;<br />
fun BactS_BactG() = (raise (`Erreur "Impossible S to G differentiation.")) ;;<br />
fun BactG_BactS() = (incrBactS() ; decrBactG()) ;;<br />
fun incrNBact(N) = (cptBact := cptBact + N) ;;<br />
fun decrNBact(N) = (cptBact := cptBact - N) ;;<br />
fun incrNBactS(N) = (cptBactS := cptBactS + N) ;;<br />
fun decrNBactS(N) = (cptBactS := cptBactS - N) ;;<br />
fun incrNBactG(N) = (cptBactG := cptBactG + N) ;;<br />
fun decrNBactG(N) = (cptBactG := cptBactG - N) ;;<br />
<br />
collection Bact = bag<br />
and constraint BactG = [~`DAP_Box]Bact<br />
and constraint BactS = [~`LOXP_Box && ~`LOXP_Box_Cre]Bact<br />
and collection Env = bag ;;<br />
<br />
id := 0 ;;<br />
fun new_bactId() = (id := id+1 ; id) ;;<br />
fun new_bact(t) = (incrBact() ; Bactify({birth=t, date=0.0, id=new_bactId(), next_state=`Unknown}::seq:()) ) ;;<br />
fun new_bactS(t) = (incrBactS() ; `DAPAp :: `DAP_Box :: new_bact(t)) ;;<br />
fun new_bactG(t) = (incrBactG() ; (*incrDAPi() ; incrDAP() ;*) `DAPAp :: `LOXP_Box :: new_bact(t)) ;;<br />
fun new_env(t, nbG, nbS) = (<br />
incrNDAP(nb_dape) ;<br />
incrNDAPe(nb_dape) ;<br />
let env = fold((\i.\acc.((new_bactG(t))::acc)),Envify(fold((\n.\acc.(`DAP::acc)),seq:(),nb_dape)), nbG) in<br />
fold((\i.\acc.((new_bactS(t))::acc)),env, nbS)<br />
) ;;<br />
fun map_bact(f,env) = (<br />
map((\e.(if Bact(e) then f(e) else e fi)),env) //update_bact<br />
) ;;<br />
<br />
fun divide_bactG(t,b,id) = (<br />
let id' = new_bactId() in<br />
let nbDAP = count(`DAP,b)<br />
and nbCre = count(`Cre,b) in<br />
let bact1_core = Bactify({birth=t, date=0.0, id=id, next_state=`Unknown}::seq:())<br />
and bact2_core = Bactify({birth=t, date=0.0, id=id', next_state=`Unknown}::seq:()) in<br />
let bact1_core = fold((\n.\acc.(`DAP::acc)),bact1_core,nbDAP/2)<br />
and bact2_core = fold((\n.\acc.(`DAP::acc)),bact2_core,nbDAP - nbDAP/2) in<br />
let bact2_core = fold((\n.\acc.(`Cre::acc)),bact2_core,nbCre/2)<br />
and bact1_core = fold((\n.\acc.(`Cre::acc)),bact1_core,nbCre - nbCre/2) in<br />
let bact1_core = if (member(`DAPAp_i,b)) then (`DAPAp_i) else (`DAPAp) fi :: bact1_core<br />
and bact2_core = `DAPAp :: bact2_core in<br />
let bact2_core = if (member(`LOXP_Box_Cre,b)) then (`LOXP_Box_Cre) else (`LOXP_Box) fi :: bact2_core<br />
and bact1_core = `LOXP_Box :: bact1_core in<br />
bact1_core :: bact2_core :: seq:()<br />
) ;;<br />
<br />
fun set_DAPe(N,env) = (<br />
let dDAP = cptDAPe - N in<br />
if (dDAP > 0)<br />
then (<br />
(* cptDAPe > N : trop de DAP *)<br />
cptDAPe := N ;<br />
cptDAP := cptDAP - dDAP ;<br />
diff(env, fold((\n.\acc.(`DAP::acc)),Env:(),dDAP))<br />
)<br />
else (<br />
if (dDAP < 0)<br />
then (<br />
(* cptDAPe < N : pas assez de DAP *)<br />
cptDAPe := N ;<br />
cptDAP := cptDAP - dDAP ;<br />
join(env, fold((\n.\acc.(`DAP::acc)),Env:(),-1*dDAP))<br />
)<br />
else (env) fi<br />
) fi<br />
) ;;<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
fun static_help() = (<br />
stdout << "\n** Help of the \"static\" module **\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- cptCre (cptCre): `Cre counter\n\n" ;<br />
stdout << "\t- cptDAP (cptDAP): `DAP counter\n\n" ;<br />
stdout << "\t- cptDAPe (cptDAPe): `DAP counter (in the environment)\n\n" ;<br />
stdout << "\t- cptDAPi (cptDAPi): `DAP counter (in bacteria)\n\n" ;<br />
stdout << "\t- cptBact (cptBact): bacteria counter\n\n" ;<br />
stdout << "\t- cptBactG (cptBactG): germinal bacteria counter\n\n" ;<br />
stdout << "\t- cptBactS (cptBactS): somatic bacteria counter\n\n" ;<br />
<br />
stdout << "Functions\n" ;<br />
stdout << "\t- incrCre() (unit -> int):\n\t\tincrement cptCre\n\n" ;<br />
stdout << "\t- decrCre() (unit -> int):\n\t\tdecrement cptCre\n\n" ;<br />
stdout << "\t- incrDAP() (unit -> int):\n\t\tincrement cptDAP\n\n" ;<br />
stdout << "\t- decrDAP() (unit -> int):\n\t\tdecrement cptDAP\n\n" ;<br />
stdout << "\t- incrDAPe() (unit -> int):\n\t\tincrement cptDAPe\n\n" ;<br />
stdout << "\t- decrDAPe() (unit -> int):\n\t\tdecrement cptDAPe\n\n" ;<br />
stdout << "\t- incrDAPi() (unit -> int):\n\t\tincrement cptDAPi\n\n" ;<br />
stdout << "\t- decrDAPi() (unit -> int):\n\t\tdecrement cptDAPi\n\n" ;<br />
stdout << "\t- DAPe_DAPi() (unit -> int):\n\t\tdecrement cptDAPe, increment cptDAPi\n\n" ;<br />
stdout << "\t- DAPi_DAPe() (unit -> int):\n\t\tdecrement cptDAPi, increment cptDAPe\n\n" ;<br />
stdout << "\t- incrBact() (unit -> int):\n\t\tincrement cptBact\n\n" ;<br />
stdout << "\t- decrBact() (unit -> int):\n\t\tdecrement cptBact\n\n" ;<br />
stdout << "\t- incrBactG() (unit -> int):\n\t\tincrement cptBactG\n\n" ;<br />
stdout << "\t- decrBactG() (unit -> int):\n\t\tdecrement cptBactG\n\n" ;<br />
stdout << "\t- incrBactS() (unit -> int):\n\t\tincrement cptBactS\n\n" ;<br />
stdout << "\t- decrBactS() (unit -> int):\n\t\tdecrement cptBactS\n\n" ;<br />
stdout << "\t- BactG_BactS() (unit -> int):\n\t\tdecrement cptBactG, increment cptBactS\n\n" ;<br />
<br />
stdout << "\t- new_Bact(t) (float -> Bact):\n\t\tcreate a new bacterium at time t\n\n" ;<br />
stdout << "\t- new_BactG(t) (float -> BactG):\n\t\tcreate a new germinal bacterium at time t\n\n" ;<br />
stdout << "\t- new_BactS(t) (float -> BactS):\n\t\tcreate a new somatic bacterium at time t\n\n" ;<br />
stdout << "\t- new_env(t,ng,ns) (float * int * int -> Env):\n\t\tcreate a new environment containing ng germinal bacteria and ns somatic bacteria at time t\n\n" ;<br />
stdout << "\t- map_bact(f,env) ((Bact -> Bact) * Env -> Env):\n\t\tapply the function f on each bacterium of env\n\n" ;<br />
stdout << "\t- set_DAPe(N,env) (int * Env -> Env):\n\t\tchange env, cptDAP and cptDAPe to N `DAP\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Scheduling==<br />
<code><pre><br />
constraint schedule = `Empty_SC | schedule_entry<br />
<br />
and record schedule_entry = { date:float, id:int, sc:schedule, rule:int } ;;<br />
<br />
fun schedule_empty() = `Empty_SC ;;<br />
<br />
fun schedule_add_entry(id,date,rule,sc) = (<br />
switch (sc)<br />
case `Empty_SC : {date=date,id=id,rule=rule,sc=sc}<br />
default : (<br />
if (sc.date > date)<br />
then {date=date,id=id,rule=rule,sc=sc}<br />
else {date=sc.date,id=sc.id,rule=sc.rule,sc=schedule_add_entry(id,date,rule,sc.sc)} fi<br />
)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_remove_entry(id,sc) = (<br />
switch (sc)<br />
case `Empty_SC : `Empty_SC<br />
default : (<br />
if (sc.id == id)<br />
then sc.sc<br />
else {date=sc.date,id=sc.id,rule=sc.rule,sc=schedule_remove_entry(id,sc.sc)} fi<br />
)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_size(sc) = (<br />
switch (sc)<br />
case `Empty_SC : 0<br />
default : 1 + schedule_size(sc.sc)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_replace_entry(id,date,rule,sc) = (<br />
switch (sc)<br />
case `Empty_SC : {date=date,id=id,rule=rule,sc=sc}<br />
default : (<br />
if (sc.id == id)<br />
then schedule_add_entry(id,date,rule,sc.sc)<br />
else (<br />
if (sc.date > date)<br />
then {date=date,id=id,rule=rule,sc=schedule_remove_entry(id,sc)}<br />
else {date=sc.date,id=sc.id,rule=sc.rule,sc=schedule_replace_entry(id,date,rule,sc.sc)} fi<br />
) fi<br />
)<br />
endswitch<br />
) ;;<br />
<br />
fun schedule_remove_first_entry(sc) = sc.sc ;;<br />
<br />
fun schedule_print(sc) = (<br />
switch (sc)<br />
case `Empty_SC : stdout << "\n"<br />
default : (<br />
stdout << sc.id << "\t(" << sc.rule << ", " << sc.date << ") \n" ;<br />
schedule_print(sc.sc)<br />
)<br />
endswitch<br />
) ;;<br />
<br />
schedule := schedule_empty() ;;<br />
<br />
fun schedule_help() = (<br />
stdout << "\n** Help of the \"schedule\" module **\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- schedule (schedule): the main schedule initilized with value `Empty_SC\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- schedule_empty() (unit -> schedule):\n\t\treturns the empty schedule\n\n" ;<br />
stdout << "\t- schedule_add_entry(id,d,r,sc) (int * float * int * schedule -> schedule):\n\t\tadd an entry in the schedule sc corresponding to the\n\t\tapplication of the rule r on the bacterium id at the date d\n\n" ;<br />
stdout << "\t- schedule_add_entry(id,d,r,sc) (int * float * int * schedule -> schedule):\n\t\treplace (or add if not existing) an entry in the\n\t\tschedule sc corresponding to the application of the rule r on the bacterium id at the date d\n\n" ;<br />
stdout << "\t- schedule_remove_entry(id,sc) (int * schedule -> schedule):\n\t\tremove in sc the first occurence of an event in bacterium id\n\n" ;<br />
stdout << "\t- schedule_remove_first(sc) (schedule -> schedule):\n\t\tremove the first entry of sc\n\n" ;<br />
stdout << "\t- schedule_print(sc) (schedule -> stdout):\n\t\tprint sc\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Dynamics==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* Dynamics of the system *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* It exists two kinds of dynamics. The first is related to the chemical reactions that occur *)<br />
(* everywhere in the system (inside and outside the bacteria + transport of proteins between the *)<br />
(* outside and inside). This parts will be simulated using a sotchastic process based on the *)<br />
(* Gillespie's algorithm. The second part of the dynamics to be modeled corresponds to the *)<br />
(* bacteria behavior like divisions and cells death. In fact, a lot of processes appearing in *)<br />
(* bacteria and belonging to their normal dynamics are skipped/abstracted as functions of the *)<br />
(* chemical state of bacteria. For example, a too high concentration of DAP is lethal ; we *)<br />
(* reprensent this dependance by a function that deletes all bacteria where the threshold is *)<br />
(* exceeded. These behavior functions have to be evaluated after each chemical update. *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
<br />
constraint ruleId = `CreD | `DAPiD | `DAPApI | `DAPApA | `CreP1 | `CreP2 | `Diff1 | `Diff2 | `DAPiP | `DAPEx | `DAPIm | `DAPeD | `Div | `Death | `Unknown ;;<br />
<br />
fun fstOrder(k,v) = k ;;<br />
fun sndOrder(k,v) = k/gamma(v) ;;<br />
<br />
//fun count(p,c) = fold((\e.\acc.(acc + if p(e) then 1 else 0 fi)),0,c) ;;<br />
//fun countAll(p1,p2,c) = fold((\e.\acc.(acc + if p2(e) then count(p1,e) else 0 fi)),0,c) ;;<br />
<br />
<br />
appliedBactRule := `Unkown ;;<br />
trans inBact = {<br />
<br />
(* Chemicals degradation *)<br />
`Cre ={ C = fstOrder(K_CreD,1.0) }=> (appliedBactRule := `CreD ; <undef>) ;<br />
`DAP ={ C = fstOrder(K_DAPiD,1.0) }=> (appliedBactRule := `DAPiD ; <undef>) ;<br />
<br />
(* Promotor activity *)<br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> (appliedBactRule := `DAPApI ; `DAPAp_i) ;<br />
`DAPAp_i ={ C = fstOrder(K_DAPApA,1.0) }=> (appliedBactRule := `DAPApA ; `DAPAp, `DAP) ;<br />
`DAPAp ={ C = \c.(fstOrder(K_CreP1* if (member(`DAP,c)) then 1.0 else 1.0 fi,1.0)) }=> (appliedBactRule := `CreP1 ; `DAPAp, `Cre) ;<br />
`DAPAp_i ={ C = fstOrder(K_CreP2,1.0) }=> (appliedBactRule := `CreP2 ; `DAPAp_i, `Cre) ;<br />
<br />
(* Differentiation *)<br />
`LOXP_Box, `Cre ={ C = sndOrder(2.0*K_Diff,1.0) }=> (appliedBactRule := `Diff1 ; `LOXP_Box_Cre) ;<br />
`LOXP_Box_Cre, `Cre ={ C = sndOrder(K_Diff,1.0) }=> (appliedBactRule := `Diff2 ; `DAP_Box) ;<br />
<br />
(* DAP production (exclusively for somatic cells) *)<br />
`DAP_Box ={ C = fstOrder(K_DAPiP,1.0) }=> (appliedBactRule := `DAPiP ; `DAP_Box, `DAP) ;<br />
<br />
(* DAP externalization *)<br />
`DAP ={ C = fstOrder(K_DAPEx,1.0) }=> (appliedBactRule := `DAPEx ; return(`DAP :: (diff(self,`DAP)) :: seq:())) ;<br />
<br />
} ;;<br />
<br />
appliedEnvRule := `Unkown ;;<br />
nbReleasedDAP := 0 ;;<br />
deadBactId := -1 ;;<br />
trans inEnv[upBact,current_t,current_sc] = {<br />
<br />
(* DAP internalization *)<br />
`DAP, b:Bact ={ A = (\c.(sndOrder(K_DAPIm,1.0) * cptDAPe * cptBact)) }=> (appliedEnvRule := `DAPIm ; (upBact(current_sc,(`DAP :: b))) ) ;<br />
<br />
(* DAP external degradation *)<br />
`DAP ={ C = fstOrder(K_DAPeD,1.0) }=> (appliedEnvRule := `DAPeD ; <undef>) ;<br />
<br />
(* BactS death *)<br />
(x:BactS \/ {id=id}) as b ={ A = (\c.(fstOrder(K_Death,1.0)*cptBactS)) }=> (<br />
let nbDAP = count(`DAP,b) in<br />
nbReleasedDAP := nbDAP ;<br />
appliedEnvRule := `Death ;<br />
deadBactId := id ;<br />
map((\e.(`DAP)),iota(nbDAP,seq:()))<br />
) ;<br />
<br />
(* BactG mitosis *)<br />
(_:BactG \/ ({id=id})) as b ={ A = (\c.(fstOrder(K_Div,1.0)*cptBactG)) }=> (<br />
appliedEnvRule := `Div ;<br />
let b1b2 = divide_bactG(current_t+'tau,b,id) in<br />
let b1 = upBact(current_sc,b1b2.(0)) in<br />
let b2 = upBact(schedule,b1b2.(1)) in<br />
b1 :: (b2 :: seq:())<br />
) ;<br />
<br />
} ;;<br />
<br />
fun cptUpdate[nbRD](r) = ( // Stochiometric update for the output<br />
switch (r)<br />
case `CreD: decrCre()<br />
case `DAPiD: (decrDAPi() ; decrDAP())<br />
case `DAPApI: (decrDAPi() ; decrDAP())<br />
case `DAPApA: (incrDAPi() ; incrDAP())<br />
case `CreP1: incrCre()<br />
case `CreP2: incrCre()<br />
case `Diff1: decrCre()<br />
case `Diff2: (decrCre(); BactG_BactS())<br />
case `DAPiP: (incrDAPi() ; incrDAP())<br />
case `DAPEx: DAPi_DAPe()<br />
case `DAPIm: DAPe_DAPi()<br />
case `DAPeD: (decrDAPe() ; decrDAP())<br />
case `Death: (decrNDAPi(nbRD) ; incrNDAPe(nbRD) ; decrBactS() ; decrBact())<br />
case `Div: (incrBactG() ; incrBact())<br />
default: raise (`Erreur ("Diet_coli: Not yet implemented: rule "+r))<br />
endswitch<br />
) ;;<br />
<br />
<br />
<br />
<br />
<br />
fun dynamic_help() = (<br />
stdout << "\n** Help of the \"dynamic\" module **\n\n" ;<br />
stdout << "Requirements\n" ;<br />
stdout << "\t- module \"globals\"\n" ;<br />
stdout << "\t- module \"static\"\n\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- appliedBactRule (ruleId): takes the id of a rule after the application of inBact [`Ùnknown]\n\n" ;<br />
stdout << "\t- appliedEnvRule (ruleId): takes the id of a rule after the application of inEnv [`Ùnknown]\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- fstOrder(k,v) (float * float -> float):\n\t\tkinetics to stochastic conversion\n\n" ;<br />
stdout << "\t- sndOrder(k,v) (float * float -> float):\n\t\tkinetics to stochastic conversion\n\n" ;<br />
stdout << "\t- sndOrder(k,v) (float * float -> float):\n\t\tkinetics to stochastic conversion\n\n" ;<br />
stdout << "\t- inBact(b) (Bact -> Bact | `DAP*Bact):\n\t\tchemical reactions in bacteria ; to be applied with strategy `gillespie\n\n" ;<br />
stdout << "\t- inEnv[update_bact(Bact -> Bact)](e) (Env -> Env):\n\t\tchemical reactions in environment ; the option update_bact is to update the state of a bacterium modified by the application of the rule\n\n" ;<br />
stdout << "\t- cptUpdate(r) (ruleId -> unit):\n\t\tupdate of the global counters from \"static\" w.r.t. the applied rule r\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==ExtSSA==<br />
<code><pre><br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* System evolution algorithm *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
(* The model is a one depth level P system. Our alogrithm consists in applying the gillespie SSA *)<br />
(* on each bacterium. A bacterium contains the current state together with the next step and the *)<br />
(* corresponding reaction delay. The SSA is applied on the environment providing a reaction time. *)<br />
(* The evolution is done where the delay is the smallest. *)<br />
(* ********************************************************************************************** *)<br />
(* ********************************************************************************************** *)<br />
<br />
trans no_next_state = { { next_state } as x => x + { next_state = `Unknown, date=0.0 } } ;;<br />
<br />
trans update_bact[t,sc] = {<br />
{ id=id } as x => (<br />
let date = 0.0 in<br />
let nx_state = inBact[strategy=`gillespie,<br />
postlude=(\c.(date := t+'tau ; c)),<br />
iter=1](no_next_state(self))<br />
in<br />
schedule := schedule_replace_entry(id,date,appliedBactRule,sc) ;<br />
appliedBactRule := `Unkown ;<br />
x + { date=date, next_state = nx_state }<br />
)<br />
} ;;<br />
<br />
trans evolve_bact[t,sc,idEv] = {<br />
((b:Bact \/ ({id=x,next_state=nxs}))) as bb / (idEv == x) => (<br />
if (Bact(nxs))<br />
then update_bact[t=t,sc=sc](nxs)<br />
else (nxs.(0)::(update_bact[t=t,sc=sc](nxs.(1)) :: seq:())) fi<br />
)<br />
} ;;<br />
<br />
fun step[get_global_time,set_global_time,sc](env) = (<br />
t := get_global_time() ;<br />
let date' = 0.0 in<br />
let env' = inEnv[upBact=(\sc.\x.(let t' = t+'tau in update_bact[t=t',sc=sc,strategy=`default](x))),<br />
current_t = t,<br />
current_sc = sc,<br />
strategy=`gillespie,<br />
postlude=(\c.(date' := t + 'tau ; c)),<br />
iter=1](env)<br />
in<br />
//!! (stdout << "schedule.date=" << schedule.date << " > date'=" << date' << "\n" ; (date' == infinity) || (date' < schedule.date)) ;<br />
if (date' < sc.date)<br />
then (<br />
//stdout << "envionment evolution (applied rule = " << appliedEnvRule << "(" << nbReleasedDAP << "), date = " << date' << "(" << t << "))\n" ;<br />
cptUpdate[nbRD=nbReleasedDAP](appliedEnvRule) ;<br />
schedule := if (appliedEnvRule==`Death) then schedule_remove_entry(deadBactId,schedule) else schedule fi ;<br />
nbReleasedDAP := 0 ;<br />
deadBactId := -1 ;<br />
appliedEnvRule := `Unkown<br />
)<br />
else (<br />
//stdout << "bacterium evolution (id = " << sc.id << ", applied rule = " << sc.rule << ", date = " << sc.date << "(" << t << "))\n" ;<br />
cptUpdate(sc.rule) ;<br />
nbReleasedDAP := 0 ;<br />
deadBactId := -1 ;<br />
appliedEnvRule := `Unkown ;<br />
date' := sc.date ;<br />
env' := evolve_bact[strategy=`asynchronous,sc=sc,idEv=sc.id,t=date'](env)<br />
) fi ;<br />
//stdout << env' << "\n" ;<br />
sc := schedule ;<br />
set_global_time(date') ;<br />
env'<br />
) ;;<br />
<br />
<br />
fun evol_algo_help() = (<br />
stdout << "\n** Help of the \"evol_algo\" module **\n\n" ;<br />
stdout << "Requirements\n" ;<br />
stdout << "\t- module \"schedule\"\n" ;<br />
stdout << "\t- module \"dynamic\"\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- update_bact[t=t(float),sc=sc(schedule)](b) (Bact -> Bact):\n\t\tcompute the next Gillespie step of a bacterium b. The schedule sc is updated and the new value of sc is returned in the global variable schedule. The option t has to be set to the global date.\n\n" ;<br />
stdout << "\t- evolve_bact[t=t(float),sc=sc(schedule),idEv=id(int)](env) (Env -> Env):\n\t\tmake the bacterium with identifiant id evolve. The schedule sc is updated and the new value of sc is returned in the global variable schedule. The option t has to be set to the global date.\n\n" ;<br />
stdout << "\t- step[t=t(float),sc=sc(schedule)](env) (Env -> Env):\n\t\tOne step evolution of the whole system. The earliest event is applied in the environment env w.r.t. the schedule sc. The option t has to be set to the global date.\n\n"<br />
<br />
) ;;<br />
</pre></code><br />
<br />
==Output for Gnuplot==<br />
<code><pre><br />
GPoutput := "/tmp/sortie.dat" ;;<br />
PNGoutput := "/tmp/sortie.png" ;;<br />
gnuplot := "/usr/bin/gnuplot" ;;<br />
<br />
fun export_cpt[get_global_time](freq, env) = (<br />
if (('iteration % freq) == 0)<br />
then (<br />
let tg = get_global_time() in<br />
GPoutput << get_global_time() << "\t" <<<br />
cptCre << "\t" <<<br />
cptDAP << "\t" <<<br />
cptDAPe << "\t" <<<br />
(cptDAPi/cptBact) << "\t" <<<br />
cptBact << "\t" <<<br />
cptBactS << "\t" <<<br />
cptBactG << "\n" ;<br />
stdout << "Iteration: " << 'iteration << " and Global time: " << tg << " and bacteria population: " << cptBact << " (G/S = " << cptBactG << "/" << cptBactS << ")\n"<br />
)<br />
else <undef> fi ;<br />
env<br />
) ;;<br />
<br />
fun dataToPng() = (<br />
gnuplot << "set key outside\n";<br />
gnuplot << "set xlabel \"Time (arbitrary unit)\"\n";<br />
gnuplot << "set ylabel \"Number of molecules or structures\"\n";<br />
gnuplot << "set output \""+ PNGoutput + "\"\n";<br />
gnuplot << "set term png\n";<br />
<br />
gnuplot << "plot " +<br />
"\""+ GPoutput +"\" using 1:4 title ' DAPe' with lines 3," +<br />
"\""+ GPoutput +"\" using 1:5 title ' DAPi' with lines 4," +<br />
"\""+ GPoutput +"\" using 1:6 title ' Bact' with lines 5," +<br />
"\""+ GPoutput +"\" using 1:7 title ' BactS' with lines 6," +<br />
"\""+ GPoutput +"\" using 1:8 title ' BactG' with lines 7" +<br />
"" ;<br />
gnuplot << "\nquit" ;<br />
gnuplot << "\n"<br />
<br />
) ;;<br />
<br />
fun dataToPngDAP() = (<br />
gnuplot << "set key outside\n";<br />
gnuplot << "set xlabel \"Time (arbitrary unit)\"\n";<br />
gnuplot << "set ylabel \"Number of molecules or structures\"\n";<br />
gnuplot << "set output \""+ PNGoutput + "\"\n";<br />
gnuplot << "set term png\n";<br />
<br />
gnuplot << "plot " +<br />
"\""+ GPoutput +"\" using 1:5 title ' DAPi' with lines 4" +<br />
"" ;<br />
gnuplot << "\nquit" ;<br />
gnuplot << "\n"<br />
<br />
) ;;<br />
<br />
fun dataToPngBact() = (<br />
gnuplot << "set key outside\n";<br />
gnuplot << "set xlabel \"Time (arbitrary unit)\"\n";<br />
gnuplot << "set ylabel \"Number of molecules or structures\"\n";<br />
gnuplot << "set output \""+ PNGoutput + "\"\n";<br />
gnuplot << "set term png\n";<br />
<br />
gnuplot << "plot " +<br />
"\""+ GPoutput +"\" using 1:6 title ' Bact' with lines 5," +<br />
"\""+ GPoutput +"\" using 1:7 title ' BactS' with lines 6," +<br />
"\""+ GPoutput +"\" using 1:8 title ' BactG' with lines 7" +<br />
"" ;<br />
gnuplot << "\nquit" ;<br />
gnuplot << "\n"<br />
<br />
) ;;<br />
<br />
fun output_help() = (<br />
stdout << "\n** Help of the \"output\" module **\n\n" ;<br />
stdout << "Requirements\n" ;<br />
stdout << "\t- module \"static\"\n" ;<br />
stdout << "Globals\n" ;<br />
stdout << "\t- GPoutput (string): Gnuplot formatted output file [\"/tmp/sortie.dat\"]\n\n" ;<br />
stdout << "\t- PNGoutput (string): PNG file for Gnuplot exporting (see function dataToPng) [\"/tmp/sortie.png\"]\n\n" ;<br />
stdout << "\t- gnuplot (string): absolute path to Gnuplot executable [\"/usr/bin/gnuplot\"]\n\n" ;<br />
stdout << "Functions\n" ;<br />
stdout << "\t- export_cpt[get_global_time](freq, env) (int * Env -> Env):\n\t\tExport in GPoutput the state of global module counters (to be used as interlude of an iterated function)\n\n" ;<br />
stdout << "\t- dataToPng() (unit -> unit):\n\t\texport GPoutput to the PNG file PNGoutput using Gnuplot (located at path gnuplot)\n\n"<br />
) ;;<br />
</pre></code><br />
<br />
==Main program==<br />
<code><pre><br />
!set match_random := 100 ;;<br />
<br />
duration := 1500.0 ;;<br />
gt := 0.0 ;; //global time<br />
fun ggt() = gt ;; //global time set and get function... an assert is used to check that time only increases<br />
fun sgt(x) = (!! (gt <= x) ; gt := x) ;;<br />
<br />
!include "globals.mgs" ;;<br />
!include "static.mgs" ;;<br />
!include "schedule.mgs" ;;<br />
!include "dynamic.mgs" ;;<br />
!include "evol_algo.mgs" ;;<br />
!include "output.mgs" ;;<br />
<br />
schedule := schedule_empty() ;;<br />
<br />
env := map_bact((\b.(update_bact[t=gt,sc=schedule](b))),new_env(gt,10,0)) ;;<br />
<br />
step[fixpoint=(\c1.\c2.(gt > duration || cptBact == 0)), interlude=B(export_cpt[get_global_time=ggt](10),I(*set_DAPe(nb_dape)*)), sc=schedule, get_global_time=ggt, set_global_time=sgt](env) ;;<br />
<br />
dataToPng() ;;<br />
</pre></code></div>Spicherhttp://2007.igem.org/wiki/index.php/Template:Paris_menu_modelingTemplate:Paris menu modeling2007-10-26T16:34:55Z<p>Spicher: </p>
<hr />
<div>{{Template:Paris_menu}}<br><br />
<html><br />
<style type="text/css"><br />
#navmenu ul{<br />
list-style: none;<br />
}<br />
#navmenu ul li{<br />
display: inline;<br />
padding: 5px 5px 3px 5px;<br />
border: thin solid black;<br />
background-color: Lavender ;<br />
}<br />
#navmenu a {<br />
font-size: 10pt;<br />
font-family: "Lucida Grande", Verdana, arial, sans-serif;<br />
text-decoration: none;<br />
color: DarkBlue;<br />
}<br />
#navmenu a:hover {<br />
color: #FF6633;<br />
}<br />
#navmenu img {<br />
height: 100px;<br />
width: 150px;<br />
}<br />
</style><br />
<br />
<div id=navmenu><br />
<br />
<center><a href='https://2007.igem.org/Paris'><br />
<ul><br />
<!--li><a href='https://2007.igem.org/Paris/Project_Description'> Project Description</a></li--><br />
<li><a href='https://2007.igem.org/Paris/Modeling'> Introduction</a></li><br />
<li><a href='https://2007.igem.org/Paris/Modeling#Proof_of_Principle:_Qualitative_Analysis_of_System.27s_Behavior'> Proof of principle</a></li><br />
<li><a href='https://2007.igem.org/Paris/Modeling#Assessing_Robustness_and_Optimizing_System.27s_Behavior:_Quantitative_Analysis'> Quantitative aspects</a></li><br />
<li><a href='https://2007.igem.org/Paris/Modeling#Summary'>Summary</a></li><br />
<li><a href='https://2007.igem.org/Paris/Modeling#Appendix'>Appendix</a></li><br />
</ul><br />
<br />
</div><br />
</center><br />
</html></div>Spicherhttp://2007.igem.org/wiki/index.php/Template:Paris_menu_modelingTemplate:Paris menu modeling2007-10-26T16:33:54Z<p>Spicher: </p>
<hr />
<div>{{Template:Paris_menu}}<br><br />
<html><br />
<style type="text/css"><br />
#navmenu ul{<br />
list-style: none;<br />
}<br />
#navmenu ul li{<br />
display: inline;<br />
padding: 5px 5px 3px 5px;<br />
border: thin solid black;<br />
background-color: Lavender ;<br />
}<br />
#navmenu a {<br />
font-size: 10pt;<br />
font-family: "Lucida Grande", Verdana, arial, sans-serif;<br />
text-decoration: none;<br />
color: DarkBlue;<br />
}<br />
#navmenu a:hover {<br />
color: #FF6633;<br />
}<br />
#navmenu img {<br />
height: 100px;<br />
width: 150px;<br />
}<br />
</style><br />
<br />
<div id=navmenu><br />
<br />
<center><a href='https://2007.igem.org/Paris'><br />
<ul><br />
<!--li><a href='https://2007.igem.org/Paris/Project_Description'> Project Description</a></li--><br />
<li><a href='https://2007.igem.org/Paris/Modeling'> Introduction</a></li><br />
<li><a href='https://2007.igem.org/Paris/Modeling#Proof_of_Principle:_Qualitative_Analysis_of_System.27s_Behavior'> Proof of principle</a></li><br />
<li><a href='https://2007.igem.org/Paris/Modeling#Assessing_robustness_and_optimizing_system.27s_behavior:_quantitative_analysis'> Quantitative aspects</a></li><br />
<li><a href='https://2007.igem.org/Paris/Modeling#Summary'>Summary</a></li><br />
<li><a href='https://2007.igem.org/Paris/Modeling#Appendix'>Appendix</a></li><br />
</ul><br />
<br />
</div><br />
</center><br />
</html></div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T16:32:36Z<p>Spicher: /* Assessing robustness and optimizing system's behavior: quantitative analysis */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for Modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== Questions of Interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section 2). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of Principle: Qualitative Analysis of System's Behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing Robustness and Optimizing System's Behavior: Quantitative Analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part 2, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part 3, our results indicated that the system’s behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. <br />
<br />
We would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of the MGS programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T16:30:32Z<p>Spicher: </p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for Modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== Questions of Interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section 2). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of Principle: Qualitative Analysis of System's Behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing robustness and optimizing system's behavior: quantitative analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part 2, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part 3, our results indicated that the system’s behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. <br />
<br />
We would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of the MGS programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T16:24:55Z<p>Spicher: /* SMB in Terms of Compartments and Chemical Reactions */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
[[Image:Modelsimpl.png|left|400px|right]]<br />
We start from the same representation of the system as presented in the [[Paris/Robustness_and_optimization|ODE based simulation]]. Obviously, bacteria are represented by compartments that contain molecules as shown on the picture of the previous section. Let now consider the figure next to this text in order to sum up the different molecules we have to deal with:<br />
<br />
* DAP: it is of course one of the major components of the system. It can be located in the bacteria or out of them in the environment. <br />
<br />
* Cre: it is the second main molecule to be considered. It remains in cells and cannot be exported or imported. <br />
<br />
* DNA: we focus only on the two parts of the DNA we are interested in:<br />
<br />
:* Both types of cell are able to produce Cre. This encoding region is under the control of a constitutive promoter. We then consider a molecule DAPAp that is an abstract representation of this part of the DNA. Thus every cell contains a DAPAp molecule. Following the two possible behaviors we consider, DAPAp can be inhibited or not by DAP (here is controlled the DAP (in)dependence of the differentiation). If the case occurs, the inhibited form of DAPAp is named DAPAp_i.<br />
<br />
:* The germ cells differentiate using a Cre controlled recombination of a DNA part. This part have two different states as the considered cell is either differentiated (somatic cell) or not (germ cells). See [[Paris/DesignProcess#How_will_auxotroph_germ_line_cells_differentiate_into_prototroph_somatic_cells.3F|here]] for a biological description of this mechanism. We can call these states LOX_Box for germ cells (the DNA part uses a LOX-Cre mechanism to recombine) and DAP_Box for somatic cells (after recombination the DNA is able to produce DAP). Once again each cell has to contain one molecule of DAP_Box or one molecule of LOX_Box.<br />
<br />
The other components are of course bacteria compartment. The two kinds of compartment differ only by the presence of either LOX_Box for germ cells or DNA_Box for soma cells. Using these molecules, we are able to model the dynamics by chemical reactions.<br />
<br />
<html><u>DAP and Cre degradation:</u></html><br />
<code><br />
Cre -><sub>K_CreD</sub> .<br />
DAP -><sub>K_DAPD</sub> .<br />
</code><br />
<br />
<html><u>DAPAp promoter activity for DAP dependence differentiation:</u></html> these rules prevent the production of Cre when DAP inhibits DAPAp<br />
<code><br />
DAPAp + DAP -><sub>K_DAPApI</sub> DAPAp_i<br />
DAPAp_i -><sub>K_DAPApA</sub> DAPAp + DAP<br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
<html><u>DAPAp promoter activity for independent differentiation:</u></html> DAPAp is never inhibited<br />
<code><br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
<html><u>Differentiation:</u></html> note that the differentiation is irreversible. Molecules of Cre have to bind the both LOX sites of the LOX_BOX. We name <code>LOXP_Box<sub>Cre</sub></code> the intermediary state<br />
<code><br />
LOXP_Box<sub> </sub> + Cre -><sub>K_Diff</sub> LOXP_Box<sub>Cre</sub><br />
LOXP_Box<sub>Cre</sub> + Cre -><sub>K_Diff</sub> DAP_Box<br />
</code><br />
<br />
<html><u>DAP production:</u></html> this only happens in somatic cells, germ cell does not contain DAP_Box. Therefore, only somatic cells are to feed germ cells<br />
<code><br />
DAP_Box -><sub>K_DAPiP</sub> DAP_Box + DAP<br />
</code><br />
<br />
<html><u>DAP import and export:</u></html> these rules are applied in the environment. The square brackets represent compartments (for example <code>[...]<sub>BactS</sub></code> is a somatic cell)<br />
<code><br />
[DAP, ...]<sub>Bact</sub> -><sub>K_DAPEx</sub> DAP + [...]<sub>Bact</sub><br />
DAP + [...]<sub>Bact</sub> -><sub>K_DAPIm</sub> [DAP, ...]<sub>Bact</sub><br />
</code><br />
<br />
<html><u>Bacteria macroscopic evolutions (division and death):</u></html> when a bacterium dies, its internal DAP molecules are released in the environment. As DAP is essential for germ cells division, we can envisage that the value of the kinetic constant <code>K_Div</code> is a function of the number <code>''n''</code> of DAP molecule in the cell<br />
<code><br />
[''n''.DAP, ...]<sub>BactG</sub> -><sub>K_Div </sub> [(''n''/2).DAP, ...]sub>BactG</sub> + [(''n''/2).DAP, ...]sub>BactG</sub><br />
[''n''.DAP, ...]<sub>Bact </sub> -><sub>K_Death</sub> ''n''.DAP<br />
</code><br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific [[Paris/mgs#Rules_Application_Strategies|rules application strategy]] implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T15:45:21Z<p>Spicher: /* SMB in Terms of Compartments and Chemical Reactions */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
[[Image:Modelsimpl.png|left|400px|right]]<br />
We start from the same representation of the system as presented in the [[Paris/Robustness_and_optimization|ODE based simulation]]. Obviously, bacteria are represented by compartments that contain molecules as shown on the picture of the previous section. Let now consider the figure next to this text in order to sum up the different molecules we have to deal with:<br />
<br />
* DAP: it is of course one of the major components of the system. It can be located in the bacteria or out of them in the environment. <br />
<br />
* Cre: it is the second main molecule to be considered. It remains in cells and cannot be exported or imported. <br />
<br />
* DNA: we focus only on the two parts of the DNA we are interested in:<br />
<br />
:* Both types of cell are able to produce Cre. This encoding region is under the control of a constitutive promoter. We then consider a molecule DAPAp that is an abstract representation of this part of the DNA. Thus every cell contains a DAPAp molecule. Following the two possible behaviors we consider, DAPAp can be inhibited or not by DAP (here is controlled the DAP (in)dependence of the differentiation). If the case occurs, the inhibited form of DAPAp is named DAPAp_i.<br />
<br />
:* The germ cells differentiate using a Cre controlled recombination of a DNA part. This part have two different states as the considered cell is either differentiated (somatic cell) or not (germ cells). See [[Paris/DesignProcess#How_will_auxotroph_germ_line_cells_differentiate_into_prototroph_somatic_cells.3F|here]] for a biological description of this mechanism. We can call these states LOX_Box for germ cells (the DNA part uses a LOX-Cre mechanism to recombine) and DAP_Box for somatic cells (after recombination the DNA is able to produce DAP). Once again each cell has to contain one molecule of DAP_Box or one molecule of LOX_Box.<br />
<br />
The other components are of course bacteria compartment. The two kinds of compartment differ only by the presence of either LOX_Box for germ cells or DNA_Box for soma cells. Using these molecules, we are able to model the dynamics by chemical reactions.<br />
<br />
<html><u>DAP and Cre degradation:</u></html><br />
<code><br />
Cre -><sub>K_CreD</sub> .<br />
DAP -><sub>K_DAPD</sub> .<br />
</code><br />
<br />
<html><u>DAPAp promoter activity for DAP dependence differentiation:</u></html> these rules prevent the production of Cre when DAP inhibits DAPAp.<br />
<code><br />
DAPAp + DAP -><sub>K_DAPApI</sub> DAPAp_i<br />
DAPAp_i -><sub>K_DAPApA</sub> DAPAp + DAP<br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
<html><u>DAPAp promoter activity for independent differentiation:</u></html> DAPAp is never inhibited.<br />
<code><br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
<html><u>Differentiation:</u></html> Note that the differentiation is irreversible. Molecules of Cre have to bind the both LOX sites of the LOX_BOX. We name <code>LOXP_Box<sub>Cre</sub></code> the intermediary state.<br />
<code><br />
LOXP_Box<sub> </sub> + Cre -><sub>K_Diff</sub> LOXP_Box<sub>Cre</sub><br />
LOXP_Box<sub>Cre</sub> + Cre -><sub>K_Diff</sub> DAP_Box<br />
</code><br />
<br />
<html><u>DAP production:</u></html> This only happens in somatic cells, germ cell does not contain DAP_Box. Therefore, only somatic cells are to feed germ cells.<br />
<code><br />
DAP_Box -><sub>K_DAPiP</sub> DAP_Box + DAP<br />
</code><br />
<br />
<html><u>DAP import and export:</u></html> These rules are only appied<br />
<code><br />
[DAP, ...]<sub>Bact</sub> -><sub>K_DAPEx</sub> DAP + [...]<sub>Bact</sub><br />
DAP + [...]<sub>Bact</sub> -><sub>K_DAPIm</sub> [DAP, ...]<sub>Bact</sub><br />
</code><br />
<br />
<html><u>Bacteria macroscopic evolutions (division and death):</u></html><br />
<code><br />
[''n''.DAP, ...]<sub>BactG</sub> -><sub>K_Div </sub> [(''n''/2).DAP, ...]sub>BactG</sub> + [(''n''/2).DAP, ...]sub>BactG</sub><br />
[''n''.DAP, ...]<sub>Bact </sub> -><sub>K_Death</sub> ''n''.DAP<br />
</code><br />
<br />
<!--''n''DAP<br />
<br />
that can be inhibited by DAP (see the red arrow in the figure).<br />
<br />
We remind that DAP is essential for germ cells division. Cre action have an effect only in germ cells: differentiation is irreversible.--><br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific [[Paris/mgs#Rules_Application_Strategies|rules application strategy]] implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T15:32:17Z<p>Spicher: /* SMB in Terms of Compartments and Chemical Reactions */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
[[Image:Modelsimpl.png|left|400px|right]]<br />
We start from the same representation of the system as presented in the [[Paris/Robustness_and_optimization|ODE based simulation]]. Obviously, bacteria are represented by compartments that contain molecules as shown on the picture of the previous section. Let now consider the figure next to this text in order to sum up the different molecules we have to deal with:<br />
<br />
* DAP: it is of course one of the major components of the system. It can be located in the bacteria or out of them in the environment. <br />
<br />
* Cre: it is the second main molecule to be considered. It remains in cells and cannot be exported or imported. <br />
<br />
* DNA: we focus only on the two parts of the DNA we are interested in:<br />
<br />
:* Both types of cell are able to produce Cre. This encoding region is under the control of a constitutive promoter. We then consider a molecule DAPAp that is an abstract representation of this part of the DNA. Thus every cell contains a DAPAp molecule. Following the two possible behaviors we consider, DAPAp can be inhibited or not by DAP (here is controlled the DAP (in)dependence of the differentiation). If the case occurs, the inhibited form of DAPAp is named DAPAp_i.<br />
<br />
:* The germ cells differentiate using a Cre controlled recombination of a DNA part. This part have two different states as the considered cell is either differentiated (somatic cell) or not (germ cells). See [[Paris/DesignProcess#How_will_auxotroph_germ_line_cells_differentiate_into_prototroph_somatic_cells.3F|here]] for a biological description of this mechanism. We can call these states LOX_Box for germ cells (the DNA part uses a LOX-Cre mechanism to recombine) and DAP_Box for somatic cells (after recombination the DNA is able to produce DAP). Once again each cell has to contain one molecule of DAP_Box or one molecule of LOX_Box.<br />
<br />
The other components are of course bacteria compartment. The two kinds of compartment differ only by the presence of either LOX_Box for germ cells or DNA_Box for soma cells. Using these molecules, we are able to model the dynamics by chemical reactions.<br />
<br />
DAP and Cre degradation:<br />
<code><br />
Cre -><sub>K_CreD</sub> .<br />
DAP -><sub>K_DAPD</sub> .<br />
</code><br />
<br />
DAPAp promoter activity for DAP dependence differentiation:<br />
<code><br />
DAPAp + DAP -><sub>K_DAPApI</sub> DAPAp_i<br />
DAPAp_i -><sub>K_DAPApA</sub> DAPAp + DAP<br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
DAPAp promoter activity for independent differentiation:<br />
<code><br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
Differentiation:<br />
<code><br />
LOXP_Box<sub> </sub> + Cre -><sub>K_Diff</sub> LOXP_Box<sub>Cre</sub><br />
LOXP_Box<sub>Cre</sub> + Cre -><sub>K_Diff</sub> DAP_Box<br />
</code><br />
<br />
DAP production:<br />
<code><br />
DAP_Box -><sub>K_DAPiP</sub> DAP_Box + DAP<br />
</code><br />
<br />
DAP import and export:<br />
<code><br />
[DAP, ...]<sub>Bact</sub> -><sub>K_DAPEx</sub> DAP + [...]<sub>Bact</sub><br />
DAP + [...]<sub>Bact</sub> -><sub>K_DAPIm</sub> [DAP, ...]<sub>Bact</sub><br />
</code><br />
<br />
Bacteria macroscopic evolutions (division and death): <br />
<code><br />
[''n''DAP, ...]<sub>BactG</sub> -><sub>K_Div </sub> [(''n''/2)DAP, ...]sub>BactG</sub> + [(''n''/2)DAP, ...]sub>BactG</sub><br />
[''n''DAP, ...]<sub>Bact </sub> -><sub>K_Death</sub> ''n''DAP<br />
</code><br />
<br />
<!--''n''DAP<br />
<br />
that can be inhibited by DAP (see the red arrow in the figure).<br />
<br />
We remind that DAP is essential for germ cells division. Cre action have an effect only in germ cells: differentiation is irreversible.--><br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific [[Paris/mgs#Rules_Application_Strategies|rules application strategy]] implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T15:29:30Z<p>Spicher: /* SMB in Terms of Compartments and Chemical Reactions */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
[[Image:Modelsimpl.png|left|400px|right]]<br />
We start from the same representation of the system as presented in the [[Paris/Robustness_and_optimization|ODE based simulation]]. Obviously, bacteria are represented by compartments that contain molecules as shown on the picture of the previous section. Let now consider the figure next to this text in order to sum up the different molecules we have to deal with:<br />
<br />
* DAP: it is of course one of the major components of the system. It can be located in the bacteria or out of them in the environment. <br />
<br />
* Cre: it is the second main molecule to be considered. It remains in cells and cannot be exported or imported. <br />
<br />
* DNA: we focus only on the two parts of the DNA we are interested in:<br />
<br />
:* Both types of cell are able to produce Cre. This encoding region is under the control of a constitutive promoter. We then consider a molecule DAPAp that is an abstract representation of this part of the DNA. Thus every cell contains a DAPAp molecule. Following the two possible behaviors we consider, DAPAp can be inhibited or not by DAP (here is controlled the DAP (in)dependence of the differentiation). If the case occurs, the inhibited form of DAPAp is named DAPAp_i.<br />
<br />
:* The germ cells differentiate using a Cre controlled recombination of a DNA part. This part have two different states as the considered cell is either differentiated (somatic cell) or not (germ cells). See [[Paris/DesignProcess#How_will_auxotroph_germ_line_cells_differentiate_into_prototroph_somatic_cells.3F|here]] for a biological description of this mechanism. We can call these states LOX_Box for germ cells (the DNA part uses a LOX-Cre mechanism to recombine) and DAP_Box for somatic cells (after recombination the DNA is able to produce DAP). Once again each cell has to contain one molecule of DAP_Box or one molecule of LOX_Box.<br />
<br />
The other components are of course bacteria compartment. The two kinds of compartment differ only by the presence of either LOX_Box for germ cells or DNA_Box for soma cells. Using these molecules, we are able to model the dynamics by chemical reactions.<br />
<br />
DAP and Cre degradation:<br />
<code><br />
Cre -><sub>K_CreD</sub> .<br />
DAP -><sub>K_DAPD</sub> .<br />
</code><br />
<br />
DAPAp promoter activity for DAP dependence differentiation:<br />
<code><br />
DAPAp + DAP -><sub>K_DAPApI</sub> DAPAp_i<br />
DAPAp_i -><sub>K_DAPApA</sub> DAPAp + DAP<br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
DAPAp promoter activity for independent differentiation:<br />
<code><br />
DAPAp -><sub>K_Cre </sub> DAPAp + Cre<br />
</code><br />
<br />
Differentiation:<br />
<code><br />
LOXP_Box<sub> </sub> + Cre -><sub>K_Diff</sub> LOXP_Box<sub>Cre</sub><br />
LOXP_Box<sub>Cre</sub> + Cre -><sub>K_Diff</sub> DAP_Box<br />
</code><br />
<br />
DAP production:<br />
<code><br />
DAP_Box -><sub>K_DAPiP</sub> DAP_Box + DAP<br />
</code><br />
<br />
DAP import and export:<br />
<br />
<code><br />
[DAP, ...]<sub>Bact</sub> -><sub>K_DAPEx</sub> DAP + [...]<sub>Bact</sub><br />
DAP + [...]<sub>Bact</sub> -><sub>K_DAPIm</sub> [DAP, ...]<sub>Bact</sub><br />
</code><br />
<br />
<br />
<br />
<!--<br />
<br />
that can be inhibited by DAP (see the red arrow in the figure).<br />
<br />
We remind that DAP is essential for germ cells division. Cre action have an effect only in germ cells: differentiation is irreversible.--><br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific [[Paris/mgs#Rules_Application_Strategies|rules application strategy]] implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T15:21:24Z<p>Spicher: /* SMB in Terms of Compartments and Chemical Reactions */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
[[Image:Modelsimpl.png|left|400px|right]]<br />
We start from the same representation of the system as presented in the [[Paris/Robustness_and_optimization|ODE based simulation]]. Obviously, bacteria are represented by compartments that contain molecules as shown on the picture of the previous section. Let now consider the figure next to this text in order to sum up the different molecules we have to deal with:<br />
<br />
* DAP: it is of course one of the major components of the system. It can be located in the bacteria or out of them in the environment. <br />
<br />
* Cre: it is the second main molecule to be considered. It remains in cells and cannot be exported or imported. <br />
<br />
* DNA: we focus only on the two parts of the DNA we are interested in:<br />
<br />
:* Both types of cell are able to produce Cre. This encoding region is under the control of a constitutive promoter. We then consider a molecule DAPAp that is an abstract representation of this part of the DNA. Thus every cell contains a DAPAp molecule. Following the two possible behaviors we consider, DAPAp can be inhibited or not by DAP (here is controlled the DAP (in)dependence of the differentiation). If the case occurs, the inhibited form of DAPAp is named DAPAp_i.<br />
<br />
:* The germ cells differentiate using a Cre controlled recombination of a DNA part. This part have two different states as the considered cell is either differentiated (somatic cell) or not (germ cells). See [[Paris/DesignProcess#How_will_auxotroph_germ_line_cells_differentiate_into_prototroph_somatic_cells.3F|here]] for a biological description of this mechanism. We can call these states LOX_Box for germ cells (the DNA part uses a LOX-Cre mechanism to recombine) and DAP_Box for somatic cells (after recombination the DNA is able to produce DAP). Once again each cell has to contain one molecule of DAP_Box or one molecule of LOX_Box.<br />
<br />
The other components are of course bacteria compartment. The two kinds of compartment differ only by the presence of either LOX_Box for germ cells or DNA_Box for soma cells. Using these molecules, we are able to model the dynamics by chemical reactions.<br />
<br />
DAP and Cre degradation:<br />
<code><br />
Cre -><sub>K_CreD</sub> .<br />
DAP -><sub>K_DAPD</sub> .<br />
</code><br />
<br />
DAPAp promoter activity:<br />
<code><br />
DAPAp + DAP -><sub>K_DAPApI</sub> DAPAp_i<br />
DAPAp_i -><sub>K_DAPApA</sub> DAPAp + DAP<br />
DAPAp -><sub>K_Cre</sub> DAPAp + Cre<br />
</code><br />
<br />
DAP dependence differentiation:<br />
<code><br />
LOXP_Box + Cre -><sup>K_Diff</sup> LOXP_Box<sup>Cre</sup><br />
LOXP_Box<sup>Cre</cup> + Cre -><sup>K_Diff</sup> DAP_Box<br />
</code><br />
<br />
DAP production:<br />
<code><br />
DAP_Box -><sup>K_DAPiP</sup> DAP_Box + DAP<br />
</code><br />
<br />
<code><br />
<br />
(* DAP externalization *)<br />
`DAP ={ C = fstOrder(K_DAPEx,1.0) }=> (appliedBactRule := `DAPEx ; return(`DAP :: (diff(self,`DAP)) :: seq:())) ;<br />
<br />
</code><br />
<br />
<br />
<br />
<br />
<br />
<!--that can be inhibited by DAP (see the red arrow in the figure).<br />
<br />
We remind that DAP is essential for germ cells division. Cre action have an effect only in germ cells: differentiation is irreversible.--><br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific [[Paris/mgs#Rules_Application_Strategies|rules application strategy]] implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T14:53:50Z<p>Spicher: /* SMB in Terms of Compartments and Chemical Reactions */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
[[Image:Modelsimpl.png|left|400px|right]]<br />
We start from the same representation of the system as presented in the [[Paris/Robustness_and_optimization|ODE based simulation]]. Obviously, bacteria are represented by compartments that contain molecules as shown on the picture of the previous section. Let now consider the figure next to this text in order to sum up the different molecules we have to deal with:<br />
<br />
* DAP: it is of course one of the major components of the system. It can be located in the bacteria or out of them in the environment. <br />
<br />
* Cre: it is the second main molecule to be considered. It remains in cells and cannot be exported or imported. <br />
<br />
* DNA: we focus only on the two parts of the DNA we are interested in:<br />
<br />
:* Both types of cell are able to produce Cre. This encoding region is under the control of a constitutive promoter. We then consider a molecule DAPAp that is an abstract representation of this part of the DNA. Thus every cell contains a DAPAp molecule. Following the two possible behaviors we consider, DAPAp can be inhibited or not by DAP (here is controlled the DAP (in)dependence of the differentiation). If the case occurs, the inhibited form of DAPAp is named DAPAp_i.<br />
<br />
:* The germ cells differentiate using a Cre controlled recombination of a DNA part. This part have two different states as the considered cell is either differentiated (somatic cell) or not (germ cells). See [[Paris/DesignProcess#How_will_auxotroph_germ_line_cells_differentiate_into_prototroph_somatic_cells.3F|here]] for a biological description of this mechanism. We can call these states LOX_Box for germ cells (the DNA part uses a LOX-Cre mechanism to recombine) and DAP_Box for somatic cells (after recombination the DNA is able to produce DAP). Once again each cell has to contain one molecule of DAP_Box or one molecule of LOX_Box.<br />
<br />
The other components are of course bacteria compartment. The two kinds of compartment differ only by the presence of either LOX_Box for germ cells or DNA_Box for soma cells. Using these molecules, we are able to model the dynamics by two sets of chemical reactions depending if they occur in or out of the bacteria.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!--that can be inhibited by DAP (see the red arrow in the figure).<br />
<br />
We remind that DAP is essential for germ cells division. Cre action have an effect only in germ cells: differentiation is irreversible.--><br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific [[Paris/mgs#Rules_Application_Strategies|rules application strategy]] implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T14:53:19Z<p>Spicher: /* Sources of MGS programs */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== The questions of interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section 2). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of principle: qualitative analysis of system's behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing robustness and optimizing system's behavior: quantitative analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part 2, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part 3, our results indicated that the system’s behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. <br />
<br />
We would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of the MGS programs]] [[Image:MGS-inside.png|50px]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T14:52:51Z<p>Spicher: /* Models, Initial Conditions Files and Sources */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to ''an exponential growth of the two coexisting cell types''. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, ''each adapted to a particular problem''.<br />
<br />
=== The questions of interest ===<br />
<br />
The first, most obvious question deals with proving the ''feasibility'' of our system (Section 2). In our case, this amounts to check that the system presents a very simple, qualitative behavior: ''the two cell populations grow''!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in this model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of principle: qualitative analysis of system's behavior=<br />
<br />
In this section, we develop models to test the feasibility of our system. We focus on a simple, essential qualitative property: the growth of the two coexisting cell types. This property is investigated under various modeling assumptions.<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing robustness and optimizing system's behavior: quantitative analysis=<br />
<br />
In this section, we focus on more quantitative properties of system's behavior: robustness and optimization capabilities. Two slightly different designs are compared.<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
In section [https://2007.igem.org/Paris/DesignProcess#Optimization_through_feedback Design process] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part 2, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part 3, our results indicated that the system’s behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. <br />
<br />
We would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources|Sources of MGS programs]] ===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T14:45:09Z<p>Spicher: /* SMB in Terms of Compartments and Chemical Reactions */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
[[Image:Modelsimpl.png|left|400px|right]]<br />
We start from the same representation of the system as presented in the [[Paris/Robustness_and_optimization|ODE based simulation]]. Obviously, bacteria are represented by compartments that contain molecules as shown on the picture of the previous section. Let now consider the figure next to this text in order to sum up the different molecules we have to deal with:<br />
<br />
* DAP: it is of course one of the major components of the system. It can be located in the bacteria or out of them in the environment. <br />
<br />
* Cre: it is the second main molecule to be considered. It remains in cells and cannot be exported or imported. <br />
<br />
* DNA: we focus only on the two parts of the DNA we are interested in:<br />
<br />
:* Both types of cell are able to produce Cre. This encoding region is under the control of a constitutive promoter. We then consider a molecule DAPAp that is an abstract representation of this part of the DNA. Thus every cell contains a DAPAp molecule. Following the two possible behaviors we consider, DAPAp can be inhibited or not by DAP (here is controlled the DAP (in)dependence of the differentiation). If the case occurs, the inhibited form of DAPAp is named DAPAp_i.<br />
<br />
:* The germ cells differentiate using a Cre controlled recombination of a DNA part. This part have two different states as the considered cell is either differentiated (somatic cell) or not (germ cells). See [[Paris/DesignProcess#How_will_auxotroph_germ_line_cells_differentiate_into_prototroph_somatic_cells.3F|here]] for a biological description of this mechanism. We can call these states LOX_Box for germ cells (the DNA part uses a LOX-Cre mechanism to recombine) and DAP_Box for somatic cells (after recombination the DNA is able to produce DAP). Once again each cell has to contain one molecule of DAP_Box or one molecule of LOX_Box.<br />
<br />
The other components are of course bacteria compartment. The two kinds of compartment differ only by the presence of either LOX_Box for germ cells or DNA_Box for soma cells. Using these molecules, we are able to model the dynamics by a set of chemical reactions.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!--that can be inhibited by DAP (see the red arrow in the figure).<br />
<br />
We remind that DAP is essential for germ cells division. Cre action have an effect only in germ cells: differentiation is irreversible.--><br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific [[Paris/mgs#Rules_Application_Strategies|rules application strategy]] implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T14:44:41Z<p>Spicher: /* SMB in Terms of Compartments and Chemical Reactions */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
[[Image:Modelsimpl.png|left|300px|right]]<br />
We start from the same representation of the system as presented in the [[Paris/Robustness_and_optimization|ODE based simulation]]. Obviously, bacteria are represented by compartments that contain molecules as shown on the picture of the previous section. Let now consider the figure next to this text in order to sum up the different molecules we have to deal with:<br />
<br />
* DAP: it is of course one of the major components of the system. It can be located in the bacteria or out of them in the environment. <br />
<br />
* Cre: it is the second main molecule to be considered. It remains in cells and cannot be exported or imported. <br />
<br />
* DNA: we focus only on the two parts of the DNA we are interested in:<br />
<br />
:* Both types of cell are able to produce Cre. This encoding region is under the control of a constitutive promoter. We then consider a molecule DAPAp that is an abstract representation of this part of the DNA. Thus every cell contains a DAPAp molecule. Following the two possible behaviors we consider, DAPAp can be inhibited or not by DAP (here is controlled the DAP (in)dependence of the differentiation). If the case occurs, the inhibited form of DAPAp is named DAPAp_i.<br />
<br />
:* The germ cells differentiate using a Cre controlled recombination of a DNA part. This part have two different states as the considered cell is either differentiated (somatic cell) or not (germ cells). See [[Paris/DesignProcess#How_will_auxotroph_germ_line_cells_differentiate_into_prototroph_somatic_cells.3F|here]] for a biological description of this mechanism. We can call these states LOX_Box for germ cells (the DNA part uses a LOX-Cre mechanism to recombine) and DAP_Box for somatic cells (after recombination the DNA is able to produce DAP). Once again each cell has to contain one molecule of DAP_Box or one molecule of LOX_Box.<br />
<br />
The other components are of course bacteria compartment. The two kinds of compartment differ only by the presence of either LOX_Box for germ cells or DNA_Box for soma cells. Using these molecules, we are able to model the dynamics by a set of chemical reactions.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!--that can be inhibited by DAP (see the red arrow in the figure).<br />
<br />
We remind that DAP is essential for germ cells division. Cre action have an effect only in germ cells: differentiation is irreversible.--><br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific [[Paris/mgs#Rules_Application_Strategies|rules application strategy]] implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/mgsParis/mgs2007-10-26T13:48:26Z<p>Spicher: /* Rules Application Strategies */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br><br />
<br />
MGS is a experimental programming language developed at the university of Evry dedicated to the ''modeling'' and the ''simulation'' of ''dynamical systems with a dynamical structure''. We briefly present in this section the philosophy of MGS programming. A complete presentation of the language is available [http://mgs.ibisc.univ-evry.fr/ here].<br />
<br />
= Dynamical Systems with a Dynamical Structure =<br />
<br />
== Dynamical Structure ==<br />
<br />
Intuitively, characterizing a ''dynamical system'' (DS) is a formal description of how a point, the ''state'' of the system, moves in the ''phase space'', the set of all possible states of the system. This displacement is specifying a rule, the ''evolution function'', saying where the point goes from its current position. A lot of formalisms have been developed to describe DS like differential equations, iterating of function, cellular automata, ... providing the right formalism in accordance with the discrete or continuous nature of time and space.<br />
<br />
The state of a DS at a given <code>t</code> can be characterized by the elements that composed the system at <code>t</code>. The most of the time, interactions occurs between parts that are neighbor in this partition of the system. So the definition of the evolution function (that specifies which parts are interacting) relies on this neighborhood and often corresponds to ''local evolution laws''.<br />
<br />
From the biological point of view, we can note that a lot of dynamical systems exhibit a ''dynamical structure'': not only do the values of state variables evolve, but the phase space and the definition of the evolution function do. The phase space has to be considered as an observable of the system. We call these systems ''Dynamical Systems with a Dynamical Structure'' (DS<sup>2</sup>).<br />
<br />
An obvious example of biological DS<sup>2</sup> is the embryo development. Initially, the state of the system is described by the chemical state of the egg (however complex is this description). After many divisions, the systems is not well described by the chemical state of '''one''' cell, but many cells. Moreover the spatial organization of the cells matter in the future (spatial) development of the organism. The number of cells, their spatial organization and the interactions continually evolve.<br />
<br />
In terms of simulation, DS<sup>2</sup> are very hard to model/implement cause the data structure required for the representation of the system state, can be topologically modified. MGS was developed to answer this question.<br />
<br />
== Rewriting to Model and Simulate DS<sup>2</sup> ==<br />
<br />
A rewriting system (RS) is a computational device. Computations are done by replacing a subpart of an object by another one. By iterating this process on a object, the object can be transformed in an other object with respect to a set of rewriting tool. A computational example is arithmetical expression evaluation: given an expression <code>e</code> (for example <code>e=1+0</code>), it is reduced in an other expression <code>e'</code> by a simplification rule like <code>x + 0 -> x</code> meaning that <code>0</code> is neutral for <code>+</code>.<br />
<br />
This computational process is suitable for specifying the evolution of a DS<sup>2</sup>. The relation between DS<sup>2</sup> and RS is given as follows:<br />
<br />
* the '''state''' of the system = a '''data structure''' (this structure fits the organization of the system)<br />
<br />
* the '''dynamics''' of the system = a set of '''rewriting rules'''. A rewriting rule <code>a => b</code> specifies a local evolution law. It is composed of two parts: the left hand side <code>a</code> is a pattern of interaction, and the right hand side <code>b</code> evaluates the products of the interaction. The application of a rule works as follows:<br />
<br />
:* <code>a</code> is used to select a subpart <code>A</code> of the system <code>S</code> where an interaction occurs,<br />
<br />
:* <code>b</code> is used to evaluate the product <code>B</code> of the interaction,<br />
<br />
:* <code>A</code> is finally replaced by <code>B</code> in <code>S</code>.<br />
<br />
= MGS Features =<br />
MGS embeds these notions through the notions of ''topological collections'', ''transformations'' and ''rules application strategies''.<br />
<br />
== Topological Collections ==<br />
<br />
They are the only way to aggregate data in MGS. Collections are used to describe the state of a DS<sup>2</sup>. They are composed of a set of elements, the different parts of the system, together with a neighborhood relationship between its elements, representing possible interactions. For example, if collection elements are molecules, when two molecules are neighbor that means they are "close" enough to react.<br />
<br />
There exists several types of topological collections in MGS. In this project we have used three of them:<br />
<br />
* '''square grids''': this collection is typically used to specify cellular automaton based models. The elements of the collection are the cases of the square grid and the neighborhood is regular: each case has four neighbors following north, south, east and west direction. We use them to simulate the [[Paris/Cell_auto|DAP diffusion]] in our system.<br />
<br />
* '''Delaunay triangulations''': a Delaunay triangulation is procedure that, given a finite set of points localized in a euclidean space, computes the triangulation between the points that is as regular as possible. This provides a very natural neighborhood between points. As the neighborhood depends on the localization of each element of the collection, Delaunay triangulations are useful to describe dynamical structure. We use this triangulation to represent the spatial organization of cells in [[Paris/Cell_auto_2|this model]]. The points used for the triangulation are the position of cells. As the cells are diffusing, dividing, dying, ... , the neighborhood is recomputed and updated. This example also consider that a spring exists between two cells that are neighbors in order to simulate the aggregation of cells in the population.<br />
<br />
* '''bags''': the last collection is also called ''multi-sets''. They are collections when each element is neighbor of all the other. They are particularly suitable for representing well-mixed chemical solutions. We used them is the [[Paris/Stochastic_model|Gillespie based simulation]].<br />
<br />
== Transformations ==<br />
<br />
Transformations are functions of topological collection. They are defined by sets of rewriting rules; the following expression is a skeleton of a transformation definition:<br />
<br />
<code><br />
trans ''name'' = {<br />
pattern<sub>1</sub> => expression<sub>1</sub> ;<br />
...<br />
pattern<sub>N</sub> => expression<sub>N</sub> ;<br />
}<br />
</code><br />
<br />
Each rule is composed of a pattern used to specify an interaction, ''i.e.'' a subpart of the collection where an interaction occurs. Typically, the pattern <code>x, y</code> matches two elements of the collection (we can refer to these elements in the right hand side using <code>x</code> and <code>y</code> variables) that neighbor (this is the meaning of the comma). The right hand side is an MGS expression that evaluates a sequence of values. This sequence will be put in the collection at the place of the matched sub-collection.<br />
<br />
A lot of examples of transformations are given in the [[Paris/Sources|sources]] of our programs. Example of MGS programs are also available in the MGS [http://mgs.ibisc.univ-evry.fr/ImageGallery/mgs_gallery.html official gallery].<br />
<br />
== Rules Application Strategies ==<br />
<br />
The last feature allows to parametrize the application of a transformation on a collection by a rules application strategy, that is a policy specifying the order, the number of applications, and the priority of the rules. Rules can for example be applied synchronously everywhere in the collection or asynchronously when only one rule is chosen and applied once. MGS provides some strategies. Our programs use two of them:<br />
<br />
* the ''maximal-parallel'' strategy: this strategy is standard in the simulation of DS. It consists in applying each rule (on separated sub-collection) as many times as possible. Intuitively, this means that the local evolution laws specified by the transformation rules are concurrent and act all together at each time step. This strategy is used in the [[Paris/Cell_auto|DAP diffusion]] model and in the [[Paris/Cell_auto_2|dynamical structure]] model.<br />
<br />
* the ''gillespie'' strategy: this strategy is specific to the exact stochastic simulation of chemical reactions. An introduction to Gillespie simulation method is given [[Paris/Stochastic_model#Gillespie.27s_SSA|here]]. Each rule of the transformation is considered to be a chemical reaction. An application of a transformation with this strategy consists in choosing the chemical reaction with the highest probability to occur as soon as possible (knowing the chemicals concentrations and the kinetics of the represented reaction), and to apply it once in the collection.<br />
<br />
= MGS Top-level =<br />
<br />
All our programs have been executed using the MGS top-level available [http://mgs.ibisc.univ-evry.fr here]. This implementation of the language is a prototype but it can be used to quickly design models of complex systems as we did for SMB. In fact, one of the major advantage of using MGS is time-saving when developing models. The concepts behind the three models have been programmed in about half a day each. All the rest of the time we spent in developing programs was dedicated to optimize execution time, generate outputs and tune parameters.</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/mgsParis/mgs2007-10-26T13:47:47Z<p>Spicher: /* Rules Application Strategies */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br><br />
<br />
MGS is a experimental programming language developed at the university of Evry dedicated to the ''modeling'' and the ''simulation'' of ''dynamical systems with a dynamical structure''. We briefly present in this section the philosophy of MGS programming. A complete presentation of the language is available [http://mgs.ibisc.univ-evry.fr/ here].<br />
<br />
= Dynamical Systems with a Dynamical Structure =<br />
<br />
== Dynamical Structure ==<br />
<br />
Intuitively, characterizing a ''dynamical system'' (DS) is a formal description of how a point, the ''state'' of the system, moves in the ''phase space'', the set of all possible states of the system. This displacement is specifying a rule, the ''evolution function'', saying where the point goes from its current position. A lot of formalisms have been developed to describe DS like differential equations, iterating of function, cellular automata, ... providing the right formalism in accordance with the discrete or continuous nature of time and space.<br />
<br />
The state of a DS at a given <code>t</code> can be characterized by the elements that composed the system at <code>t</code>. The most of the time, interactions occurs between parts that are neighbor in this partition of the system. So the definition of the evolution function (that specifies which parts are interacting) relies on this neighborhood and often corresponds to ''local evolution laws''.<br />
<br />
From the biological point of view, we can note that a lot of dynamical systems exhibit a ''dynamical structure'': not only do the values of state variables evolve, but the phase space and the definition of the evolution function do. The phase space has to be considered as an observable of the system. We call these systems ''Dynamical Systems with a Dynamical Structure'' (DS<sup>2</sup>).<br />
<br />
An obvious example of biological DS<sup>2</sup> is the embryo development. Initially, the state of the system is described by the chemical state of the egg (however complex is this description). After many divisions, the systems is not well described by the chemical state of '''one''' cell, but many cells. Moreover the spatial organization of the cells matter in the future (spatial) development of the organism. The number of cells, their spatial organization and the interactions continually evolve.<br />
<br />
In terms of simulation, DS<sup>2</sup> are very hard to model/implement cause the data structure required for the representation of the system state, can be topologically modified. MGS was developed to answer this question.<br />
<br />
== Rewriting to Model and Simulate DS<sup>2</sup> ==<br />
<br />
A rewriting system (RS) is a computational device. Computations are done by replacing a subpart of an object by another one. By iterating this process on a object, the object can be transformed in an other object with respect to a set of rewriting tool. A computational example is arithmetical expression evaluation: given an expression <code>e</code> (for example <code>e=1+0</code>), it is reduced in an other expression <code>e'</code> by a simplification rule like <code>x + 0 -> x</code> meaning that <code>0</code> is neutral for <code>+</code>.<br />
<br />
This computational process is suitable for specifying the evolution of a DS<sup>2</sup>. The relation between DS<sup>2</sup> and RS is given as follows:<br />
<br />
* the '''state''' of the system = a '''data structure''' (this structure fits the organization of the system)<br />
<br />
* the '''dynamics''' of the system = a set of '''rewriting rules'''. A rewriting rule <code>a => b</code> specifies a local evolution law. It is composed of two parts: the left hand side <code>a</code> is a pattern of interaction, and the right hand side <code>b</code> evaluates the products of the interaction. The application of a rule works as follows:<br />
<br />
:* <code>a</code> is used to select a subpart <code>A</code> of the system <code>S</code> where an interaction occurs,<br />
<br />
:* <code>b</code> is used to evaluate the product <code>B</code> of the interaction,<br />
<br />
:* <code>A</code> is finally replaced by <code>B</code> in <code>S</code>.<br />
<br />
= MGS Features =<br />
MGS embeds these notions through the notions of ''topological collections'', ''transformations'' and ''rules application strategies''.<br />
<br />
== Topological Collections ==<br />
<br />
They are the only way to aggregate data in MGS. Collections are used to describe the state of a DS<sup>2</sup>. They are composed of a set of elements, the different parts of the system, together with a neighborhood relationship between its elements, representing possible interactions. For example, if collection elements are molecules, when two molecules are neighbor that means they are "close" enough to react.<br />
<br />
There exists several types of topological collections in MGS. In this project we have used three of them:<br />
<br />
* '''square grids''': this collection is typically used to specify cellular automaton based models. The elements of the collection are the cases of the square grid and the neighborhood is regular: each case has four neighbors following north, south, east and west direction. We use them to simulate the [[Paris/Cell_auto|DAP diffusion]] in our system.<br />
<br />
* '''Delaunay triangulations''': a Delaunay triangulation is procedure that, given a finite set of points localized in a euclidean space, computes the triangulation between the points that is as regular as possible. This provides a very natural neighborhood between points. As the neighborhood depends on the localization of each element of the collection, Delaunay triangulations are useful to describe dynamical structure. We use this triangulation to represent the spatial organization of cells in [[Paris/Cell_auto_2|this model]]. The points used for the triangulation are the position of cells. As the cells are diffusing, dividing, dying, ... , the neighborhood is recomputed and updated. This example also consider that a spring exists between two cells that are neighbors in order to simulate the aggregation of cells in the population.<br />
<br />
* '''bags''': the last collection is also called ''multi-sets''. They are collections when each element is neighbor of all the other. They are particularly suitable for representing well-mixed chemical solutions. We used them is the [[Paris/Stochastic_model|Gillespie based simulation]].<br />
<br />
== Transformations ==<br />
<br />
Transformations are functions of topological collection. They are defined by sets of rewriting rules; the following expression is a skeleton of a transformation definition:<br />
<br />
<code><br />
trans ''name'' = {<br />
pattern<sub>1</sub> => expression<sub>1</sub> ;<br />
...<br />
pattern<sub>N</sub> => expression<sub>N</sub> ;<br />
}<br />
</code><br />
<br />
Each rule is composed of a pattern used to specify an interaction, ''i.e.'' a subpart of the collection where an interaction occurs. Typically, the pattern <code>x, y</code> matches two elements of the collection (we can refer to these elements in the right hand side using <code>x</code> and <code>y</code> variables) that neighbor (this is the meaning of the comma). The right hand side is an MGS expression that evaluates a sequence of values. This sequence will be put in the collection at the place of the matched sub-collection.<br />
<br />
A lot of examples of transformations are given in the [[Paris/Sources|sources]] of our programs. Example of MGS programs are also available in the MGS [http://mgs.ibisc.univ-evry.fr/ImageGallery/mgs_gallery.html official gallery].<br />
<br />
== Rules Application Strategies ==<br />
<br />
The last feature allows to parametrize the application of a transformation on a collection by a rules application strategy, that is a policy specifying the order, the number of applications, and the priority of the rules. Rules can for example be applied synchronously everywhere in the collection or asynchronously when only one rule is chosen is applied one. MGS provides some strategies. Our programs use two of them:<br />
<br />
* the ''maximal-parallel'' strategy: this strategy is standard in the simulation of DS. It consists in applying each rule (on separated sub-collection) as many times as possible. Intuitively, this means that the local evolution laws specified by the transformation rules are concurrent and act all together at each time step. This strategy is used in the [[Paris/Cell_auto|DAP diffusion]] model and in the [[Paris/Cell_auto_2|dynamical structure]] model.<br />
<br />
* the ''gillespie'' strategy: this strategy is specific to the exact stochastic simulation of chemical reactions. An introduction to Gillespie simulation method is given [[Paris/Stochastic_model#Gillespie.27s_SSA|here]]. Each rule of the transformation is considered to be a chemical reaction. An application of a transformation with this strategy consists in choosing the chemical reaction with the highest probability to occur as soon as possible (knowing the chemicals concentrations and the kinetics of the represented reaction), and to apply it once in the collection.<br />
<br />
= MGS Top-level =<br />
<br />
All our programs have been executed using the MGS top-level available [http://mgs.ibisc.univ-evry.fr here]. This implementation of the language is a prototype but it can be used to quickly design models of complex systems as we did for SMB. In fact, one of the major advantage of using MGS is time-saving when developing models. The concepts behind the three models have been programmed in about half a day each. All the rest of the time we spent in developing programs was dedicated to optimize execution time, generate outputs and tune parameters.</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T13:47:16Z<p>Spicher: /* MGS Implementation 50px */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific [[Paris/mgs#Rules_Application_Strategies|rules application strategy]] implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T13:25:25Z<p>Spicher: /* Some Results */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific rules application strategy implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results [[Image:MGS-inside.png|50px]]==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T13:25:04Z<p>Spicher: /* MGS Implementation */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
== MGS Implementation [[Image:MGS-inside.png|50px]]==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific rules application strategy implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results ==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T13:23:24Z<p>Spicher: /* Conclusion */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
== MGS Implementation ==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific rules application strategy implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results ==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as [[Paris/Modeling#Proof_of_principle:_qualitative_analysis_of_system.27s_behavior|previous simulation]] show, somatic cells only feed germ cells that surround them. The spatial distribution of cells is not here taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Cell_auto_2Paris/Cell auto 22007-10-26T13:19:28Z<p>Spicher: </p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br />
<br><br />
= Introduction =<br />
<br />
The cellular automaton develop to compare diffusion of DAP and differentiation is very restrictive and unrealistic due to the lake of natural behavior of cells like growth, division, death ... As a matter of fact, a cellular automaton point of view does not allow to deal with dynamical population:<br />
<br />
* required automaton rules to push cells and to allow divisions, are hard to carry out;<br />
<br />
* the rigid structure of the grid prevent any topological modification of the population organization;<br />
<br />
* somatic cells that cannot divide keep on growing and become significantly bigger that germ bacteria, a missing notion in a cellular automaton.<br />
<br />
With this second simulation we focus on this issue. We consider SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and aim at studying the impact of the cells organization on the future of the population. In order to achieve this goal, we need a mechanistic model that will allow cell to divide and die. We propose to use a masses/springs model. Such model allow<br />
<br />
* division and death by adding or removing masses,<br />
<br />
* cell growth by increasing springs rest length,<br />
<br />
* to fill holes in the population (if there is some empty place in the population springs will push masses to fill it),<br />
<br />
* to prevent a dispersion of cells (springs cannot infinitely extends).<br />
<br />
This mechanistic model has to be coupled with the biological one we previously have developed.<br />
<br />
We first stress out the hypothesis of this simulation, we then detail the mechanistic and biological models, and finally, we simulate the system considering either a DAP controlled differentiation or a DAP independent differentiation.<br />
<br />
== Hypotheses ==<br />
<br />
In this model we made four important hypotheses:<br />
<br />
* Even if the somatic cells feed germ ones by an indirect process (using an external diffusion in the environment and not a direct bridge communication between cells) we consider that DAP cannot diffuse very far from a somatic cell and then a somatic cell can only feed close (in fact neighbor in our model) germ cells. As a consequence, we choose to model a direct communication (equivalent to an indirect communication with a small DAP diffusion rate) by putting a black box on the underlying complex mechanisms of feeding. In other words, there is no distinction between external and internal DAP; exchange are done directly from cell to cell.<br />
<br />
* We consider that the population evolves in size. So we allow bacteria to die and divide. Of course, with respect to initial system, somatic cells cannot divide. On the other, we assume in this model that germ cells cannot die. In fact, we are here interested in studying the growth of the system that compulsorily requires presence of germ cells.<br />
<br />
* This point is not really an assumption but an property of cells that was not taken into account in the previous models. We will consider that cells are growing in size. In fact, the size of a somatic cell is supposed to be bigger than standard germ size. This could disturb a lot the geometric organization of the population.<br />
<br />
* Finally the two following case will be considered:<br />
<br />
:* First case: the differentiation is DAP dependent<br />
<br />
:* Second case: the differentiation is done with a constant rate<br />
<br />
= Description of the Model =<br />
<br />
As we have already said, this model is divided into two:<br />
<br />
* the mechanistic model that is used to deal with the cells displacement (using mechanical constraints) and their neighborhood,<br />
<br />
* the biological model that make cells evolve, growth (by extended springs rest length), divide, die, differentiate and communicate.<br />
<br />
Both are mainly independent (the only dependence appears with the growth where springs length are modified). So we will present them separately.<br />
<br />
== The Mechanical Model ==<br />
<br />
=== Neighborhood ===<br />
<br />
In the mechanistic part of the system, a cell is considered as a punctual mass localized in the 2D euclidean space. All the cells are sharing the mass (we choose 1 to simplify computation). Cells are also characterized by there velocity. Finally, in order to compute the spring rest length, each cell exhibits its radius. We represent them by a tuple <code>(px,py,vx,vy,r)</code> where <code>px</code> and <code>py</code> are the coordinate of the cell position, <code>vx</code> and <code>vy</code> are the coordinates of its velocity vector, and <code>r</code> represents its radius.<br />
<br />
The neighborhood between cells is computed using a [[Paris/mgs#Topological_Collections|Delaunay triangulation]]. In our system, if the triangulation make two cells become neighbors, this means that a spring is considered between their corresponding mass. The rest length of this spring is then the sum of the radius component of the mass representation. Once again to simplify computation the force constant of the spring is 1.<br />
<br />
This characterization of the cells as masses corresponds to the definition of type <code>MecaBact</code> in the [[Paris/Sources#Cells_Spatial_Organization|program]]. Fields have been added to save the sum of the forces that act on a mass.<br />
<br />
=== Dynamics ===<br />
<br />
We compute the displacement of a mass during a small time step by a Euler approximation. At each time step, the forces applied on each mass are summed, and twice integrated to compute the velocity, then the displacement and finally the new position of the mass. The considered forces are of two types: the restoring force exerted by the springs on each mass, and a friction force to prevent a divergent increase of the velocity and to ensure that the mechanical equilibrium will be reached.<br />
<br />
The dynamics have implemented using the [[Paris/mgs#Transformations|transformation]] [[Paris/Sources#Cells_Spatial_Organization|<code>Meca</code>]].<br />
<br />
== The Biological Model ==<br />
<br />
=== Structure ===<br />
<br />
The biological cells are represented in the same way as in the previous [[Paris/Cell_auto|cellular automaton]]. Each bacterium is either germ or somatic and is characterized by its DAP concentration. So we represent the different states of the automaton cell by tuple of values <code>{DAP,Type}</code>:<br />
<br />
* <code>DAP</code> is the internal DAP concentration in the bacterium,<br />
<br />
* <code>Type</code> represents if the bacterium is differentiated or not; it can take two values <code>BactG</code> and <code>BactS</code>.<br />
<br />
The neighborhood is given by the mechanical model.<br />
<br />
This characterization of the biological cells corresponds to the definition of type <code>CellBact</code> in the [[Paris/Sources#Cells_Spatial_Organization|program]].<br />
<br />
=== Dynamics ===<br />
<br />
The biological dynamics are really simple:<br />
<br />
* somatic cells produce DAP, grow and die<br />
<br />
* germ cell consume DAP, grow, divide and differentiate<br />
<br />
* DAP is diffusing between cells<br />
<br />
These rules are specified in the [[Paris/mgs#Transformations|transformation]] [[Paris/Sources#Cells_Spatial_Organization|<code>Evol</code>]]. In this transformation two rules are defined the first one to deal with somatic cells evolution and the second one with germ cells evolution. These rules can be understood as follows:<br />
<br />
* For somatic cells <code>(DAP,BactS,r)</code>:<br />
<br />
DAP <- DAP - (DAP production) - (Diffused DAP)<br />
'''if''' (random < probability of death)<br />
'''then'''<br />
kill the bacterium<br />
'''else'''<br />
'''if''' (random < probability to grow) & (r < maximum cell size)<br />
'''then'''<br />
r <- r + delta<br />
<br />
* For germ cells <code>(DAP,BactG,r)</code>, the evolution depends on the DAP dependent or independent differentiations model<br />
<br />
:* Case 1 (DAP dependent)<br />
<br />
DAP <- DAP - (DAP consummation) - (Diffused DAP)<br />
'''if''' (random < probability of differentiation) & (enough DAP) '''<- Here is the DAP dependence'''<br />
'''then'''<br />
Type <- BactS<br />
'''else'''<br />
'''if''' (r > maximum cell size)<br />
'''then'''<br />
'''if''' (random < probability to divide) & (DAP > minimal DAP required for division)<br />
'''then'''<br />
divide<br />
'''else'''<br />
'''if''' (random < probability to grow)<br />
'''then'''<br />
r <- r + delta<br />
<br />
:* Case 2 (DAP independent)<br />
<br />
DAP <- DAP - (DAP consummation) - (Diffused DAP)<br />
'''if''' (random < probability of differentiation) '''<- No DAP dependence'''<br />
'''then'''<br />
Type <- BactS<br />
'''else'''<br />
'''if''' (r > maximum cell size)<br />
'''then'''<br />
'''if''' (random < probability to divide) & (DAP > minimal DAP required for division)<br />
'''then'''<br />
divide<br />
'''else'''<br />
'''if''' (random < probability to grow)<br />
'''then'''<br />
r <- r + delta<br />
<br />
=== Coupling models ===<br />
<br />
Finally, considering together the two models, a cell is represented by a tuple <code>(DAP,Type,px,py,vx,vy,r)</code>.<br />
<br />
The dynamics are simply coupled by composing functions <code>Meca</code> and <code>Evol</code>. See function [[Paris/Sources#Cells_Spatial_Organization|<code>step</code>]].<br />
<br />
=== Parameters ===<br />
<br />
As it appears in the previous algorithms, a lot of parameters can be used to obtain different kind of evolutions. We introduce the reader to the 8 parameters:<br />
<br />
* <code>DT</code>: the time step. The same time step is used in the integrations of the mechanical model and in the DAP diffusion of the biological model. An application of function <code>step</code> computes the evolution of system during after <code>DT</code>.<br />
<br />
* <code>K</code> and <code>Mu</code> are respectively the spring constant (all the springs share the same constant) and the friction constant.<br />
<br />
* <code>R0_Gm</code>, <code>R0_G</code> and <code>R0_S</code> are the different threshold defining the range of cells radius. They are respectively the minimal germ cell size (after division), the maximal germ cells size (before division), and the maximal somatic cells size.<br />
<br />
* <code>Diff</code> characterized the DAP diffusion rate.<br />
<br />
* <code>Diffp</code> is the probability of differentiation.<br />
<br />
* <code>DEPOT</code> is the constant DAP production of somatic cells per unit of time.<br />
<br />
* <code>CONS</code> is the constant DAP consummation of germ cells per unit of time.<br />
<br />
* <code>DeathSP</code> is the probability of death of somatic cells.<br />
<br />
* <code>DivGP</code> is the probability of division of germ cells.<br />
<br />
* <code>CroitS</code> and <code>CroitG</code> are respectively probability of growth of somatic and germ cells.<br />
<br />
= Results [[Image:MGS-inside.png|50px]]=<br />
<br />
Thanks to [[Paris/mgs|MGS]] and [http://mgs.ibisc.univ-evry.fr/ImoView05/index.html ImoView] (a software dedicated to the 3D visualization of MGS programs outputs. The input of ImoView are written in a symbolic high-level scene description languages.) we are able to generate the following animations.<br />
<center><br />
<html><br />
<embed style="width:350px; height:300px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=2051019221671269340&hl=en" flashvars=""; > </embed><br />
<embed style="width:350px; height:300px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=2422231061053866723&hl=en=en =en" flashvars=""> </embed><br />
</html><br />
</center><br />
<center><br />
<html><br />
<embed style="width:350px; height:300px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=-193608487106391911&hl=en" flashvars=""; > </embed><br />
<embed style="width:350px; height:300px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=4619339118096511087&hl=en" flashvars=""> </embed></html></center><br />
<br />
In these animation, red and green spheres respectively represent germ and somatic cells. The brightness variations of the germ cells indicates the evolution of DAP concentration: the darker the color is, the lower the concentration is.<br />
<br />
On the first line, both animations are DAP '''dependent''' simulations, while the bottom line presents two animations of DAP '''independent''' simulations. Both models (with and without dependence) qualitatively exhibit the same global behavior. Only the speed of the population growth differs; the system seems to be more efficient when a DAP dependent differentiation is considered.<br />
<br />
The columns show another property of the system that is predicted in the [[Paris/Continuous_model|phenomenological study]]: it exists an unstable equilibrium. On the left, the behavior corresponds to evolving organism that develops itself and colonizes the environment: that is the exponential growth of the population. On the right, parameters have been tuned to simulate a stable evolution like in a tissue or an organ. The fact that this fixed point is unstable is here verified: due to the stochastic choice done in the model, using the same set of parameters that produce right column, the population sometimes collapses in simulations, falling in the trivial fixed point.<br />
<br />
=[[Paris/Sources#Cell auto 2|Sources]]=</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Cell_autoParis/Cell auto2007-10-26T13:16:51Z<p>Spicher: /* Results */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
<br><br />
<br />
= Introduction =<br />
<br />
DAP feeding between somatic and germ cells is based on an indirect communication process: soma cells produce DAP and release it in the environment; DAP molecules freely diffuse outside until they are captured by a germ cell. As the diffusion takes place in the environment, a somatic cell feed first the germ cells that are close to it. Then an well mixed hypothesis as the one used in the our [[Paris/Continuous_model|growth of population analysis]] is hard to assume. We are interesting here in the case where the differentiation of a germ into a soma is DAP dependent. In order to figure out the relation between DAP diffusion and differentiation we propose a simple cellular automaton on square grid. Each cell of the automaton contains a bacterium. We first detail some hypotheses used in this model, then we specify the local behavior rules following by each automaton cell. Finally, the generated simulation is presented.<br />
<br />
= Hypotheses =<br />
<br />
The chosen approach consists in observing the DAP diffusion and differentiation frontwaves. In order to focus on these phenomenon, we work on a ''constant'' population (no death, no division). So we assume that without DAP in its surrounding, a germ cell does not die but remain in passive state (we can imagine that they are at a stationary phase or between to division cycle). It will seem that DAP ''wake up'' bacteria but it's just an artifact due to this assumption.<br />
<br />
It may happen that a germ cell as enough DAP to evolve (typically when it is touched by a DAP diffusion front) but we assume that the contribution is not enough for the cell to divide.<br />
<br />
Finally, we assume then that DAP is produced in somatic cells only and consumed by germ cells. The communication is done by distinguishing in the automaton intra and extra cellular DAP (respectively named DAPi and DAPe).<br />
<br />
= Model Description =<br />
<br />
In this we focus on the elaboration of the cellular automaton.<br />
<br />
== Structure ==<br />
<br />
As we have previously announced, we design cellular automaton on a square grid. More precisely, in order to avoid boundary effects, we assume that the grid is actually wrapped in such a way the grid topology is a 2D torus. Each cell of the automaton contains a bacterium, either germ or somatic, together with the external DAP concentration. So we represent the different states of the automaton cell by tuple of values <code>{DAPe,DAPi,Type}</code>:<br />
<br />
* <code>DAPe</code> is the external DAP concentration,<br />
<br />
* <code>DAPi</code> is the internal DAP concentration in the bacterium,<br />
<br />
* <code>Type</code> represents if the bacterium is differentiated or not; it can take two values <code>BactG</code> and <code>BactS</code>.<br />
<br />
== Dynamics ==<br />
<br />
The following rules specify the local evolution of each cell of the automaton. We distinguished to evolution laws depending on what kind of bacterium is in the cell:<br />
<br />
*<html><u>In the case of a BactS cell</u></html>: we have to consider the diffusion of <code>DAPe</code> between the considered cell and its neighbors, the export of DAP from the inside to the outside, and finally the production of <code>DAPi</code>. The rule can be presented as follows:<br />
<br />
DAPe <- DAPe + (DAPe diffused in the neighborhood) + (DAPi lost by export)<br />
DAPi <- DAPi + (DAPi produced) - (DAPi lost by export)<br />
Type <- BactS<br />
<br />
*<html><u>In the case of a BactG cell</u></html>: we have to consider the diffusion of <code>DAPe</code> between the considered cell and its neighbors, the import of DAP from the outside to the inside, the consumption of <code>DAPi</code>, and finally the differentiation when DAP concentration reaches a right range of values. The rule can be presented as follows:<br />
<br />
DAPe <- DAPe + (DAPe diffused in the neighborhood) - (DAPi gain by import)<br />
DAPi <- DAPi - (DAPi consumed) + (DAPi gain by import)<br />
Type <- '''if''' (min_threshold) < DAPi < (max_threshold) '''then''' BactS '''else''' BactG<br />
<br />
== Parameters ==<br />
<br />
We consider 8 parameters. They are used with some noise during the evolution to avoid a deterministic behavior.<br />
<br />
* In <code>BactS</code> cells:<br />
<br />
:* Dap export rate in somatic bacteria<br />
<br />
:* Dap import rate in somatic bacteria<br />
<br />
:* Dap production rate of somatic bacteria<br />
<br />
* In <code>BactG</code> cells:<br />
<br />
:* Dap export rate in germ bacteria<br />
<br />
:* Dap import rate in germ bacteria<br />
<br />
:* Dap consummation rate of germ bacteria<br />
<br />
:* Minimal threshold for differentiation<br />
<br />
:* Maximal threshold for differentiation<br />
<br />
== Initial state ==<br />
<br />
Our initial state is 30x30 2D toric cellular automaton where all cells are initialized by value <code>{DAPe=0,DAPi=0,Type=BactG}</code> but four <code>{DAPe=0,DAPi=0,Type=BactS}</code> are randomly placed in the grid.<br />
<br />
<br />
<br />
= Output [[Image:MGS-inside.png|50px]]=<br />
<br />
Our implementation was done in [[Paris/mgs|MGS]] and the output was generated by [http://www.sciences.univ-nantes.fr/info/perso/permanents/cohen/SOFTWARE/GBVIEW/index.html GBView].<br />
<br />
The output is two animated pictures: the first one shows the differentiation, the other the diffusion of DAPe<br><br />
<center>[[Image:Paris\Diff_DAP.gif|Dap diffusion]][[Image:Paris\Diffe.gif|Bact differentiation]]</center><br><br />
<br />
*The first picture shows the diffusion of DAP: the front wave is figured in light blue; the dark blue area corresponds to stable parts of the system where concentration do not evolve anymore.<br />
<br />
*The second picture presents the differentiation: red and blue cells are respectively germ and somatic bacteria.<br />
<br />
= Results =<br />
<br />
As we can see, the differentiation and DAP diffusion wave fronts are superposed. This simulation is obviously out of reality but the underlying model have been developed in order to consider that low concentration of DAP induces differentiation (cells become green - dark blue), while with high DAP concentration, the differentiation is inhibited. Without this second threshold, all cells would differentiate. But some germ cells remain because they are enough fed to stay over the threshold. This property is of course crucial as only germ cells can reproduce.<br />
<br />
In the considered model of the system, the inhibition must be strong and effective for not all the cells differentiate. Bad thresholds make the system collapse: a too strong inhibition prevents germ cells to differentiate, and on the opposite, a too weak inhibition make all them switch to a somatic state.<br />
<br />
By tuning the constant of diffusion, we have noted that the 3 steps communication process (export, diffusion, import) is of main interest. For a few molecules of DAP imported in germ cells, an important amount of produced DAP has to be produced: there is a lot of lost during the process. So in order to keep a coherent rate of production, a germ cell must be surrounded by a lot of somatic bacteria: the ratio of 1:1 of differentiated and germ cell is not viable, that is why a lot of somatic cells feed isolated germ bacteria as enlighten by the animations.<br />
<br />
= [[Paris\Sources#Cell auto|Sources]] =</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T01:41:12Z<p>Spicher: /* Conclusion */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
== MGS Implementation ==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific rules application strategy implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results ==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as the [[Paris/Cell_auto_2|complex automaton]] shows, somatic cells only feed germ cells that surround them. The spatial distribution of cells is here not taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|spatial model]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Stochastic_modelParis/Stochastic model2007-10-26T01:27:31Z<p>Spicher: /* Handling Membranes */</p>
<hr />
<div>{{Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this last part of the models section, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria.<br />
<br />
<br><br />
== Introduction ==<br />
In 1977, Gillespie developed an exact ''Simulation Stochastic Algorithm'' (SSA) dedicated to the simulation of ''homogeneous'' chemical systems. This method was recently used in many applications for the simulation of biological systems. A good point of this approach is that it allows to handle biochemical systems where numbers of molecules are low and that cannot be well characterized by classical approach using differential equations and chemical concentrations. Nevertheless this method requires strong hypotheses about the spatial homogeneity of molecules distribution. Extensions of Gillespie's SSA have been proposed to deal with compartments.<br />
<br />
As our system is composed of a growing and heterogeneous population of bacteria, we propose to use this extension to simulate it. In the following paragraphs, we first detail the extended SSA we use and then we present some samples generated by our implementation using the set of parameters found in the numerical analysis of the model. Note that the main contribution here is in the development of the simulation algorithm.<br />
<br />
== Extended SSA ==<br />
<br />
=== Gillespie's SSA ===<br />
<br />
From a computational point of view, the Gillespie SSA relies on a discrete events simulation of chemical reactions between individual molecules. A reaction <code>R<sub>mu</sub></code> like <code>A + B -> C</code> occurs when reactants <code>A</code> and <code>B</code> meet with enough energy to produce a molecule <code>C</code>. The probability that this reaction occurs during an infinitesimal time is proportional to the number of molecules <code>A</code> and <code>B</code> in the system (dependence on the concentration) and a coefficient <code>c<sub>mu</sub></code> called the ''stochastic constant'' (corresponding to the reaction kinetic) when reactants are uniformly distributed in the system (intuitively it means that each couple of molecules has the same probability to meet). Assuming a system composing of molecules that can interact with respect to reactions <code>R<sub>1</sub></code> ... <code>R<sub>N</sub></code>, this probability allows to compute the probability law ''p(<code>mu</code>,<code>tau</code>)'' that ''the next reaction to occur is <code>R<sub>mu</sub></code> after <code>tau</code> units of time''.<br />
<br />
The algorithm developed by Gillespie consists in iterating the drawing of the next reaction <code>mu</code> to occur together with its reaction time <code>tau</code> using ''p(<code>mu</code>,<code>tau</code>)'', and in making the system evolves. Assuming that <code>S</code> is chemical solution where reactions <code>R<sub>0</sub></code> ... <code>R<sub>N</sub></code> can occur at a given time <code>t</code>, the SSA can be expressed as follows:<br />
<br />
<code><br />
'''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
'''compute''' ''mu'' and ''tau'' using ''p(mu,tau)''<br />
'''compute''' S' by applying ''mu'' on S<br />
'''return''' (S',t+''tau'')<br />
}<br />
</code><br />
<br />
=== Handling Membranes ===<br />
<br />
[[Image:compartment.png|300px|right]]<br />
In the SSA, molecules have to be uniformly distributed in space. It cannot be straightly used to deal with systems that exhibit a complex spatial organization, as the system we are interested in. Taking space into account means modifying the probability law ''p(mu,tau)'' in order to take care of the localization of the reaction. Obviously, it cannot be computed in practice for any kind of organization, but it is possible to develop ''ad-hoc'' algorithms for specific organizations.<br />
<br />
We propose to consider a population of bacteria as a nested membranes system, called ''compartments''. The environment where bacteria live is represented by a compartment that contains molecules and bacteria, and a bacterium is then represented by a compartment that contains molecules. In each compartment, the contained elements are assumed to be uniformly distributed in space.<br />
<br />
=== Extended Algorithm ===<br />
<br />
The extension relies on the fact that compartments elements are uniformly organized, meaning the SSA can be used in each compartment. Intuitively, at each iteration of the new algorithm, the standard SSA is evaluated on each compartment of the system ; the compartment with the smallest reaction time is updated (with respect to the corresponding reaction) and the other compartments remain unchanged. This procedure is naturally recursive and can be expressed as follows:<br />
<br />
<code><br />
'''ExtSSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>) = {<br />
(S',t') := '''SSA''' (S,t,R<sub>0</sub>,...,R<sub>N</sub>)<br />
'''foreach''' compartment M of S '''do'''<br />
'''let''' (M',t<sub>M</sub>) = '''ExtSSA''' (M,t,R<sub>0</sub>,...,R<sub>N</sub>) '''in'''<br />
'''if''' t<sub>M</sub> < t'<br />
'''then'''<br />
S' := '''replace''' M by M' in S<br />
t' := t<sub>M</sub><br />
'''done'''<br />
'''return''' (S',t')<br />
}<br />
</code><br />
<br />
This algorithm is taken from [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here].<br />
<br />
== SMB in Terms of Compartments and Chemical Reactions ==<br />
<br />
== MGS Implementation ==<br />
<br />
As presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here], the MGS language provides a specific rules application strategy implementing the SSA. We propose to implement the algorithm <code>ExtSSA</code> using MGS. The program (available [[Paris/Sources#Gillespie_Simulation|here]]) is briefly described with the representation of the system, the encoding of chemical reactions and a proposition of optimization for <code>ExtSSA</code>.<br />
<br />
=== State and Structure ===<br />
<br />
First of all, our system handle different types of molecules. They are represented in MGS by symbols (back quoted strings):<br />
<br />
* <code>`DAP</code>: DAP molecules<br />
<br />
* <code>`Cre</code>: Cre molecules<br />
<br />
* <code>`DAPAp</code>: DAP sensitive promoter (inhibited form: <code>`DAPAp_i</code>)<br />
<br />
* <code>`LOXP_Box</code>: DNA configuration of germ cells (Cre bounding form: <code>`LOXP_Box_Cre</code>)<br />
<br />
* <code>`DAP_Box</code>: DNA configuration of somatic cells<br />
<br />
As mentioned above, the system is represented by nested compartments. MGS provides the so-called ''bag'', a particular data structure corresponding to multi-sets (sets where multiple occurrences of the same element are allowed) whose topology is a complete graph. In other words, each element of the bag is neighbor with all the others. From the dynamical systems point of view, the neighborhood is equivalent to a potential interaction: in bags, each element can react with all the others. This topology is then perfect to represent chemical solutions and, of course, compartments. The system is composed of 3 types of compartments defined [[Paris/Sources#Structure|here]]:<br />
<br />
* the environment of type <code>Env</code> where all bacteria are localized <br />
<br />
* the germ cells of type <code>BactG</code> that must contain one molecule <code>`LOXP_Box</code><br />
<br />
* the somatic cells of type <code>BactS</code> that must contain ne molecule <code>`DAP_Box</code><br />
<br />
The value <code>(`DAP::`DAP_Box::BactS:())::(`LOXP_Box::BactG:())::`DAP::Env:()</code> is an example of a system state. It is composed of two bacteria, a germ cell and a somatic cell (the somatic contains one molecule of DAP), and an outside diffusing DAP molecule.<br />
<br />
=== Dynamics ===<br />
The chemical reactions are specified using transformation rules (see [[Paris/Sources#Dynamics|here]]). There are 14 different reactions embedding in two different transformations:<br />
<br />
* transformation <code>inBact</code>: this transformation specifies the chemical reactions occurring in bacteria (independently if they are germ or somatic). The reactions are chemicals degradation, DAPAp promoter inhibition, differentiation and DAP production (for somatic cells only).<br />
<br />
* transformation <code>inEnv</code>: this transformation specifies the chemical reactions occurring in the environment. Reactions are DAP degradation, DAP import and export (this rule actually appears in <code>inBact</code> to improve the efficiency of the program and to noticeably reduce the execution time).<br />
<br />
As an example, the following rule appears in <code>inBact</code>:<br />
<br />
<code><br />
`DAPAp, `DAP ={ C = sndOrder(K_DAPApI,1.0) }=> `DAPAp_i ;<br />
</code><br />
<br />
It specifies the inhibition of the promoter DAPAp by a molecule of DAP: <code>`DAPAp</code> and <code>`DAP</code> reacts to produce <code>`DAPAp_i</code>, the inhibited form of <code>`DAPAp</code>. In the arrow, the parameter <code>C</code> defines the stoachstic constant of this inhibition. It is computed using the function <code>sndOrder</code> that takes as arguments<br />
<br />
* <code>K_DAPApI</code>, the kinetic constant of this reaction (whose value is defined [[Paris/Sources#Global_Variables|here]]), and<br />
<br />
* the volume of the cell (we assume here that the volume is always 1.0 ; volume dependence is not implemented yet).<br />
<br />
=== Optimization ===<br />
The previously described <code>ExtSSA</code> is not straightly implemented. In fact, while stochastic simulations can deal with a small number of molecules, they often exhibit limitations as they are time greedy. On the first hand, events are triggered asynchronously: only one reaction is applied at each time step. As a consequence, a simulation requires a lot of time steps to be significant. On the other hand, choosing the next reaction requires to draw a lot of random numbers. Unfortunately, this operation is badly time consuming and increases the execution time.<br />
<br />
We propose to decrease the number of random numbers generations by freezing cells that do not evolve. This improvement consists in using a scheduler that stocks cells with their reaction time in a buffer (the program is available at [[Paris/Sources#Scheduling|here]]). At each time step, the SSA is evaluated on the environment. If the returning reaction time is smaller than the smallest reaction time of the buffer, then we make the environment evolves and reaction times of cells touched by this update are recomputed and the buffer updated. On the other, if the environment evolution is slower, the fastest reaction of the buffer is applied and the corresponding cell is updated. This improved version of <code>ExtSSA</code> is programmed [[Paris/Sources#ExtSSA|here]].<br />
<br />
To give an idea of the efficiency of our improved algorithm, the evaluation of a 100000 steps evolution starting with a population of 20 cells to reach a population size of about 230, is about 290s on a standard computer. Moreover, note that the MGS top-level is a prototyped and generic system that clearly not provides the efficiency of an ''ad-hoc'' programming of our improved <code>ExtSSA</code>.<br />
<br />
== Some Results ==<br />
The following figures was generated by the implementation of <code>ExtSSA</code> we have just described. We start with 20 germ cells without external DAP production. On the left, the temporal evolution of the bacteria population size. The exponential growth of the population is once again stressed by the simulation. On the left, the graph presents the mean number of DAP molecules in a cell. As we can see, this never goes above 5 molecules. It justifies<br />
the use of a stochastic process for realistic simulations.<br />
<br />
<p><br />
[[Image:GillespieBact.png|450px]]<br />
[[Image:GillespieDAP.png|450px]]<br />
</p><br />
<br><br />
<br />
== Conclusion ==<br />
<br />
We have developed a complex and generic framework for stochastic simulations of nested membranes systems following ideas presented [http://dx.doi.org/10.1016/j.biosystems.2006.12.009 here]. Moreover, our implementation provides an optimization that allows to use this framework in a life-size project.<br />
<br />
On the other hand, the simulation is not volume-dependent. As we do not take into account the evolution of the cells size, reactions rates are not yet well computed. This is a work in progress. Our simulation is also limited because of the homogeneous assumption of <code>ExtSSA</code> in compartments: the somatic cells feed all the germ cells. But as the [[Paris/Cell_auto_2|complex automaton]] shows, somatic cells only feed germ cells that surround them. The spatial distribution of cells is here not taken into account. A possible extension is to merge the three simulations to deal with all the aspects of the system:<br />
<br />
* the [[Paris/Cell_auto|first cellular automaton]] to simulate DAP diffusion in the environment<br />
<br />
* the [[Paris/Cell_auto_2|second cellular automaton]] to simulate the spatial organization of cells<br />
<br />
* the [[Paris/Stochastic_model|Gillespie based simulation]] to simulate the chemical reactions occurring in cells</div>Spicherhttp://2007.igem.org/wiki/index.php/File:Compartment.pngFile:Compartment.png2007-10-26T01:25:52Z<p>Spicher: </p>
<hr />
<div></div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Cell_autoParis/Cell auto2007-10-26T01:05:05Z<p>Spicher: /* Output */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br />
<br><br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
<br><br />
<br />
= Introduction =<br />
<br />
DAP feeding between somatic and germ cells is based on an indirect communication process: soma cells produce DAP and release it in the environment; DAP molecules freely diffuse outside until they are captured by a germ cell. As the diffusion takes place in the environment, a somatic cell feed first the germ cells that are close to it. Then an well mixed hypothesis as the one used in the our [[Paris/Continuous_model|growth of population analysis]] is hard to assume. We are interesting here in the case where the differentiation of a germ into a soma is DAP dependent. In order to figure out the relation between DAP diffusion and differentiation we propose a simple cellular automaton on square grid. Each cell of the automaton contains a bacterium. We first detail some hypotheses used in this model, then we specify the local behavior rules following by each automaton cell. Finally, the generated simulation is presented.<br />
<br />
= Hypotheses =<br />
<br />
The chosen approach consists in observing the DAP diffusion and differentiation frontwaves. In order to focus on these phenomenon, we work on a ''constant'' population (no death, no division). So we assume that without DAP in its surrounding, a germ cell does not die but remain in passive state (we can imagine that they are at a stationary phase or between to division cycle). It will seem that DAP ''wake up'' bacteria but it's just an artifact due to this assumption.<br />
<br />
It may happen that a germ cell as enough DAP to evolve (typically when it is touched by a DAP diffusion front) but we assume that the contribution is not enough for the cell to divide.<br />
<br />
Finally, we assume then that DAP is produced in somatic cells only and consumed by germ cells. The communication is done by distinguishing in the automaton intra and extra cellular DAP (respectively named DAPi and DAPe).<br />
<br />
= Model Description =<br />
<br />
In this we focus on the elaboration of the cellular automaton.<br />
<br />
== Structure ==<br />
<br />
As we have previously announced, we design cellular automaton on a square grid. More precisely, in order to avoid boundary effects, we assume that the grid is actually wrapped in such a way the grid topology is a 2D torus. Each cell of the automaton contains a bacterium, either germ or somatic, together with the external DAP concentration. So we represent the different states of the automaton cell by tuple of values <code>{DAPe,DAPi,Type}</code>:<br />
<br />
* <code>DAPe</code> is the external DAP concentration,<br />
<br />
* <code>DAPi</code> is the internal DAP concentration in the bacterium,<br />
<br />
* <code>Type</code> represents if the bacterium is differentiated or not; it can take two values <code>BactG</code> and <code>BactS</code>.<br />
<br />
== Dynamics ==<br />
<br />
The following rules specify the local evolution of each cell of the automaton. We distinguished to evolution laws depending on what kind of bacterium is in the cell:<br />
<br />
* In the case of a <code>BactS</code> cell: we have to consider the diffusion of <code>DAPe</code> between the considered cell and its neighbors, the export of DAP from the inside to the outside, and finally the production of <code>DAPi</code>. The rule can be presented as follows:<br />
<br />
DAPe <- DAPe + (DAPe diffused in the neighborhood) + (DAPi lost by export)<br />
DAPi <- DAPi + (DAPi produced) - (DAPi lost by export)<br />
Type <- BactS<br />
<br />
* In the case of a <code>BactG</code> cell: we have to consider the diffusion of <code>DAPe</code> between the considered cell and its neighbors, the import of DAP from the outside to the inside, the consumption of <code>DAPi</code>, and finally the differentiation when DAP concentration reaches a right range of values. The rule can be presented as follows:<br />
<br />
DAPe <- DAPe + (DAPe diffused in the neighborhood) - (DAPi gain by import)<br />
DAPi <- DAPi - (DAPi consumed) + (DAPi gain by import)<br />
Type <- '''if''' (min_threshold) < DAPi < (max_threshold) '''then''' BactS '''else''' BactG<br />
<br />
== Parameters ==<br />
<br />
We consider 8 parameters. They are used with some noise during the evolution to avoid a deterministic behavior.<br />
<br />
* In <code>BactS</code> cells:<br />
<br />
:* Dap export rate in somatic bacteria<br />
<br />
:* Dap import rate in somatic bacteria<br />
<br />
:* Dap production rate of somatic bacteria<br />
<br />
* In <code>BactG</code> cells:<br />
<br />
:* Dap export rate in germ bacteria<br />
<br />
:* Dap import rate in germ bacteria<br />
<br />
:* Dap consummation rate of germ bacteria<br />
<br />
:* Minimal threshold for differentiation<br />
<br />
:* Maximal threshold for differentiation<br />
<br />
== Initial state ==<br />
<br />
Our initial state is 30x30 2D toric cellular automaton where all cells are initialized by value <code>{DAPe=0,DAPi=0,Type=BactG}</code> but four <code>{DAPe=0,DAPi=0,Type=BactS}</code> are randomly placed in the grid.<br />
<br />
<br />
<br />
= Output [[Image:MGS-inside.png|50px]]=<br />
<br />
Our implementation was done in [[Paris/mgs|MGS]] and the output was generated by [http://www.sciences.univ-nantes.fr/info/perso/permanents/cohen/SOFTWARE/GBVIEW/index.html GBView].<br />
<br />
The output is two animated pictures: the first one shows the differentiation, the other the diffusion of DAPe<br><br />
<center>[[Image:Paris\Diff_DAP.gif|Dap diffusion]][[Image:Paris\Diffe.gif|Bact differentiation]]</center><br><br />
<br />
*The first picture shows the diffusion of DAP: the front wave is figured in light blue; the dark blue area corresponds to stable parts of the system where concentration do not evolve anymore.<br />
<br />
*The second picture presents the differentiation: red and blue cells are respectively germ and somatic bacteria.<br />
<br />
= Results =<br />
<br />
As we can see, the differentiation and DAP diffusion wave fronts are superposed. This simulation is obviously out of reality but the underlying model have been developed in order to consider that low concentration of DAP induces differentiation (cells become green - dark blue), while with high DAP concentration, the differentiation is inhibited. Without this second threshold, all cells would differentiate. But some germ cells remain because they are enough fed to stay over the threshold. This property is of course crucial as only germ cells can reproduce.<br />
<br />
In the considered model of the system, the inhibition must be strong and effective for not all the cells differentiate. Bad thresholds make the system collapse: a too strong inhibition prevents germ cells to differentiate, and on the opposite, a too weak inhibition make all them switch to a somatic state.<br />
<br />
= [[Paris\Sources#Cell auto|Sources]] =</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Cell_auto_2Paris/Cell auto 22007-10-26T01:02:45Z<p>Spicher: /* Introduction */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br />
<br><br />
= Introduction =<br />
<br />
The cellular automaton develop to compare diffusion of DAP and differentiation is very restrictive and unrealistic due to the lake of natural behavior of cells like growth, division, death ... As a matter of fact, a cellular automaton point of view does not allow to deal with dynamical population:<br />
<br />
* required automaton rules to push cells and to allow divisions, are hard to carry out;<br />
<br />
* the rigid structure of the grid prevent any topological modification of the population organization;<br />
<br />
* somatic cells that cannot divide keep on growing and become significantly bigger that germ bacteria, a missing notion in a cellular automaton.<br />
<br />
With this second simulation we focus on this issue. We consider SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and aim at studying the impact of the cells organization on the future of the population. In order to achieve this goal, we need a mechanistic model that will allow cell to divide and die. We propose to use a masses/springs model. Such model allow<br />
<br />
* division and death by adding or removing masses,<br />
<br />
* cell growth by increasing springs rest length,<br />
<br />
* to fill holes in the population (if there is some empty place in the population springs will push masses to fill it),<br />
<br />
* to prevent a dispersion of cells (springs cannot infinitely extends).<br />
<br />
This mechanistic model has to be coupled with the biological one we previously have developed.<br />
<br />
We first stress out the hypothesis of this simulation, we then detail the mechanistic and biological models, and finally, we simulate the system considering either a DAP controlled differentiation or a DAP independent differentiation.<br />
<br />
== Hypotheses ==<br />
<br />
In this model we made four important hypotheses:<br />
<br />
* Even if the somatic cells feed germ ones by an indirect process (using an external diffusion in the environment and not a direct bridge communication between cells) we consider that DAP cannot diffuse very far from a somatic cell and then a somatic cell can only feed close (in fact neighbor in our model) germ cells. As a consequence, we choose to model a direct communication (equivalent to an indirect communication with a small DAP diffusion rate) by putting a black box on the underlying complex mechanisms of feeding. In other words, there is no distinction between extenal and internal DAP; exchange are done directly from cell to cell.<br />
<br />
* We consider that the population evolves in size. So we allow bacteria to die and divide. Of cours, with respect to initial system, somatic cells cannot divide. On the other, we assume in this model that germ cells cannot die. In fact, we are here interested in studying the growth of the system that compulsorily requires presence of germ cells.<br />
<br />
* This point is not really an assumption but an property of cells that was not taken into account in the previous models. We will consider that cells are growing in size. In fact, the size of a somatic cell is supposed to be bigger than standard germ size. This could disturb a lot the geometric organization of the population.<br />
<br />
* Finally the two following case will be considered:<br />
<br />
:* First case: the differentiation is DAP dependent<br />
<br />
:* Second case: the differentiation is done with a constant rate<br />
<br />
= Description of the Model =<br />
<br />
As we have already said, this model is divided into two:<br />
<br />
* the mechanistic model that is used to deal with the cells displacement (using mechanical constraints) and their neighborhood,<br />
<br />
* the biological model that make cells evolve, growth (by extended springs rest length), divide, die, differentiate and communicate.<br />
<br />
Both are mainly independent (the only dependence appears with the growth where springs length are modified). So we will present them separately.<br />
<br />
== The Mechanical Model ==<br />
<br />
=== Neighborhood ===<br />
<br />
In the mechanistic part of the system, a cell is considered as a punctual mass localized in the 2D euclidean space. All the cells are sharing the mass (we choose 1 to simplify computation). Cells are also characterized by there velocity. Finally, in order to compute the spring rest length, each cell exhibits its radius. We represent them by a tuple <code>(px,py,vx,vy,r)</code> where <code>px</code> and <code>py</code> are the coordinate of the cell position, <code>vx</code> and <code>vy</code> are the coordinates of its velocity vector, and <code>r</code> represents its radius.<br />
<br />
The neighborhood between cells is computed using a [[Paris/mgs#Topological_Collections|Delaunay triangulation]]. In our system, if the triangulation make two cells become neighbors, this means that a spring is considered between their corresponding mass. The rest length of this spring is then the sum of the radius component of the mass representation. Once again to simplify computation the force constant of the spring is 1.<br />
<br />
This characterization of the cells as masses corresponds to the definition of type <code>MecaBact</code> in the [[Paris/Sources#Cells_Spatial_Organization|program]]. Fields have been added to save the sum of the forces that act on a mass.<br />
<br />
=== Dynamics ===<br />
<br />
We compute the displacement of a mass during a small time step by a Euler approximation. At each time step, the forces applied on each mass are summed, and twice integrated to compute the velocity, then the displacement and finally the new position of the mass. The considered forces are of two types: the restoring force exerted by the springs on each mass, and a friction force to prevent a divergent increase of the velocity and to ensure that the mechanical equilibrium will be reached.<br />
<br />
The dynamics have implemented using the [[Paris/mgs#Transformations|transformation]] [[Paris/Sources#Cells_Spatial_Organization|<code>Meca</code>]].<br />
<br />
== The Biological Model ==<br />
<br />
=== Structure ===<br />
<br />
The biological cells are represented in the same way as in the previous [[Paris/Cell_auto|cellular automaton]]. Each bacterium is either germ or somatic and is characterized by its DAP concentration. So we represent the different states of the automaton cell by tuple of values <code>{DAP,Type}</code>:<br />
<br />
* <code>DAP</code> is the internal DAP concentration in the bacterium,<br />
<br />
* <code>Type</code> represents if the bacterium is differentiated or not; it can take two values <code>BactG</code> and <code>BactS</code>.<br />
<br />
The neighborhood is given by the mechanical model.<br />
<br />
This characterization of the biological cells corresponds to the definition of type <code>CellBact</code> in the [[Paris/Sources#Cells_Spatial_Organization|program]].<br />
<br />
=== Dynamics ===<br />
<br />
The biological dynamics are really simple:<br />
<br />
* somatic cells produce DAP, grow and die<br />
<br />
* germ cell consume DAP, grow, divide and differentiate<br />
<br />
* DAP is diffusing between cells<br />
<br />
These rules are specified in the [[Paris/mgs#Transformations|transformation]] [[Paris/Sources#Cells_Spatial_Organization|<code>Evol</code>]]. In this transformation two rules are defined the first one to deal with somatic cells evolution and the second one with germ cells evolution. These rules can be understood as follows:<br />
<br />
* For somatic cells <code>(DAP,BactS,r)</code>:<br />
<br />
DAP <- DAP - (DAP production) - (Diffused DAP)<br />
'''if''' (random < probability of death)<br />
'''then'''<br />
kill the bacterium<br />
'''else'''<br />
'''if''' (random < probability to grow) & (r < maximum cell size)<br />
'''then'''<br />
r <- r + delta<br />
<br />
* For germ cells <code>(DAP,BactG,r)</code>, the evolution depends on the DAP dependent or independent differentiations model<br />
<br />
:* Case 1 (DAP dependent)<br />
<br />
DAP <- DAP - (DAP consummation) - (Diffused DAP)<br />
'''if''' (random < probability of differentiation) & (enough DAP) '''<- Here is the DAP dependence'''<br />
'''then'''<br />
Type <- BactS<br />
'''else'''<br />
'''if''' (r > maximum cell size)<br />
'''then'''<br />
'''if''' (random < probability to divide) & (DAP > minimal DAP required for division)<br />
'''then'''<br />
divide<br />
'''else'''<br />
'''if''' (random < probability to grow)<br />
'''then'''<br />
r <- r + delta<br />
<br />
:* Case 2 (DAP independent)<br />
<br />
DAP <- DAP - (DAP consummation) - (Diffused DAP)<br />
'''if''' (random < probability of differentiation) '''<- No DAP dependence'''<br />
'''then'''<br />
Type <- BactS<br />
'''else'''<br />
'''if''' (r > maximum cell size)<br />
'''then'''<br />
'''if''' (random < probability to divide) & (DAP > minimal DAP required for division)<br />
'''then'''<br />
divide<br />
'''else'''<br />
'''if''' (random < probability to grow)<br />
'''then'''<br />
r <- r + delta<br />
<br />
=== Coupling models ===<br />
<br />
Finally, considering together the two models, a cell is represented by a tuple <code>(DAP,Type,px,py,vx,vy,r)</code>.<br />
<br />
The dynamics are simply coupled by composing functions <code>Meca</code> and <code>Evol</code>. See function [[Paris/Sources#Cells_Spatial_Organization|<code>step</code>]].<br />
<br />
=== Parameters ===<br />
<br />
As it appears in the previous algorithms, a lot of parameters can be used to obtain different kind of evolutions. We introduce the reader to the 8 parameters:<br />
<br />
* <code>DT</code>: the time step. The same time step is used in the integrations of the mechanical model and in the DAP diffusion of the biological model. An application of function <code>step</code> computes the evolution of system during after <code>DT</code>.<br />
<br />
* <code>K</code> and <code>Mu</code> are respectively the spring constant (all the springs share the same constant) and the friction constant.<br />
<br />
* <code>R0_Gm</code>, <code>R0_G</code> and <code>R0_S</code> are the different threshold defining the range of cells radius. They are respectively the minimal germ cell size (after division), the maximal germ cells size (before division), and the maximal somatic cells size.<br />
<br />
* <code>Diff</code> characterized the DAP diffusion rate.<br />
<br />
* <code>Diffp</code> is the probability of differentiation.<br />
<br />
* <code>DEPOT</code> is the constant DAP production of somatic cells per unit of time.<br />
<br />
* <code>CONS</code> is the constant DAP consummation of germ cells per unit of time.<br />
<br />
* <code>DeathSP</code> is the probability of death of somatic cells.<br />
<br />
* <code>DivGP</code> is the probability of division of germ cells.<br />
<br />
* <code>CroitS</code> and <code>CroitG</code> are respectively probability of growth of somatic and germ cells.<br />
<br />
= Results [[Image:MGS-inside.png|50px]]=<br />
<br />
Thanks to [[Paris/mgs|MGS]] and [http://mgs.ibisc.univ-evry.fr/ImoView05/index.html ImoView] (a software dedicated to the 3D visualization of MGS programs outputs. The input of ImoView are written in a symbolic high-level scene description languages.) we are able to generate the following animations.<br />
<center><br />
<html><br />
<embed style="width:350px; height:300px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=2051019221671269340&hl=en" flashvars=""; > </embed><br />
<embed style="width:350px; height:300px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=2422231061053866723&hl=en=en =en" flashvars=""> </embed><br />
</html><br />
</center><br />
<center><br />
<html><br />
<embed style="width:350px; height:300px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=-193608487106391911&hl=en" flashvars=""; > </embed><br />
<embed style="width:350px; height:300px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=4619339118096511087&hl=en" flashvars=""> </embed></html></center><br />
<br />
In these animation, red and green spheres respectively represent germ and somatic cells. The brigthness variations of the germ cells indicates the evolution of DAP concetration: the darker the color is, the lower the concentration is.<br />
<br />
On the first line, both animations are DAP '''dependent''' simulations, while the bottom line presents two animations of DAP '''independent''' simulations. Both models (with and without dependence) qualitatively exhibit the same global behavior. Only the speed of the population growth differs; the system seems to be more efficient when a DAP dependent differentiation is considered.<br />
<br />
The columns show another property of the system that is predicted in the [[Paris/Continuous_model|phenomenological study]]: it exists an unstable equilibrium. On the left, the behavior corresponds to evolving organism that develops itself and colonizes the environment: that is the exponential growth of the population. On the right, parameters have been tuned to simulate a stable evolution like in a tissue or an organ. The fact that this fixpoint is unstable is here verified: due to the stochastic choice done in the model, using the same set of parameters that produce right column, the population sometimes collapses in simulations, falling in the trivial fixpoint.<br />
<br />
=[[Paris/Sources#Cell auto 2|Sources]]=</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T01:01:11Z<p>Spicher: /* Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth 50px */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to an exponential growth of the two coexisting cell types. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, each adapted to a particular problem.<br />
<br />
<br />
=== The questions of interest ===<br />
<br />
The first, most obvious question deals with proving the feasibility of our system (Section II). In our case, this amounts to check that the system presents a very simple, qualitative behavior: the two cell populations grow!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in the previous model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in Section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in Section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of principle: qualitative analysis of system's behavior=<br />
<br />
Those models are at macroscopic scale. They are focused on the evolution of the population, with global rules avoiding description of all the microscopic mechanisms. We present tree different works, with different approaches (ODE, automaton)...<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure|dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing robustness and optimizing system's behavior: quantitative analysis=<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
This model aims at describing the dynamic evolution of populations of germen and soma type bacteria.<br />
It is based on a set of differential equations describing DAP synthesis, Cre synthesis, DAP transport,<br />
differentiation of germen bacteria into soma and bacteria death.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part II, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part III, our results indicated that the system’s behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. <br />
<br />
We would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources| Models, Initial Conditions Files and Sources]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T01:00:08Z<p>Spicher: /* Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth 50px */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to an exponential growth of the two coexisting cell types. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, each adapted to a particular problem.<br />
<br />
<br />
=== The questions of interest ===<br />
<br />
The first, most obvious question deals with proving the feasibility of our system (Section II). In our case, this amounts to check that the system presents a very simple, qualitative behavior: the two cell populations grow!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in the previous model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in Section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in Section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of principle: qualitative analysis of system's behavior=<br />
<br />
Those models are at macroscopic scale. They are focused on the evolution of the population, with global rules avoiding description of all the microscopic mechanisms. We present tree different works, with different approaches (ODE, automaton)...<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this section, we aim at considering SMB as a [[Paris/mgs#Dynamical_Systems_with_a_Dynamical_Structure dynamical system with a dynamical structure]] and studying the impact of the cells organization on the future of the population. In order to achieve this goal, we have developed a mechanistic model based on a masses/springs system, that will allow cell to divide and die.<br />
<br />
=Assessing robustness and optimizing system's behavior: quantitative analysis=<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
This model aims at describing the dynamic evolution of populations of germen and soma type bacteria.<br />
It is based on a set of differential equations describing DAP synthesis, Cre synthesis, DAP transport,<br />
differentiation of germen bacteria into soma and bacteria death.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part II, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part III, our results indicated that the system’s behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. <br />
<br />
We would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources| Models, Initial Conditions Files and Sources]]===</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/Robustness_and_optimizationParis/Robustness and optimization2007-10-26T00:50:54Z<p>Spicher: /* Optimization */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br />
<br />
<br />
In section [[Paris/DesignProcess#Optimization_through_feedback|Design process]] two designs have been proposed. The only difference is that one of them incorporates a negative feedback of cre recombinase by dap. We developed simple models to evaluate the relative benefits of both designs in term of robustness and optimization capabilities.<br />
<br />
<br><br />
== Introduction ==<br />
This model aims at assessing robustness of the system with regards to kinetic parameters and initial condition variations and at investigating the possibilities to tune the system to improve its behavior. Additionaly, we would like to compare the robustness and optimization capabilities of two slightly different designs, one with a constant rate of synthesis of cre recombinase and one with a rate of synthesis driven by<br />
the concentration of Dap.<br />
<br />
<br />
This approach differs from the [[Paris/Continuous_model|first one]] by the level of description of the model<br />
and the numerical analysis done on the model. More precisely, it is based on a set of differential equations describing Dap synthesis, Cre synthesis, Dap transport, differentiation of germen bacteria into soma and bacteria death. <br />
<br />
<br />
We first provide a set of kinetic parameters such that the numerical simulation validate a given minimal behavior.<br />
Then we analyze the system robustness with regard to variations of its kinetic parameters and initial condition and finally we investigate ways to optimize the system behavior by adjusting some biologically relevant parameters.<br />
<br />
== Problem description ==<br />
=== System ===<br />
<p><br />
[[Image:Modelsimpl.png|left|500px|model]]<br />
</p><br />
<br />
<br />
<br />
<br />
<br />
The system studied is made of two populations of bacteria G (germen) and S (soma). Bacteria G can either divide or differentiate into S. <br />
<br />
Dap is only synthesized by bacteria S and diffuses in the environment and in G. <br />
<br />
G is dependent of Dap for division. Differentiation of G is controlled by Cre. Cre synthesis in G is either constant or dependant of Dap (red arrow).<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
=== Expected behavior ===<br />
We consider initial conditions in which only G cells are present. Because both Dap and S cells are absent, the system has to go through an intialization phase in which G differentiates into S cells and S cells start producing Dap. This initialization phase is vulnerable since no cell growth is possible. Adding Dap in the environment can only have a benefic effect on the population so we choose to start this study with an initial condition lacking Dap. <br />
In summary the expected behavior for this system is that cell populations grow fast enough and have a robust initialization phase.<br />
<br />
=== Modeling purpose ===<br />
* Is minimal behavior robust ?<br />
* How can we tune the system to improve its behavior ?<br />
* Which design should we prefer ?<br />
<br />
== Modelling ==<br />
=== Differential equations ===<br />
<br />
<br />
[[Image:EqGS.png|750px|ODE system]]<br />
<br />
Equations (1) and (2) takes into account cell division, differentiation and death.<br />
To model the dependence of division on Dap and differentiation on Cre for G cells we use Michaelis-Menten kinetics (terms λ<sub>div</sub> and λ<sub>diff</sub> in equations 1 and 2 with η<sub>Dap</sub><sup>div</sup>=η<sub>Cre</sub><sup>diff</sup>=1). <br />
<br />
<br />
[[Image:Eqcre.png|750px|ODE system]]<br />
<br />
Equation (3) represents the synthesis of Cre, its degradation and its dilution caused by Gcells growth. We consider two models : the synthesis rate of Cre is either constant (design 1) or inhibited by Dap (design 2) as indicated by the red term. Term λ<sub>div</sub> in equations (3,4) accounts for the dilution of Cre and Dap when the population of G grows.<br />
<br />
<br />
[[Image:Eqdap.png|750px|ODE system]]<br />
<br />
Equations involving Dap (4,5,6) represent Dap synthesis in soma bacteria, Dap degradation in bacteria and in the environment, Dap transport and the release of Dap in the environment from dying bacteria. Term λ<sub>diff</sub> in equation (6) is a corrective term to take into account the mean variation of concentration of Dap in G and S when some bacteria G differentiate into S.<br />
<br />
=== Parameters ===<br />
We first try to find out a set of parameter values such that the system exhibits a minimal growth and a robust initialization phase. We will then use this set of parameter values as a reference point for the robustness and optimization analysis. <br />
==== Initial condition ====<br />
<br />
The initial conditions correspond to a situation where only G cells are present, that is no bacteria S, no Dap and no Cre.<br />
<br />
==== Kinetic Parameters ====<br />
In order to set parameter values we use several different methods. First, parameters λ<sub>div</sub> and λ<sub>death</sub> are estimations based on experimental data. Then, we fix inequality constraints expressing on the one hand biological knowledge : Dap is actively imported into bacteria (κ<sub>imp</sub> > κ<sub>exp</sub>), bacteria death is lower than bacteria growth (λ<sub>death</sub><λ<sub>div</sub>), degradation of DAP in the environment is lower than in bacteria where it is consumed (γ<sub>Dap</sub><sup>E</sup> < γ<sub>Dap</sub><sup>GS</sup>),transport of DAP is an order of magnitude faster<br />
than reactions modelling death, growth or differentiation of bacteria (κ<sub>exp</sub>,κ<sub>imp</sub>>> λ<sub>div</sub>,λ<sub>death</sub>,λ<sub>diff</sub>) and on the other hand intuitive reasoning :<br />
differentiation must be lower than bacteria growth (λ<sub>diff</sub> > λ<sub>div</sub>). <br />
<br />
<br />
Based on these constraints on the parameters, we defined a set of parameter values p<sup>*</sup> as a reference starting point.<br />
<br />
=== Specification ===<br />
<br><br />
We define a minimal behavior that the system must display. First, we want that the quantity of bacteria G never <br />
falls below threshold Ginit/3. Secondly, we want that after a certain amount of time (2000 time units), the overall population of bacteria (G+S) is above threshold Ginit*5.<br />
<br />
For the parmaeter values p<sup>*</sup>, both systems validate this specification. The system with a synthesis rate of Cre dependent of Dap has the following behavior :<br />
<br />
<br />
[[Image:RefGS.png|900px|refGS]]<br />
<br />
<br><br />
<br />
== Analysis ==<br />
=== Robustness ===<br />
<br />
In order to evaluate the robustness of both models, we try to find a box in the parameter space containing p* such that for any point of this box the specification we defined is valid.<br />
<br />
First of all, we reduce the number of relevant parameters to ease the enumeration process. Several parameters values act by pair, such has κ<sub>exp</sub>/κ<sub>imp</sub> determing the ratio DapE/DapGS. For each of this pairs we retained only one parameter. By using this method we extracted 9 parameters from the existing 19 parameters.<br />
<br />
Then, to find the box we begin by searching for a box such that for any vertex of this box the system is valid, that is making 2^9 simulations and checking for everyone whether the specification is valid. Once such a box is found we sample the inner area to check if the specification is valid in the inside of the box. We sampled each parameter's interval value with 4 points. It takes about 9 hours to make simulations for 4^9 parameters.<br />
<br />
For the system with a variable rate of synthesis of Cre the following box is valid :<br />
<br />
{| cellspacing="0" border="1"<br />
|<br />
|λ<sub>diff</sub><br />
|λ<sub>div</sub><br />
|λ<sub>death</sub><br />
|κ<sub>exp</sub><br />
|θ<sub>div</sub><sup>dap</sup><br />
|θ<sub>diff</sub><sup>cre</sup><br />
|θ<sub>cre</sub><sup>dap</sup><br />
|Ginit<br />
|-<br />
|% decrease<br />
|20<br />
|1.5<br />
|90<br />
|50<br />
|20<br />
|8.6<br />
|30<br />
|10<br />
|-<br />
|% increase<br />
|10<br />
|4.6<br />
|10<br />
|100<br />
|10<br />
|100<br />
|15<br />
|1000<br />
|-<br />
|}<br />
<br />
The system is very responsive to parameters λ<sub>diff</sub>, λ<sub>div</sub> and λ<sub>death</sub>. A combined very small change of these 3 parameters int the system is enough to invalidate the required behavior. <br />
<br />
The second system with a constant synthesis rate of Cre is not valid in this whole box. 536 out of the 262000 points in this box are not valid fot this system. Here is a simulation for a given set of parameter values inside this box for which the constant rate system is not valid.<br />
<br />
<br />
[[Image:Robref.jpg|left|450px|refGS]]<br />
<br />
<br />
This tends to show that having a negative feedback of Cre synthesis by Dap leads to a more robust design.<br />
<br />
=== Optimization ===<br />
<br />
We compare the growth of the system to the growth of the wild type bacteria. After 2000 time units, the wild type bacteria attains a population of 61000 compared to 14 when parameter values are set to p*.<br />
<br />
For that reason we try to adjust some parameter values to obtain a better growth. We only consider parameters directly corresponding to biologically adjustable properties of the system. These parameters are cre synthesis(κ<sub>cre</sub>), dap synthesis(κ<sub>dap</sub>), and inhibition of cre synthesis by dap (θ<sub>cre</sub><sup>dap</sup>). Moreover we consider we can change these parameters at most by x100 or x0.01. our approach is to sample thi interval values for each parameter to find the optimal combined value of these parameters in this range.<br />
<br />
The population exhibits an exponential growth of type exp(kt). In order to measure the relative growth of each set of parameters we compare value k in the exponential. The wild type has a growth k=λ<sub>div</sub>-λ<sub>death</sub>=0.055. For p*, the apparent growth is exponential with k=0.013. The best value for design (1) is 0.049 and is obtained for κ<sub>cre</sub>=κ<sub>cre</sub><sup>*</sup> /20, κ<sub>dap</sub>=κ<sub>dap</sub><sup>*</sup> *100 and θ<sub>cre</sub><sup>dap</sup>=θ<sub>cre</sub><sup>dap*</sup> * 4. For design 2 the best value is 0.044 and is obtained for κ<sub>cre</sub>=κ<sub>cre</sub><sup>*</sup> /100, κ<sub>dap</sub>=κ<sub>dap</sub><sup>*</sup>*100.<br />
<br />
Here are the simulation obtained for these values in both designs :<br />
<br />
[[Image:Opt2000.png|left|450px|refGS]]<br />
[[Image:Opt800.png|right|450px|refGS]]<br />
[[Image:Opt800cre.png|left|450px|refGS]]<br />
<br />
First curve displays the evolution of populations G and S in 200 time units, the second one the evolution of G and S in 800 time units while the third one shows off Cre concentration in 800 time units.<br />
<br />
First, we notice that the regulated system has a better start : high Cre concentration leads to a rapid increase in S cells and thus to higher dap amounts and a better growth of G cells. After intialisation phase is over the regulated system is still better : inhibition of Cre synthesis allows a lower Cre concentration, a lower differentiation rate that is a higher G/S ratio and a better growth.<br />
<br />
==Summary==<br />
<br />
These results tend to indicate that the model with negative feedback loop on Cre synthesis presents an increased robustness. <br />
<br />
In order to have a system with a population growth rate similar to the growth of the wild type, S cells have to produce a lot of Dap and differentiation of G cells has to be low so that ratio S/G << 1. <br />
Optimization anlysis shows that it is easier to achieve this with the regulated system. Inhibition of Cre synthesis by Dap indeed allows to have a very low overall differentiation in the growth phase and still have a fast initialization phase thanks to the initial burst of Cre caused by the lack of Dap in the initial condition.</div>Spicherhttp://2007.igem.org/wiki/index.php/Paris/ModelingParis/Modeling2007-10-26T00:48:12Z<p>Spicher: /* Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm */</p>
<hr />
<div>{{Template:Paris_menu_modeling}}<br />
<br><br><br />
<br />
=Introduction=<br />
<br />
=== Motivation for modeling ===<br />
<br />
We want to construct a multicellular bacterial organism made of two co-existing cell types. Brainstorming resulted in proposing the following system:<br />
* so-called soma cells, that produce a metabolite (DAP), and will not be able to divide,<br />
* so-called germ cells that are able to grow, but only in presence of (sufficient quantities of ) DAP, and are able to differentiate into soma cells.<br />
<br />
Informal reasoning indicate that this design should be correct, in the sense that it leads to an exponential growth of the two coexisting cell types. However, before actually constructing this system, we would like to assess the quality of our design using modeling approaches. Since different questions needed to be answered, we developed different types of models, each adapted to a particular problem.<br />
<br />
<br />
=== The questions of interest ===<br />
<br />
The first, most obvious question deals with proving the feasibility of our system (Section II). In our case, this amounts to check that the system presents a very simple, qualitative behavior: the two cell populations grow!<br />
Accordingly, we tested whether this property holds under various modeling assumptions.<br />
<br />
<br />
The simplest model that we have considered is a phenomenological ODE model (Section 2.1). Being very simple, analytic analysis is possible and the stability of equilibria can be investigated under mild assumptions on parameters.<br />
However, a number of phenomena that might play an important role are neglected in the previous model. By assuming that cellular and molecular concentrations evolve continuously and that the solution is well-mixed, noise and space-related issues may have been overlooked. To test whether these phenomena may affect the qualitative behavior of the system (i.e. growth), we developed two models, one focusing on spatial aspects of Dap diffusion on cell differentiation (Section 2.2), the other incorporating dynamical aspects of cell spatial organization (Section 2.3). These results are rather general, in the sense that the level of abstraction of these models does not allow to distinguish between the two slightly different designs proposed in Section [[Paris/DesignProcess#Optimization_through_feedback|Design process]].<br />
<br />
<br />
In addition to feasibility, robustness and tunability of the system are also of prime interest. More precisely, we would like to find an objective criteria to discriminate between the two competing designs proposed in Section [[Paris/DesignProcess#Optimization_through_feedback|Design process]]. The two designs differ by the presence or absence of a negative regulation of cre recombinase expression by Dap. To address this problem, we developed two numerical ODE models and investigated their relative robustness (Section 3.1) and tunability (Section 3.2). Finally, it is also important to check that stochastic phenomena that are neglected in ODE models do not affect the macroscopic behavior. Stated differently we checked whether the deterministic models and their stochastic counterparts present globally the same behavior (Section 3.3).<br />
<br />
=Proof of principle: qualitative analysis of system's behavior=<br />
<br />
Those models are at macroscopic scale. They are focused on the evolution of the population, with global rules avoiding description of all the microscopic mechanisms. We present tree different works, with different approaches (ODE, automaton)...<br />
<br />
===[[Paris/Continuous_model|Exponential growth of cellular populations: analytic analysis of an ODE model]]===<br />
<br />
We present here a theoretical approach based on population dynamics. We consider here the case of a well mixed, homogeneous, culture of the SMB organism, i.e. there is no space in this analysis and we follow only the variation of the different cell lines concentrations in the culture volume.<br />
<br />
===[[Paris/Cell_auto|Potential macroscopic effect of spatial aspects of Dap diffusion: cellular automaton on a grid]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this part of our work, we aim at characterizing the diffusion of the DAP and the effect on the cells differentiation. This study consists in observing by simulation, the diffusion of DAP in a lawn of germ cells with some isolated somatic cells using a cellular automaton.<br />
<br />
===[[Paris/Cell_auto_2|Potential macroscopic effect of stochastic and spatial aspects of Dap diffusion and cell growth]] [[Image:MGS-inside.png|50px]]===<br />
<br />
We try with this work to characterize the effect on the cells, of the DAP diffusion in a free space where cells can divide or die.<br><br />
We have a growing culture with germinal cells and somatic cells.<br><br />
We want to see if we can have different kinds of evolution for our cells.<br><br />
as we can see in the [[Paris/Cell_auto|DAP diffusion automaton]] the diffusion mechanism and the effect on differentiation can be describe more accurately, so for the moment we just ignore the diffusion putting a black box on it and just focused on the total number of DAP entities.<br />
<br />
=Assessing robustness and optimizing system's behavior: quantitative analysis=<br />
<br />
===[[Paris/Robustness and optimization|Assessing robustness and tunability of two potential designs: numerical simulations of ODE models]]=== <br />
This model aims at describing the dynamic evolution of populations of germen and soma type bacteria.<br />
It is based on a set of differential equations describing DAP synthesis, Cre synthesis, DAP transport,<br />
differentiation of germen bacteria into soma and bacteria death.<br />
<br />
===[[Paris/Stochastic model|Potential macroscopic effect of stochastic phenomena: stochastic simulations with Gillespie algorithm]] [[Image:MGS-inside.png|50px]]===<br />
<br />
In this last part, we are developing a stochastic simulation of the microscopic model. The major contribution is to handle in a stochastic context a dynamic and heterogeneous population of bacteria. We were able to achieve this goal by proposing an optimized extension of the Gillespie algorithm.<br />
<br />
=Summary=<br />
<br />
<br />
The goal of our modeling work was to test our design, mainly to identify potential flaws of the system at early developmental stages.<br />
<br />
In part II, we showed that the system can present – at least qualitatively – the desired behaviour: an exponential growth of the two populations of coexisting cellular types.<br />
<br />
In part III, our results indicated that the system’s behavior should be reasonably robust, and provided arguments in favour of the design having a negative regulation of recombinase expression by Dap (increased robustness and tunability).<br />
<br />
In all cases, models incorporating additional details, related to space and/or stochasticity, indicated that these phenomena should not affect the global behavior of the system. So previous conclusions, obtained using deterministic models, should remain valid despite the fact that we neglected noise- and space-related issues. <br />
<br />
We would like to stress here that these results should be taken with great care, given the extreme simplicity of our models and the lack of data to provide information on parameter values and initial conditions. But still, globally…<br />
<br />
:'''…all these results corroborate our initial design'''.<br />
<br />
=Appendix=<br />
<br />
===Tools Description===<br />
<br />
<br />
For our simulations we used unusual tools, Biocham and MGS. Thanks to their specificities and capacities, we were able to simulate ''easily'' the mechanisms that we wanted to focus on.<br />
<br />
====[[Paris/biocham|Biocham]]====<br />
[http://contraintes.inria.fr/BIOCHAM/ BIOCHAM] is a programming environment for modeling biochemical systems, making simulations and querying the model in temporal logic.<br />
<br />
====[[Paris/mgs|MGS]]====<br />
[[Image:MGS-inside.png|150px|right]]<br />
<br><br />
[http://mgs.ibisc.unive-evry.fr/ MGS] is an experimental programming language developed at the university of Evry and dedicated to the modeling and the simulation of dynamical systems with a dynamical structure. We briefly present in this section the philosophy of MGS programming.<br />
<br><br><br><br><br />
<br />
===[[Paris/Sources| Models, Initial Conditions Files and Sources]]===</div>Spicher