Keywords

1 Introduction

Systems biology is established as a methodology that assists investigations for obtaining knowledge on dynamics and functioning of biological systems at various levels. Recent developments in computational methods now offer new avenues of investigation that provide contributions to long standing discussions also in ecology. Individual based models (IBMs) [3, 9, 10] have been instrumental in addressing different issues on ecosystems such as the relationship between patterns and processes [23]. Similar considerations that are centered around complex adaptive systems view of ecosystems have also been proven useful in addressing dynamical properties of ecosystems [19].

Until relatively recently, ecosystem modeling has been dominated by continuous deterministic representations that provide estimations of populations’ dynamics with respect to the species interactions. However, the greater availability of powerful computers made a departure from more traditional considerations feasible with the availability of new capabilities.

A point of interest in IBMs is on capturing certain sources of noise, which can be important in small populations [24]. This is because the same amount of living biomass can have a noisy behavior if it corresponds to an individual of an ecosystem rather than millions of individuals of the same system, for example, as in the relationship between whales and planktons. Stochasticity, which is exploited in some IBMs, is an instrumental feature for studying the inherent noise in ecosystems, both at individual level and at the population level. In contrast to deterministic population-level models, stochastic models make it possible to simulate actual extinction events. In this respect, generalistic discussions of ecosystem models are limited in both handling the noisy behavior of small populations and modeling extinction. However, the extinction of rare species is at the frontier of applied ecological research and conservation biology.

Another challenge that is confronting ecosystem models is the representation of different types of concurrent interspecific interactions [21]. In ecology literature the focus is on single interaction types, with an emphasis on food webs, and an increasing focus on plant-pollinator networks in isolation. However, in ecosystems, different kinds of interactions always happen in parallel. The capability to model them simultaneously is important for a better understanding of ecosystems.

In this paper, we present an algorithmic systems biology approach [26] for compositional stochastic modeling of ecosystems with different kinds of interactions between species and movement of species between patches, that is, spatial regions [14]. For our ecosystem models, we use the CoSBiLab LIME (Language Interface for Modeling Ecology) [14], which is designed for modeling ecosystems with multiple interaction types and patches. The LIME language allows the user to give a biologically intuitive model description in a narrative style. This makes it possible to specify in the same model multiple parallel ecological interactions.

The LIME language is designed to perform static analysis on the model structures prior to the translation of the model description into a program suitable for stochastic dynamical simulation. These features make it possible to design, simulate and analyze ecosystem models with varying patterns of interactions and structures without dealing with the technicalities of specialized programming languages. In LIME, composability of the used language constructs play a key role in expressing the different kinds of interactions in a unified manner in a single model [15].

Besides mathematical approaches based on continuous differential equations, and experimental approaches of biology, which are however difficult in ecology, our algorithmic systems biology approach provides a discretized point of view of the models. This in return makes it easier to adapt computational analysis techniques for querying to the models and simulations with them. As an illustrative example for this, we discuss how an approach for discrete stochastic flux analysis can be used to obtain various graph representations of the models that display the resource flows in the modeled systems, and the causal reading of these flows.

As an example case study of an ecosytem with multiplicity of ecological interactions acting in parallel, we present models of a plant-pollinator system with varying interaction patterns and patch structures. Because ecological systems and processes are inherently variable, composability of the LIME language and the constructs of the underlying framework help to manage the emerging complexity. This way, we discuss and illustrate how these features can be used for the construction of complicated ecosystem models together with their simulation and analysis while keeping track of stochasticity and quantifying its consequences.

2 Algorithmic Modeling with LIME

We use a programming language that is based on process algebras. Process algebras are formal languages, which were originally introduced as a means to study the properties of complex reactive systems by providing rigorous discrete syntactic representations of these systems. In process algebra, concurrency, that is, the view of systems in which interacting computational processes are executing in parallel, is a central aspect. Stochastic extensions of these languages are now broadly used tools for describing the dynamics of biological systems [27], as they faithfully capture mass action kinetics with a continuous time Markov chain semantics. While continuous and discrete representations approximate each other, discrete representations are more realistic for the case of biological systems, because populations are described by discrete variables and both continuous and discrete representations are continuous in time. Moreover, discrete representations provide the expressive power to model otherwise challenging structures [2, 17].

Fig. 1.
figure 1

The graphical representation of a pollinator network on two patches, given with the LIME model in Fig. 2. The species A and B are pollinators for the plant E, whereas B and C are pollinators for the plant F. There is direct competition between the species A and B. The pollinator species can move between the two patches A and B.

Fig. 2.
figure 2

LIME description of the model depicted in Fig. 1. The rates values are not specified, they are thus set to the default value \(1.0\) for this case.

