A Spatial Calculus of Wrapped Compartments^{†}^{†}thanks: This research is funded by the BioBITs Project (Converging Technologies 2007, area: BiotechnologyICT), Regione Piemonte.
Abstract
The Calculus of Wrapped Compartments (CWC) is a recently proposed modelling language for the representation and simulation of biological systems behaviour. Although CWC has no explicit structure modelling a spatial geometry, its compartment labelling feature can be exploited to model various examples of spatial interactions in a natural way. However, specifying large networks of compartments may require a long modelling phase. In this work we present a surface language for CWC that provides basic constructs for modelling spatial interactions. These constructs can be compiled away to obtain a standard CWC model, thus exploiting the existing CWC simulation tool. A case study concerning the modelling of Arbuscular Mychorrizal fungi growth is discussed.
1 Introduction
Several complex biological phenomena include aspects in which space plays an essential role, key examples are the growth of tissues and organisms, embryogenesis and morphogenesis processes or cell proliferation. This has encouraged, in recent years, the development of formal models for the description of biological systems in which spatial properties can be taken into account [10, 5, 20], as required by the emerging field of spatial systems biology [27] which aims at integrating the analysis of biological systems with spatial properties
The Calculus of Wrapped Compartments (CWC) [13, 12, 11] is a calculus for the description of biochemical systems which is based on the notion of a compartment which represents, in some sense, the abstraction of a region with specific properties (characterized by a label, a wrap and a content). Biochemical transformations are described via a set of stochastic reduction rules which characterize the behaviour of the represented system.
In a recent work [8] we have have shown how CWC can be used to model spatial properties of biological systems. The idea is to exploit the notion of compartment to represent spatial regions (with a fixed, twodimensional topology) in which the labels plays a key role in defining the spatial properties. In this framework, the movement and growth of system elements are described, via specific rules (involving adjacent compartments) and the functionalities of biological components are affected by the spatial constraints given by the sector in which they interact with other elements. CWC allows to model several spatial interactions in a very natural way. However, when the complexity of simulation scenarios increases, the specification of large networks of compartments each one having its own peculiar behaviour and initial state may require a long and error prone modelling phase.
In this paper we introduce a surface language for CWC that defines a framework in which the notion of space is included as an essential component of the system. The space is structured as a square grid, whose dimension must be declared as part of the system specification. The surface language provides basic constructs for modelling spatial interactions on the grid. These constructs can be compiled away to obtain a standard CWC model, thus exploiting the existing CWC simulation tool.
A similar approach can be found in [20] where the topological structure of the components is expressed via explicit links which require adhoc rules to represent movements of biological entities and a logicoriented language to flexibly specify complex simulation scenarios is provided. In order to deal with larger biological systems, we are planning to extend the CWC to the spatial domain incrementally. At this early stage we neglected to consider problems related to the increase of the spatial rules with the increasing dimension of the grid^{1}^{1}1note that in a 2D model the spacerelated rules grow according to the square of the grid dimension. A partial solution to this problem is the use of appropriate data structures to represent entities scattered on a grid. A further step in this direction should be that of allowing the definition of different topological representations for spatial distributions of the biological entities, like in [8]. This requires, obviously, that also the surface language be enriched with primitives suitable to express different spatial topology and related concepts (like the notion of proximity of locations and that of movement in space). The right spatial topology could also help to minimize the number of spatial rules needed for modeling phenomena. A more ambitious goal will be that of providing a basis for computational geometry to our simulator, in order to identify spatially significant events for the simulation. This will requires however a much bigger implementation effort.
Organisation of the Paper
Section 2 recalls the CWC framework. Section 3 presents the surface language needed to describe spatial terms and rules. Section 4 presents a case study concerning some spatial aspects in the modelling of Arbuscular Mychorrizal fungi. Section 5 concludes the paper by briefly discussing related work and possible directions for further work. The Appendix presents the software module implementing the surface language.
2 The Calculus of Wrapped Compartments
The Calculus of Wrapped Compartments (CWC) (see [13, 11, 12]) is based on a nested structure of ambients delimited by membranes with specific proprieties. Biological entities like cells, bacteria and their interactions can be easily described in CWC.
2.1 Term Syntax
Let be a set of atomic elements (atoms for short), ranged over by , , …, and a set of compartment types represented as labels ranged over by A term of CWC is a multiset of simple terms where a simple term is either an atom or a compartment consisting of a wrap (represented by the multiset of atoms ), a content (represented by the term ) and a type (represented by the label ).
As usual, the notation denotes occurrences of the simple term . We denote an empty term with . An example of CWC term is representing a multiset (multisets are denoted by listing the elements separated by a space) consisting of two occurrences of , one occurrence of (e.g. three molecules) and an type compartment which, in turn, consists of a wrap (a membrane) with two atoms and (e.g. two proteins) on its surface, and containing the atoms (e.g. a molecule) and (e.g. a DNA strand). See Figure 1 for some other examples with a simple graphical representation.
2.2 Rewriting Rules
System transformations are defined by rewriting rules, defined by resorting to CWC terms that may contain variables. We call pattern the l.h.s. component of a rewrite rule and open term the r.h.s. component of a rewrite rule, defined as multiset of simple patterns and simple open terms given by the following syntax:
where is a multiset of atoms, is a pattern (a, possibly empty, multiset of simple patterns), is a wrap variable (can be instantiated by a multiset of atoms), is a content variable (can be instantiated by a CWC term), is a multiset of atoms and wrap variables and is an open term (a, possibly empty, multiset of simple open terms). Patterns are intended to match, via substitution of variables with ground terms (containing no variables), with compartments occurring as subterms of the term representing the whole system. Note that we force exactly one variable to occur in each compartment content and wrap of our patterns and simple patterns. This prevents ambiguities in the instantiations needed to match a given compartment.^{2}^{2}2 The linearity condition, in biological terms, corresponds to excluding that a transformation can depend on the presence of two (or more) identical (and generic) components in different compartments (see also [21]).
A rewrite rule is a triple , denoted by , where and are such that the variables occurring in are a subset of the variables occurring in . The application of a rule to a term is performed in the following way: 1) Find in (if it exists) a compartment of type with content and a substitution of variables by ground terms such that ^{3}^{3}3The implicit (distinguished) variable matches with all the remaining part of the compartment content. and 2) Replace in the subterm with . We write if is obtained by applying a rewrite rule to . The rewrite rule can be applied to any compartment of type with in its content (that will be rewritten with ).
For instance, the rewrite rule means that in all compartments of type an occurrence of can be replaced by
While the rule does not change the label of the compartment where the rule is applied, it may change all the labels of the compartments occurring in its content. For instance, the rewrite rule means that, if contained in a compartment of type , all compartments of type and containing an in their wrap can change their type to .
For uniformity reasons we assume that the whole system is always represented by a term consisting of a single compartment with distinguished label and empty wrap, i.e., any system is represented by a term of the shape , which will be also written as , for simplicity.
2.3 Stochastic Simulation
A stochastic simulation model for biological systems can be defined along the lines of the one presented by Gillespie in [15], which is, de facto, the standard way to model quantitative aspects of biological systems. The basic idea of Gillespie’s algorithm is that a rate function is associated with each considered chemical reaction which is used as the parameter of an exponential distribution modelling the probability that he reaction takes place. In the standard approach this reaction rate is obtained by multiplying the kinetic constant of the reaction by the number of possible combinations of reactants that may occur in the region in which the reaction takes place, thus modelling the law of mass action. For rules defining spatial movement the kinetic constant can be interpreted as the speed of the movement. In [13], the reaction rate is defined in a more general way by associating to each reduction rule a function which can also define rates based on different principles as, for instance, the MichaelisMenten nonlinear kinetics.
For simplicity, in this paper, we will follow the standard approach in defining reaction rates. Each reduction rule is then enriched by the kinetic constant of the reaction that it represents (notation ). For instance in evaluating the application rate of the stochastic rewrite rule (written in the simplified form) to the term in a compartment of type we must consider the number of the possible combinations of reactants of the form in . Since each occurrence of can react with each occurrence of , this number is 4. So the application rate of is .
2.4 The CWC simulator
The CWC simulator [2] is a tool under development at the Computer Science Department of the Turin University, based on Gillespie’s direct method algorithm [15]. It treats CWC models with different rating semantics (law of mass action, MichaelisMenten kinetics, Hill equation) and it can run independent stochastic simulations over CWC models, featuring deep parallel optimizations for multicore platforms on the top of FastFlow [3]. It also performs online analysis by a modular statistical framework.
3 A Surface Language
In this section we embed CWC into a surface language able to express, in a synthetic form, both spatial (in a twodimensional grid) and biochemical CWC transformations. The semantics of a surface language model is defined by translation into a standard CWC model.
We distinguish between two kind of compartments:

Standard compartments (corresponding to the usual CWC compartments), used to represent entities (like bacteria or cells) that can move through space.

Spatial compartments, used to represent portions of space. Each spatial compartment defines a location in a two dimensional grid through a special atom, called coordinate, that occurs on its wrap. A coordinate is denoted by row.column, where row and column are intergers. Spatial compartments have distinguished labels, called spatial labels, that can be used to provide a specific characterisation of a portion of space.
For simplicity we assume that the wraps of each spatial compartment contains only the coordinate. Therefore, spatial compartment differentiations can be expressed only in terms of labels.^{4}^{4}4Allowing the wrap of spatial compartments to contain other atoms, thus providing an additional mean to express spatial compartment differentiations, should not pose particular technical problems (extend the rules of the surface language to deal with a general wrap content also for spatial compartments should be straightforward).
For example, the spatial compartment represents the cell of the grid located in the first row and the second column, and has type soil, the spatial compartment represents a watertype spatial compartment in position 2.3. In our grid we assume that molecules can float only through neighbor cells: all the rules of interaction between spatial compartments must obviously contain the indexes of their location. For example, the rule moves the molecule from the water compartment in position 1.2 to the soil compartment in position 2.2 with a rate representing in this case, the speed of the movement of in downwards direction from a cell of watertype to a cell of soiltype.
Let R and C denote the dimensions of our R C grid defined by R rows and C columns. To increase the expressivity of the language we define a few structures to denote portions (i.e. sets of cells) of the grid. With we denote a set of coordinates of the grid and we use the notion r.c when the coordinate r.c is contained in the set . We define rectangles by rect[r.c,r’.c’] where r.c,r’.c’ represent the edges of the rectangle. We project rows and columns of our grid with the constructions row[] and col[] respectively.
Example 3.1
The set represents the set of coordinates
Note that row[] is just a shorthand for
rect[i.1,i.C]. Similarly for
columns.
We use [*] as shorthand to indicate the whole grid
(i.e. rect[1.1,R.C]).
We also define four direction operators, N, W, S, E that applied to a range of cells shift them, respectively, up, left, down and right. For instance E(1.1) = 1.2. In the intuitive way, we also define the four diagonal movements (namely, NW, SW, NE, SE). With we denote a set of directions and we use the special symbol to denote the set containing all eight possible directions.
We convene that when a coordinate, for effect of a shit, goes out of the range of the grid the corresponding point is eliminated from the set.
3.1 Surface Terms
We define the initial state of the system under analysis as a set of compartments modelling the twodimensional grid containing the biological entities of interest.
Let denote a set of coordinates and a spatial label. We use the notation:
to define a set of cells of the grid. Namely denotes the top level CWC term:
where range over all elements of .
A spatial CWC term is thus defined by the set of grid cells covering the entire grid.
Example 3.2
The CWC term obtained by the three grid cell constructions:
builds a grid composed by two portions of soil (the rightmost one reacher of nitrates and plant cells) divided by a river of water (see Figure 2(a)).
3.2 Surface Rewrite Rules
We consider rules for modelling three kind of events.
NonSpatial Events: are described by standard CWC rules, i.e. by rules of the shape:
Nonspatial rules can be applied to any compartment of type occurring in any portion of the grid and do not depend on a particular location.
Example 3.3
A plant cell might perform its activity in any location of the grid. The following rules, describing some usual activities within a cell, might happen in any spatial compartment containing the plant cells under considerations:
.
Spatial Events: are described by rules that can be applied to specific spatial compartments. These rules allow to change the spatial label of the considered compartment. Spatial events are described by rules of the following shape:
Spatial rules can be applied only
within the spatial compartments with coordinates contained in the set and with the spatial label . The application of the rule may also change the label of the spatial compartments to .
This rule is translated into the CWC set of rules:
Note that spatial rules are analogous to non spatial ones. The only difference is the explicit indication of the set which allows to write a single rule instead of a set of rule (one for each element of ).
Example 3.4
If we suppose that the river of water in the middle of the grid defined in Example 3.2 has a downward streaming, we might consider the initial part of the river (framed by the first row rect[1.4,1.7])
to be a source of nitrates (as they are coming from a region which is not modelled in the actual considered grid). The spatial rule:
models the arrival of nitrates at the first modeled portion of the river (in this case it does not change the label of the spatial compartment involved by the rule).
Spatial Movement Events: are described by rules considering the content of two adjacent spatial compartments and are described by rules of the following shape:
This rule changes the content of two adjacent (according to the possible directions contained in ) spatial compartments and thus allows to define the movement of objects. The pattern matching is performed by checking the content of a spatial compartment of type located in a portion of the grid defined by and the content of the adjacent spatial compartment of type . Such a rule could also change the labels of the spatial compartments. This rule is translated into the CWC set of rules:
for all and for all .
Example 3.5
We assume that the flux of the river moves the nitrates in the water according to a downward direction in our grid and with a constant speed in any portion of the river with the following rule:
when nitrates reach the downmost row in our grid they just disappear (non moving event):
.
Moreover, nitrates streaming in the river may be absorbed by the soil on the riverside with the rule:
.
A graphical representation of these events is shown in Figure 2(b). Other rules can be defined to move the nitrates within the soil etc.
4 Case Study: A Growth Model for AM Fungi
In this section we illustrate a case study concerning the modelling of Arbuscular Mychorrizal fungi growth.
4.1 Biological Model
The arbuscular mycorrhizal (AM) symbiosis is an example of association with high compatibility formed between fungi belonging to the Glomeromycota phylum and the roots of most land plants[16]. AM fungi are obligate symbionts, in the absence of a host plant, spores of AM fungi germinate and produce a limited amount of mycelium. The recognition between the two symbionts is driven by the perception of diffusible signals and once reached the root surface the AM fungus enters in the root, overcomes the epidermal layer and it grows interand intracellularly all along the root in order to spread fungal structures. Once inside the inner layers of the cortical cells the differentiation of specialized, highly branched intracellular hyphae called arbuscules occur. Arbuscules are considered the major site for nutrients exchange between the two organisms. The fungus supply the host with essential nutrients such as phosphate, nitrate and other minerals from the soil. In return, AM fungi receive carbohydrates derived from photosynthesis in the host.
Simultaneously to intraradical colonization, the fungus develops an extensive network of hyphae which explores and exploits soil microhabitats for nutrient acquisition. AM fungi have different hyphal growth patterns, anastomosis and branching frequencies which result in the occupation of different niche in the soil and probably reflect a functional diversity [19] (see Figure 3). The mycelial network that develops outside the roots is considered as the most functionally diverse component of this symbiosis. Extraradical mycelia (ERM) not only provide extensive pathways for nutrient fluxes through the soil, but also have strong influences upon biogeochemical cycling and agroecosystem functioning [23]. The mechanisms by which fungal networks extend and function remain poorly characterized. The functioning of ERM presumably relies on the existence of a complex regulation of fungal gene expression with regard to nutrient sensing and acquisition. The fungal life cycle is then completed by the formation, from the external mycelium, of a new generation of spores able to survive under unfavourable conditions.
Investigations on carbon (C) metabolism in AM fungi have proved useful to offer some explanation for their obligate biotrophism. As mentioned above, an AM fungus relies almost entirely on the host plant for its carbon supply. Intraradical fungal structures (presumably the arbuscules) are known to take up photosynthetically fixed plant C as hexoses. Unfortunately, no fungal hexose transportercoding gene has been characterized yet in AM fungi.
In order to quantify the contribution of arbuscular mycorrhizal (AM) fungi to plant nutrition, the development and extent of the external fungal mycelium and its nutrient uptake capacity are of particular importance. Shnepf and collegues [26] developed and analysed a model of the extraradical growth of AM fungi associated with plant roots considering the growth of fungal hyphae from a cylindrical root in radial polar coordinates.
Measurements of fungal growth can only be made in the presence of plant. Due to this practical difficulty experimental data for calibrating the spatial and temporal explicit models are scarce. Jakobsen and collegues [17] presented measurements of hyphal length densities of three AM fungi: Scutellospora calospora (Nicol.& Gerd.) Walker & Sanders; Glomus sp. associated with clover (Trifolium subterraneum L.);these data appeared suitable for comparison with modelled hyphal length densities.
The model in [26] describes, by means of a system of Partial Differential Equations (PDE), the development and distribution of the fungal mycelium in soil in terms of the creation and death of hyphae, tiptip and tiphypha anastomosis, and the nature of the rootfungus interface. It is calibrated and corroborated using published experimental data for hyphal length densities at different distances away from root surfaces. A good agreement between measured and simulated values was found for the three fungal species with different morphologies associated with Trifolium subterraneum L. The model and findings are expected to contribute to the quantification of the role of AM fungi in plant mineral nutrition and the interpretation of different foraging strategies among fungal species.
4.2 Surface CWC Model
In this Section we describe how to model the growth of arbuscular mycorrhyzal fungi using the surface spatial CWC. We model the growth of AM fungal hyphae in a soil environment partitioned into different layers (spatial compartments with label ) to account for the distance in centimetres between the plant root and the fungal hyphae where the soil layer at the interface with the plant root is at position . We describe the mycelium by two atoms: the hyphae (atom ) related to the length densities (number of hyphae in a given compartment) and the hyphal tips (atom ). The plant root (atom ) is contained in the compartment at position .
The tips and hyphae at the rootfungus interface proliferate according to the following spatial events:
where and is the root proliferation factor for the hyphae and tips respectively.
Hyphal tips are important, because growth occurs due to the elongation of the region just behind the tips. Therefore, the spatial movement event describing the hyphal segment created during a tip shift to a nearby compartment is:
where is the rate of tip movement. The hyphal length is related to tips movement, i.e. an hyphal trail is left behind as tips move through the compartments. We consider hyphal death to be linearly
proportional to the hyphal density, so that
the rule describing this spatial event is:
where is the rate of hyphal death.
Mycorrhizal fungi are known to branch mainly apically where one tip splits into two. In the simplest case, branching and tip death are linearly proportional to the existing tips in that location modelled with the following spatial events:
where is the tip branching rate and is the tip death rate.
Alternatively, if we assume that branching decreases with increasing tip density and ceases at a given maximal tip density, we employ the spatial event:
where . From a biological point of view, this behaviour take into account the volume saturation when the tip density achieves the maximal number of tips .
The fusion of two hyphal tips or a tip with a hypha can create interconnected networks by means of anastomosis:
where and are the tiptip and tiphypha anastomosis rate constants, respectively.
The initial state of the system is given by the following grid cell definition:
where and are the initial number of tips and hyphae respectively at the interface with the plant root.
4.3 Results
We run simulations on the model for the fungal species Scutellospora calospora and Glomus sp. Figure 4 show the mean values of hyphae (atoms ) of the resulting stochastic simulations in function of the elapsed time in days and of the distance from the root surface. The rate parameters of the model are taken from [26].
The results for S. calospora are in accordance with the linear PDE model of [26] which is characterized by linear branching with a relatively small net branching rate and both kinds of anastomosis are negligible when compared with the other species. This model imply that the fungus is mainly growing and allocating resources for getting a wider catchment area rather than local expoloitation of mineral resources via hyphal branching.
The model for Glomus sp. considers the effect of nonlinear branching due to the competition between tips for space. The results obtained for Glomus sp. are in accordance with the non–linear PDE model of [26] which imply that local exploitation for resources via hyphal branching is important for this fungus as long as the hyphal tip density is small. Reaching near the maximum tip density, branching decreases. Symbioses between a given host plant and different AM fungi have been shown to differ functionally [24].
5 Conclusions and Related Works
For the wellmixed chemical systems (even divided into nested compartments) often found in cellular biology, interaction and distribution analysis are sufficient to study the system’s behaviour. However, there are many other situations, like in cell growth and developmental biology where dynamic spatial arrangements of cells determines fundamental functionalities, where a spatial analysis becomes essential. Thus, a realistic modelling of biological processes requires space to be taken into account [18].
This has brought to the extension of many formalisms developed for the analysis of biological systems with (even continuous) spatial features.
In [10], Cardelli and Gardner develop a calculus of processes located in a threedimensional geometric space. The calculus, introduces a single new geometric construct, called frame shift, which applies a threedimensional space transformation to an evolving process. In such a work, standard notions of process equivalence give rise to geometric invariants.
In [6], a variant of Psystems embodying concepts of space and position inside a membrane is presented. The objects inside a membrane are associated with a specific position. Rules can alter the position of the objects. The authors also define exclusive objects (only one exclusive object can be contained inside a membrane). In [4], an spatial extension of CLS is given in a 2D/3D space. The spatial terms of the calculus may move autonomously during the passage of time, and may interact when the constraints on their positions are satisfied. The authors consider a hardsphere based notion of space: two objects, represented as spheres, cannot occupy the same space, thus conflicts may arise by moving objects. Such conflicts are resolved by specific algorithms considering the forces involved and appropriate pushing among the objects.
BioShape [7] is a spatial, particlebased and multiscale 3D simulator. It treats biological entities of different size as geometric 3D shapes. A shape is either basic (polyhedron, sphere, cone or cylinder) or composed (aggregation of shapes glued on common surfaces of contact). Every element involved in the simulation is a 3D process and has associated its physical motion law.
Adding too many features to the model (e.g., coordinates, position, extension, motion direction and speed, rotation, collision and overlap detection, communication range, etc.) could heavily rise the complexity of the analysis. To overcome this risk, a detailed study of the possible subsets of these features, chosen to meet the requirements of particular classes of biological phenomena, might be considered.
In this paper we pursued this direction by extending CWC with a surface language providing a framework for incorporating basic spatial features (namely, coordinates, position and movement). In future work we plan to extend the surface language to deal with three dimensional spaces and to investigate the possibility to incorporate other spatial features to the CWC simulation framework.
References
 [1]
 [2] M. Aldinucci, M. Coppo, F. Damiani, M. Drocco, E. Giovannetti, E. Grassi, E. Sciacca, S. Spinella & A. Troina (2010): CWC Simulator. Dipartimento di Informatica, Università di Torino. http://cwcsimulator.sourceforge.net/.
 [3] M. Aldinucci & M. Torquati (2009): FastFlow website. FastFlow. http://mcfastflow.sourceforge.net/.
 [4] R. Barbuti, A. MaggioloSchettini, P. Milazzo & G. Pardini (2009): Spatial Calculus of Looping Sequences. Electr. Notes Theor. Comput. Sci. 229(1), pp. 21–39. Available at http://dx.doi.org/10.1016/j.entcs.2009.02.003.
 [5] R. Barbuti, A. MaggioloSchettini, P. Milazzo & G. Pardini (2011): Spatial Calculus of Looping Sequences. Theoretical Computer Science .
 [6] R. Barbuti, A. MaggioloSchettini, P. Milazzo, G. Pardini & L. Tesei (2011): Spatial P systems. Natural Computing 10(1), pp. 3–16. Available at http://dx.doi.org/10.1007/s110470109187z.
 [7] F. Buti, D. Cacciagrano, F. Corradini, E. Merelli & L. Tesei (2010): BioShape: A Spatial Shapebased Scaleindependent Simulation Environment for Biological Systems. Procedia CS 1(1), pp. 827–835. Available at http://dx.doi.org/10.1016/j.procs.2010.04.090.
 [8] C. Calcagno, M. Coppo, F. Damiani, M. Drocco, E. Sciacca, S. Spinella & A. Troina (To Appear): Modelling Spatial Interactions in the AM Symbiosis using CWC. In: CompMod 2011.
 [9] L. Cardelli (2004): Brane Calculi. In: Proc. of CMSB’04, LNCS 3082, Springer, pp. 257–278.
 [10] L. Cardelli & P. Gardner (2010): Processes in Space. In: Proc. of the 6th international conference on Computability in Europe, CiE’10, SpringerVerlag, pp. 78–87.
 [11] M. Coppo, F. Damiani, M. Drocco, E. Grassi, M. Guether & A. Troina (2011): Modelling Ammonium Transporters in Arbuscular Mycorrhiza Symbiosis. Transactions on Computational Systems Biology XIII, pp. 85–109.
 [12] M. Coppo, F. Damiani, M. Drocco, E. Grassi, E. Sciacca, S. Spinella & A. Troina (2010): Hybrid Calculus of Wrapped Compartments. In: Proceedings Compendium of the Fourth Workshop on Membrane Computing and Biologically Inspired Process Calculi (MeCBIC’10), 40, EPTCS, pp. 103–121.
 [13] M. Coppo, Damiani. F., M. Drocco, Grassi. E. & A. Troina (2010): Stochastic Calculus of Wrapped Compartments. In: 8th Workshop on Quantitative Aspects of Programming Languages (QAPL’10), 28, EPTCS, pp. 82–98.
 [14] P. Degano, D. Prandi, C. Priami & P. Quaglia (2006): Betabinders for Biological Quantitative Experiments. Electr. Notes Theor. Comput. Sci. 164(3), pp. 101–117. Available at http://dx.doi.org/10.1016/j.entcs.2006.07.014.
 [15] D. Gillespie (1977): Exact Stochastic Simulation of Coupled Chemical Reactions. J. Phys. Chem. 81, pp. 2340–2361.
 [16] M.J. Harrison (2005): Signaling in the Arbuscular Mycorrhizal Symbiosis. Annu. Rev. Microbiol. 59, pp. 19–42.
 [17] I. Jakobsen, LK Abbott & AD Robson (1992): External Hyphae of Vesiculararbuscular Mycorrhizal Fungi Associated with Trifolium Subterraneum L. 1. Spread of Hyphae and Phosphorus Inflow into Roots. New Phytologist 120(3), pp. 371–379.
 [18] B. Kholodenko (2006): Cellsignalling Dynamics in Time and Space. Nature Reviews Molecular Cell Biology 7, pp. 165–176.
 [19] H. Maherali & J.N. Klironomos (2007): Influence of Phylogeny on Fungal Community Assembly and Ecosystem Functioning. Science 316(5832), p. 1746.
 [20] S. Montagna & M. Viroli (2010): A Framework for Modelling and Simulating Networks of Cells. Electr. Notes Theor. Comput. Sci. 268, pp. 115–129. Available at http://dx.doi.org/10.1016/j.entcs.2010.12.009.
 [21] N. Oury & G. Plotkin (2011): MultiLevel Modelling via Stochastic MultiLevel Multiset Rewriting. Draft submitted to MSCS.
 [22] T. Parr et al.: ANTLR website. http://www.antlr.org/.
 [23] S. Purin & M.C. Rillig (2008): Parasitism of Arbuscular Mycorrhizal Fungi: Reviewing the Evidence. FEMS Microbiology Letters 279(1), pp. 8–14.
 [24] S. Ravnskov & I. Jakobsen (1995): Functional Compatibility in Arbuscular Mycorrhizas Measured as Hyphal P transport to the Plant. New Phytologist 129(4), pp. 611–618.
 [25] A. Regev, E. M. Panina, W. Silverman, L. Cardelli & E. Y. Shapiro (2004): BioAmbients: An Abstraction for Biological Compartments. Theor. Comput. Sci. 325(1), pp. 141–167.
 [26] A. Schnepf, T. Roose & P. Schweiger (2008): Growth Model for Arbuscular Mycorrhizal Fungi. Journal of The Royal Society Interface 5(24), p. 773.
 [27] A. Spicher, O. Michel & J.L. Giavitto (2011): InteractionBased Simulations for Integrative Spatial Systems Biology. In: Understanding the Dynamics of Biological Systems, Springer New York, pp. 195–231.