The algebraic operators and the language constructs of the specialized stochastic process algebra languages allow them to capture the structural and functional aspects of the systems that they model. The biological system models written in these languages vary within a spectrum that spans from molecular biology to ecology with respect to their levels of abstraction. However, the mathematical syntax of these languages makes them difficult to make modifications on the models. When the modifications on the models involve functional phenomena such as patterns of interactions, for example, as in ecosystem models, the syntax of these languages becomes even more challenging. This creates obstacles for these languages to be used effectively in experiments that involve variations of the same model. As a result of this, specialized high level languages that provide user friendly interfaces to these languages are developed and used for modeling biological systems at these different levels of biological systems for expressing various phenomena [11, 13, 14].

We describe our model in the language of LIME (Language Interface for Modeling Ecology) [14, 15]. After performing static analysis on the model structure, the LIME translation software tool translates the model description into the stochastic process algebra languages BlenX [6] and SPiM for simulation. In Appendix A, we give a short introduction to BlenX. For an indepth exposure to BlenX we refer to [5, 6], and for SPiM to [1, 13, 17, 22]. A graphical representation of a model is depicted in Fig. 1, and its complete LIME description is given in Fig. 2. There, the rates are not specified, they are thus set to the default value of 1.0 for this case.

A LIME input file can consist of five parts that describe different aspects of the model. Some of these parts are optional, therefore they can be excluded in models. However, the model in Fig. 2 includes all these parts. The first part, initiated with the keyword duration, is a single statement on the simulation duration. In this model, the simulations are specified to run until time point 1.0.

The second part, initiated with the keyword interactions, consists of the sentences that describe the interactions of the individuals of the modeled ecosystem. Each sentence describes an interaction in the ecosystem together with the ecological patch where it happens and its rate. The interactions can be of four different kinds: predator-prey, plant-pollinator, direct competition, and facilitation. The model in Fig. 2 contains only plant-pollinator and direct competition interactions. There are three pollinator species, that is, beeA, beeB, beeC, and two flower species flowerE and flowerF. The species beeA is a pollinator for the flowerE, and beeC is a pollinator for the flowerE, whereas beeB is a pollinator for both flowerE and flowerF. beeA and beeB have a direct competition interaction between each other.

The optional third part of the input file, initiated with the keywords birth and death dynamics, collects the information on the birth and death rates of the species. Each sentence in this part describes the birth rate or the death rate of a species in each habitat patch. Without habitat patch specification, a rate is distributed and applies to all patches: this way, general rates can be defined. In the model in Fig. 2, death rates for all the species beeA, beeB, beeC, flowerE and flowerF are defined as the default rate value \(1.0\).

The optional fourth part of the input file, initiated with the keywords patch dynamics, contains the information on the rates of the movements between patches of the ecosystem: each sentence here describes the migration rate between two particular patches of a given species. In the model in Fig. 2, the bee species can move between connected patches as depicted in Fig. 1. patchA and patchB are connected such that beeA, beeB and beeC can move between them.

The fifth part, initiated with the keywords initial population, provides the information on the initial population sizes at the beginning of a simulation. In the model in Fig. 2, there are 1000 flowers and 32 bees of each species in each patch at the initial state.

Fig. 3.
figure 3

A model obtained from the one depicted in Fig. 1, however on a single patch, without competition interactions, and with explicit rate values.

LIME translation algorithm maps the sentences of the model into program code that implements the corresponding reactions. For example, each sentence of the form

$$ \mathtt{{Pollinator}}\, \mathrm{ pollinates }\, \mathtt{{Plant}}\, \mathrm{ with\, rates }\, \textit{rate1}\, \mathrm{ and }\,\textit{rate2} $$

is mapped to two reactions

$$ \begin{array}{l} \mathtt{{Pollinator}} + \mathtt{{Plant}} \rightarrow _{{rate1}} \mathtt{{Pollinator}} + \mathtt{{Plant}} + \mathtt{{Plant}}\\ \mathtt{{Pollinator}} + \mathtt{{Plant}} \rightarrow _{{rate2}} \mathtt{{Pollinator}} +\mathtt{{Pollinator}} + \mathtt{{Plant}} + \mathtt{{Plant}} . \end{array} $$

Each sentence of the form

$$ \mathtt{{SpeciesA}}\, \mathrm{ and }\,\mathtt{{SpeciesB}}\, \mathrm{ compete\, with\, rate }\, \textit{rate1} $$

is mapped to a reaction

$$ \begin{array}{l} \mathtt{{SpeciesA}} + \mathtt{{SpeciesB}} \rightarrow _{\textit{rate1}} \cdot \end{array} $$