Appendix: Implementation of the Surface Language
This Section presents a software module implementing the translation of a surface language model into the corresponding standard CWC model that can be executed by the CWC simulator (cf. Sec. 2.4). The module is written in Java by means of the ANTLR parser generator [22]. The input syntax of the software is defined as following.
Patterns, Terms and Open Terms: pattern, terms and open terms follow the syntax of CWC. In the definition of a compartment, its label is written in braces, as the first element in the round brackets. The symbol is translated into , and the empty sequence into e. If a pattern, term or open term is repeated several times, we write the number of repetitions before it.
Grid Coordinates: the row and the column of a grid coordinate are divided by a comma. All the constructions of the surface language are implemented. The components of a set of coordinates are divided by a blank space.
Directions: for the directions we use the same keywords of the surface language, plus the special identifiers +, x, * to identify all the orthogonal directions (N,S,W,E), all the diagonal directions (NW,SW,NE,SE) and all the directions, respectively.
Model Name: the name of the model is defined following the syntax
model ;
where is the name of the model.
Grid Dimensions: the dimensions of the grid are expressed with the syntax
grid , ;
where and are the number of rows and columns of the grid, respectively.
Grid Cell Construction: the notation of a grid cell is translated into the code line
cell < > { } ;
the module writes as many CWC compartments as the number of coordinates in : each of these copies has the same label and the same content , but a different coordinate in the wrap.
Non Spatial Events: the notation of a non spatial event is translated into the code line
nse { } [ ] ;
the module translates this line in a unique CWC rule.
Spatial Events: the notation of a spatial event is translated into the code line
se < > { } [ ] { } ;
As shortcuts, the absence of < > indicates the whole grid, and the absence of { } indicates that the label of the spatial compartment does not change. The module writes a CWC rule for each coordinate in : a rule differs from the others only in the coordinate written in its wrap.
Spatial Movement Events: the notation of a spatial movement event is translated into the code line
sme < > [ ] { } { } [ ] { } { } ;
As shortcuts, the absence of < > indicates the whole grid, and the absence of { } or { } indicates that the label of the spatial compartment does not change. In case of absence of { }, an underscore is used to separate and . For each coordinate in , the module writes as many CWC rules as the number of directions in ; in case of a coordinate on the edge of the grid, the module writes a CWC rule for a direction only if this one identifies an adjacent spatial compartment on the grid. The number of CWC rules is therefore less or equal to .
Monitors: a monitor permits to expose what pattern we need to monitor: at the end of simulation, all the states of this pattern are written in a log file. The syntax to design a monitor is the following:
monitor < > { } ;
where is a string describing the monitor and is the pattern, contained into a spatial compartment labelled by and the coordinates , to monitor. As shortcut, the absence of < > indicates the average of the monitors in the whole grid, and the absence of { } indicates to write a monitor for each label defined in the model. The module writes a monitor for each coordinate in ; in case of the absence of {}, the module writes a monitor for each combination of coordinates in and spatial labels defined in the model.
The construction of a model follows the order used to describe the translator syntax: first the model name and the grid dimensions, then the rules of the model. After the rules, we define the grid cell, and finally the monitors.