In the model, when movement of species between spatial regions, given with patches, are defined or interactions are defined specific to certain patches, the LIME translation algorithm distributes these patches to the reactions with respect to the model.

Due to these features, LIME models can be written, extended and modified with a great ease with almost no prior knowledge of this language. As we illustrate below, this capability makes it very easy to experiment with variations of models.

3 In Silico Experiments

Fig. 4.
figure 4

The plots on the left are from a simulation with the model in Fig. 3. The plots on the right are from a simulation with a version of the model, which is scaled by 100. The upper plots display the behavior of the flower species, whereas the lower plots display the behavior of the bee species.

As a first step for an analysis of the model, we work with a single-patch model, given in Fig. 3, as in PatchA of the model depicted in Fig. 1, however we exclude the direct competition between beeA and beeB. That is, there are only plant-pollinator interactions, where beeA is a pollinator for flowerE, beeC is a pollinator for flowerF, and beeB is a pollinator for both flowerE and flowerF.

We instantiate the rates of the model such that the simulations display a close to stable behavior. For this, we obtain the rates by fitting the ODE representation of the model to steady state, where the death rates and initial quantities are fixed as in Fig. 3. For the fitting, we used the least-squares method provided by the PET tool [28]. We assume that the time unit of the simulations is one year. This provides realistic death rates for the bee populations in accordance with their average lifespans within a season, and allows us to observe the population behavior in response to interactions within that season. With stochastic simulations, we obtain a close to stable level for the time interval from 0 to 1, however as the simulation continues, the levels of the species depart from the steady state values due to the fluctuations in the system. These simulations result either in an exponential growth of the numbers of some or all of the species or in extinctions, depending on the initial bias given by the fluctuations.

As we scale the model by multiplying the initial numbers by a scaling factor, we observe extended stability with respect to simulation time as depicted in Fig. 4, however with an increased tendency towards extinctions as the simulation continues. This contrasts with the exponential increases often observed with lower species numbers in the non-scaled model. Because our focus of interest is the behavior within a season, the model does not factor for the seasonal changes between two years. The model thus gives an estimate of the tendencies within one time unit after the start of the simulation that are delivered by the interaction patterns and also patch structures as we analyze below.

Fig. 5.
figure 5

The plots on the left are from a simulation with the model in Fig. 3. The plots on the right are from a simulation with a model that extends the model in Fig. 3 with competition between beeA and beeB. The upper plots display the behavior of the flower species, whereas the lower plots display the behavior of the bee species. The simulations are with the versions of the models, which are scaled by 10.

Fig. 6.
figure 6

Simulation plots with the model that extends the model in Fig. 3 to two patches, named A and B. The plots on the left are without competition, whereas the ones on the right include the competition between beeA and beeB. The upper plots display the behavior of the flower species and the lower plots display the bee species. The simulations are with the versions of the models, which are scaled by 10.

In order to analyze the effect of direct competition to the system behavior, we introduce a direct competition interaction between the species beeA and beeB by adding the following sentence to the interactions of the model: “beeA and beeB compete with rate 0.1”. The direct competition interactions can be seen as a mechanism that stresses beeA and beeB concomitantly when they are present at the same patch. With the introduction of this interaction, as depicted in Fig. 5, we observe that in the simulations the numbers of the species beeA and beeB reduce until at least one of them goes extinct. As a result of this the numbers of the species flowerE and flowerF reduce as their pollination by beeA and beeB becomes hampered. When we increase the rate of the direct competition interaction from \(0.1\) up to ten orders of magnitude, we observe that this increases the extinction of the competing species within the considered time interval, however it does not accelerate the extinction drastically in comparison to original rate. Decreasing the competition rate more than two orders of magnitude brings the behavior of the system close to the levels that are observed without competition.

In order to observe the effect of the availability of patches, between which the bee species can move, we extend the model to two patches. The simulations with the different versions of this model are depicted in Fig. 6. In the first version of this extension, we consider a model without competition. This model is obtained by extending the model in Fig. 3 with the sentences in Fig. 7. The simulation plot, depicted on the left-hand-side of Fig. 6, is with this model. As a second step for a consideration of patch dynamics, we extend this model with direct competition. The plot on the right-hand-side of Fig. 6 is with the model, which extends patch dynamics with direct competition between beeA and beeB as above. Both models behave similar to their single patch versions as can be seen by comparing these plots with those in Fig. 5. However, for the case of the model without competition, the movement between patches provides a minor stabilizing effect to the pollination in comparison to the single patch version.

In order to model the different conditions on different patches, we restrict the competition between beeA and beeB to patch A. We then performed experiments, where we restricted the movement of species. These variations of the model are as follows: (1) only beeA and beeB can move between patch A and patch B, and beeC is stationary on both patches; (2) only beeA moves between patch A and patch B; (3) only beeB moves between patch A and patch B. Example simulation plots with these variations of the models are depicted in Fig. 8, where the plot on the left is for the case where all the bee species can move between two patches, whereas the plot on the right is for the case where only beeA and beeB can move between patches.

In all these variations of the model, the restriction of competition to a single patch provides a safe environment for the pollination in the patch without competition, which is patch B. Apart from this, the two models with the simulations in Fig. 8, have similar behaviors since the movement of beeC between two patches does not strongly hamper the competition between beeA and beeB,  however their movement has a minor influence that reduces the effect of the competition.The cases where either only beeA or only beeB can move between two patches display similar behaviors to the simulation depicted on the left-hand-side of Fig. 8.

Fig. 7.
figure 7

The sentences that extend the model in Fig. 3 with patch dynamics

Fig. 8.
figure 8

Simulation plots with the model that extends the model in Fig. 3 to two patches, named A and B. In these models, there is competition between beeA and beeB, however only in patch A. The simulation plots on the left are with a model where all the bee species can move between both patches, whereas the plots on the right are with a model where the movement between patches is restricted to only beeA and beeB, and beeC are stationary on both patches. The upper plots display the behavior of the flower species, whereas the lower plots display the behavior of the bee species. The simulations are with the versions of the models which are scaled by 10.

Fig. 9.
figure 9

The reactions that occur during a simulation and their numbers of occurrences.

4 Flux Analysis

The reactions that are given by a LIME model are interpreted by the stochastic simulation algorithm as a continuous time Markov chain (CTMC). A simulation with a model can thus be seen as reduction of this complex structure, that is, the model, into a simpler structure, that is, the simulation trajectory, which is a path in the CTMC. However, during this process, some of the information on the simulation can be lost. In particular, the causality between the reactions with respect to the flow of resources during simulation remains hidden in the total order of the reaction instances of the simulation trajectory, which is emphasized by the unique time stamps of these reaction instances.

In [16], Kahramanoğulları and Lynch have introduced a method for flux analysis on stochastic simulations with reaction networks, where flux is the flow of resources between reactions of the network. The approach of [16] is based on inspecting the reaction instances from the point of view of their dependencies on one another during simulation, and relaxing their total order into a partial order structure. The method then uses this partial order as a representation of causal dependencies in the simulation, and processes it further to observe the flux in the network with respect to the flow of the resources from a reaction to another in arbitrary time intervals. The notion of flux obtained this way does not only approximate the notion of flux given by continuous deterministic representations, but also reveals other information that are not given by differential equation analysis.

We perform flux analysis for the simulation time interval from 0 to 1. Figure 9 gives a list of the reactions together with their ids and their number of occurrences during a simulation. The flux graphs of this simulation within the considered time interval are depicted in Figs. 10, 11, 12.

Fig. 10.
figure 10

Flux analysis graph for the simulation time interval from 0 to 1, indicating the quantity of the resources distributed from the initial state to the reactions of the network. Here, \(0\) denotes the initial state, and Fig. 9 gives a list of the reactions together with their ids.

Figure 10 shows how resources present at the beginning of the simulation are distributed to the reactions of the network. Here, \(0\) denotes the initial state, and the directed edges of the graph display how resources at the initial state are consumed by the reactions listed in Fig. 9. As shown by this graph, 11 of beeA, 1 of beeB, 12 of beeC, 373 of flowerE and 377 of flowerF die without participating in any pollination interaction. An implication of this observation is that substantial fractions of the beeA and beeC populations die without participating in any pollination interaction, which removes one third of these species. However, almost all of the beeB participate in the reactions. A possible interpretation of these facts is that beeB is the most important bee species for maintaining the system. In order to check this hypothesis, we modified the pollination rates of beeA, beeB, and beeC in three different versions of the model. The simulations showed that lowering the rates of beeA and beeC by a third of the original rates does not affect the stability as much as doing the same to beeB as this causes a rapid decline in the levels of all the species. This observation agrees with the evidence provided by the flux analysis indicating that beeB plays a more important role in maintaining the system.

Fig. 11.
figure 11

Flux analysis graphs for the simulation time interval from 0 to 1, indicating the quantity of species flowing from other reactions of the network, excluding the initial state, to those for the death of the species. These are, respectively, for beeA, beeC, beeB, flowerE and flowerF. Figure 9 gives a list of the reactions and their ids.

Fig. 12.
figure 12

Flux analysis graphs of different species for the simulation time interval from 0 to 1. The graphs indicate the quantity of species flowing between the pollination reactions of the network. These exclude the initial state and the reactions for the death of the species. Figure 9 gives a list of the reactions and their ids.

Figure 11 shows for different species the resources flowing from other reactions to death reactions. We observe that \(59\) of beeA participate in a pollination before they die, however \(38\) of these pollination interactions result in a reproduction of beeA. Similarly, \(55\) of beeC participate in a pollination before they die, and \(40\) of these pollination interactions result in a reproduction of beeC. On the other hand, while \(57\) of beeB participate in a pollination before they die, only \(40\) of these pollination interactions result in a reproduction of beeC. From these observations, it follows that although comparable numbers of beeA, beeB and beeC die after participating in a pollination interaction, beeB reproduces less frequently as a result of these pollinations in comparison to beeA and beeC, which can explain the critical role played by beeB in maintaining the system.

Other observations in Fig. 11 that are made on flowerE due to the reaction for its death indicate that most of the pollinations of flowerE takes place as result of pollinations by beeB, that is, \(208\) pollinations. This contrasts with the \(25\) pollinations of flowerE by beeB that result in the reproduction of beeB, and the other \(63\) pollinations by beeA. Similarly, for the case of flowerF, \(216\) of the death reactions occur after having participated in a pollination by beeB, which does not result in a pollination. This contrasts with the total of 49 reactions that occur after a pollination by beeC.

Figure 12 shows for different species the resources flowing between the reactions of the network that model the pollination of the flower species. An observation on these graphs indicates that beeB flows between various pollination reactions an order of magnitude more than both beeA and beeC. In particular, the cycling of beeB between reactions 6 and 7 of Fig. 9 contrasts with those for reactions 2 and 3 for beeA and for reactions 9 and 10 for beeC. This observation carries over to the behaviors of flowerE and flowerF with respect to their incoming resources at reactions 6 and 7 in contrast to other reactions. This points out that stability of the system is mainly due to pollination of flowerE and flowerF by beeB, however only a fraction of these pollinations reflect to the reproduction of beeB.

5 Discussion

The development of methods that can contribute to an understanding of the relationships between individual level interactions and actions of ecosystems’ species and resulting behaviors at the ecosystem level is an area of research with implications on conservation ecology. In particular, when agricultural ecosystem domains are considered, methods that can help to predict the impacts of human interference can help to assist policy making where conservation ecology has also economic consequences. In this paper, with the aim of contributing to this discussion, we outline an integrated approach from a computational systems biology point of view.

We propose an integrated approach as this allows us to bridge methods from various fields and use them under a unifying setting to address different aspects of the models where they have specialized strengths. In this respect, the LIME language, that stems from a language-design perspective, makes it possible to easily construct the models and manage them [14]. On the other hand, the techniques that we borrow from continuous deterministic ODE analysis for parameter estimation provide the means to calibrate our model in order to factor for the context, that is not included in the model structure, of the modeled ecosystem [28]. Our flux analysis brings together ideas from concurrency theory that allows us to exploit the discrete structures of the stochastic simulations to analyze them as graphs that explain the flow of species. This is done by treating the species as resources that flow between ecosystem events [12, 16].

Besides the other methods, which are standard in systems biology, our stochastic flux analysis is prone to potential uses in ecology. With respect to the case analysis of the present paper, an example is the identification of the species that are critical to the robustness of the system. As our flux analysis showed, beeB, which pollinated both flower species, is more important in this regard than the other two species, which each pollinated only one species. This agrees with the observations of [20] stating that removal of generalist pollinators had the greatest effect on plant survival. Another potential application is on the movement of individuals between patches, which can be important to ecosystems [18]. Stochastic flux analysis can help to determine which movements have major consequences for the populations, as this makes it possible to monitor the movements at arbitrary time intervals as in our case study.

In the present paper, we have illustrated our approach on an hypothetical ecosystem model. Future work includes applying the methods here to study actual plant-pollinator systems by relying on field data, and also including other kinds of interactions between ecosystem species. In this respect questions of interest include the conditions that lead to stability or extinction, and identification of the keystone species. In our case study, also in order to factor for the non-modeled ecosystem context, we used a parameter estimation method in order to determine the rates of interactions. An alternative or complementary approach can be based on exploiting field data to assist the estimation of these rates. However, typically field data shows the rates at which the various pollinator species visit the plant species [7]. This poses other questions, as the available data does not reflect the quantitative effect of the visitations on their reproductive rates. Directions of future investigation include an investigation on stochastic simulations to be used to infer the reproductive rates from the field data.