Lotka-Volterra pairwise modeling fails to capture diverse pairwise microbial interactions

Pairwise models are commonly used to describe many-species communities. In these models, an individual receives additive fitness effects from pairwise interactions with each species in the community ('additivity assumption'). All pairwise interactions are typically represented by a single equation where parameters reflect signs and strengths of fitness effects ('universality assumption'). Here, we show that a single equation fails to qualitatively capture diverse pairwise microbial interactions. We build mechanistic reference models for two microbial species engaging in commonly-found chemical-mediated interactions, and attempt to derive pairwise models. Different equations are appropriate depending on whether a mediator is consumable or reusable, whether an interaction is mediated by one or more mediators, and sometimes even on quantitative details of the community (e.g. relative fitness of the two species, initial conditions). Our results, combined with potential violation of the additivity assumption in many-species communities, suggest that pairwise modeling will often fail to predict microbial dynamics. DOI: http://dx.doi.org/10.7554/eLife.25051.001


Introduction
Multispecies microbial communities are ubiquitous. Microbial communities are important for industrial applications such as cheese and wine fermentation (van Hijum et al., 2013) and municipal waste treatment (Seghezzo et al., 1998). Microbial communities are also important for human health: they can modulate immune responses and food digestion (Round and Mazmanian, 2009;Kau et al., 2011) during health and disease. Properties of the entire community ('community properties', e.g. species dynamics, ability to survive internal or external perturbations, and biochemical activities of the entire community) are influenced by interactions wherein individuals alter the physiology of other individuals (Widder et al., 2016). To understand and predict community properties, choosing the appropriate mathematical model to describe species interactions is critical.
A mathematical model ideally focuses only on details that are essential to community properties of interest. However, it is often unclear a priori what the minimal essential details are. We define 'mechanistic models' as models that explicitly consider interaction mediators as state variables. For example, if species S 1 releases a compound C 1 which stimulates species S 2 growth upon consumption by S 2 , then a mechanistic model tracks concentrations of S 1 , C 1 , and S 2 ( Figure 1A and B, left panels). Note that mechanistic models used here still omit molecular details such as how chemical mediators are received and processed by recipients and how mediators subsequently act on recipients. In contrast, Lotka-Volterra ('L-V') pairwise models only consider the fitness effects of interactions. Specifically, L-V models assume that the fitness of an individual is the sum of its basal fitness (the net growth rate of an individual in isolation) and fitness influences from pairwise interactions with individuals of the same species and of every other species in the community ('additivity' assumption). Furthermore, regardless of interaction mechanisms or quantitative details of a community, all fitness influences are typically expressed using a single equation form wherein parameters can vary to reflect the signs and magnitudes of fitness influences ('universality' assumption). Thus in the example above, a pairwise model only describes how S 1 increases the fitness of S 2 ( Figure 1A and B, right panels).
L-V pairwise models are popular. L-V pairwise modeling has successfully explained the oscillatory dynamics of hare and its predator lynx (Figure 1-figure supplement 1) (Volterra, 1926;Wangersky, 1978;BiologyEOC, 2016). Pairwise models have also been instrumental in delineating conditions for multiple carnivores to coexist when competing for herbivores (MacArthur, 1970;Chesson, 1990). In both cases, mechanistic models and pairwise models happen to be mathematically equivalent for the following reasons. In the hare-lynx example, both species are also interaction mediators, and therefore pairwise and mechanistic models are identical. In the second example, if herbivores (mediators of competitive interactions between carnivores) rapidly reach steady state, herbivores can be mathematically eliminated from the mechanistic model to yield a pairwise model of competing carnivores (MacArthur, 1970;Chesson, 1990). Pairwise models are often used to predict how perturbations to steady-state species composition exacerbate or decline over time (May, 1972;Thébault and Fontaine, 2010;Mougi and Kondoh, 2012;Allesina and Tang, 2012;Suweis et al., 2013;Coyte et al., 2015). Although most work are motivated by contact-dependent prey-predation (e.g. hare-lynx) or mutualisms (e.g. plant-pollinator) where L-V models could be identical to mechanistic models, these work do not explicitly exclude chemical-mediated interactions where species are distinct from interaction mediators.
The temptation of using pairwise models is indeed high, including in microbial communities where many interactions are mediated by chemicals (Mounier et al., 2008;Faust and Raes, 2012;Stein et al., 2013;Marino et al., 2014;Coyte et al., 2015). Even though pairwise models do not capture the dynamics of chemical mediators, predicting species dynamics is still highly desirable in, for example, forecasting species diversity and compositional stability. For chemical-mediated interactions, L-V pairwise models are far easier to construct than mechanistic models for the following reasons. Mechanistic models would require knowledge of chemical mediators, which are often eLife digest From the soil to our body, microbes, such as bacteria, are everywhere and affect us in many ways. Many microbes perform important roles in natural environments and for our health, but some of them can cause harm and lead to diseases. Often, microbes affect and interact with each other within large groups or communities. Because of their widespread ramifications, it is important to understand how microbial communities work.
In addition to experiments, mathematical modeling offers one way to gain insight into the dynamics of microbial communities. A model commonly used to describe the interactions between organisms is the so-called 'pairwise model'. Pairwise models can be useful to predict the dynamics of a community in which two species physically interact, such as a predator-prey community. However, it was unknown if this model was suitable to adequately predict the dynamics of microbial species in communities. Microbes often interact via chemicals that diffuse in the environment. For example, one microbe might provide food for another microbe or release toxins to kill it. However, a pairwise model does not consider food or toxins, but only how one microbe stimulates or inhibits the growth of another.
Momeni et al. simulated different scenarios commonly found in microbial communities to test whether a pairwise model could capture how, for example, chemicals released by one bacterial species would either help others to grow or stop them from growing. The results showed that for many scenarios, pairwise models cannot qualitatively represent the dynamics of a microbial community.
A next step will be to work on the limitations of current experimental technologies and mathematical models to improve the understanding of microbial communities. This knowledge could be used to develop new strategies for ecosystem engineering, such as for example making soils more fertile to improve crop yields, or tackling antibiotic resistance of bacteria. The mechanistic model (left) considers a bipartite network of species and chemical interaction mediators. A species can produce or consume chemicals (open arrowheads pointing towards and away from the chemical, respectively). A chemical mediator can positively or negatively influence the fitness of its target species (filled arrowhead and bar, respectively). The corresponding L-V pairwise model (right) includes only the fitness effects of species interactions, which can be positive (filled arrowhead), negative (bar), or zero (line terminus). (B) In the example here, species S 1 releases chemical C 1 , and C 1 is consumed by species S 2 and promotes S 2 's fitness. In the mechanistic model, the three equations respectively state that (1) S 1 grows exponentially at a rate r 10 , (2) C 1 is released by S 1 at a rate b C1S1 and consumed by S 2 with saturable kinetics (maximal consumption rate a C1S2 and half-saturation constant K C1S2 ), and (3) S 2 's growth (basal fitness r 20 ) is influenced by C 1 in a saturable fashion. In the pairwise model here, the first equation is identical to that of the mechanistic model. The second equation is similar to the last equation of the mechanistic model except that r 21 and K 21 together reflect how the density of S 1 (S 1 ) affects the fitness of S 2 in a saturable fashion. For all parameters with double subscripts, the first subscript denotes the focal species or chemical, and the second subscript denotes the influencer. Note that unlike in mechanistic models, we have omitted 'S' from subscripts in pairwise models (e.g. r 21 instead of r S2S1 ) for simplicity. In this example, both r 21 and r S2S1 are positive. DOI: 10.7554/eLife.25051.003 The following figure supplements are available for figure 1: challenging to identify. Since chemical mediators are explicitly modeled, mechanistic models require more equations and parameters than their cognate pairwise models (Figure 1, Table). Pairwise model parameters are relatively easy to estimate using community dynamics or dynamics of monocultures and pairwise cocultures (Mounier et al., 2008;Stein et al., 2013;Guo and Boedicker, 2016). Consequently, pairwise modeling has been liberally applied to microbial communities.
L-V pairwise models have been criticized when applied to communities of more than two species (referred to as 'multispecies communities') (Levine, 1976;Tilman, 1987;Wootton, 1993Wootton, , 2002Werner and Peacor, 2003;Stanton, 2003;Schmitz et al., 2004). This is because a third species can influence interactions between a species pair ('indirect interactions'), which sometimes violates the additivity assumption of pairwise models. For example, a carnivore can indirectly increase the density of a plant by decreasing the density of an herbivore ('interaction chain'; 'density-mediated indirect interactions'). A carnivore can also decrease how often an herbivore forages plants ('interaction modification', 'trait-mediated indirect interactions', or 'higher order interactions') (Vandermeer, 1969;Wootton, 1994;Billick and Case, 1994;Wootton, 2002). In interaction modification, foraging per herbivore decreases, whereas in interaction chain, the density of herbivores decreases. Interaction modification (but not interaction chain) violates the additivity assumption (Methods-Interaction modification but not interaction chain violates the additivity assumption) (Tilman, 1987;Wootton, 1994;Schmitz et al., 2004) and can cause the pairwise model to generate qualitatively wrong predictions. Indeed, pairwise models largely failed to predict biomass and species coexistence in three-species and seven-species plant communities (Dormann and Roxburgh, 2005), although reported failures of pairwise models could be due to limitations in data collection and analysis (Case and Bender, 1981;Billick and Case, 1994).
Here, we examine the universality assumption of pairwise models when applied to microbial communities (or any community that employs diverse chemical-mediated interactions). Microbes often influence other microbes in a myriad of fashions, via consumable metabolites, reusable signaling molecules, or a combination of chemicals ( Figure 2). Can a single equation form, traditionally employed in pairwise models, qualitatively describe diverse interactions between two microbial species? The answer is unclear. On the one hand, pairwise models have been applied successfully to diverse microbial communities. For example, an L-V pairwise model and a mechanistic model both correctly predicted ratio stabilization and spatial intermixing between two strongly-cooperating populations exchanging diffusible essential metabolites (Momeni et al., 2013). In other examples, pairwise models largely captured competition outcomes and metabolic activities of three-species and four-species artificial microbial communities (Vandermeer, 1969;Guo and Boedicker, 2016;Friedman et al., 2017). On the other hand, pairwise models often failed to predict species coexistence in seven-species microbial communities (Friedman et al., 2017), although this could be due to interaction modification discussed above.
Instead of investigating natural communities where interaction mechanisms can be difficult to identify, we use in silico communities. In these communities, two species interact via mechanisms commonly encountered in microbial communities, including growth-promoting and growth-inhibiting interactions mediated by reusable and consumable compounds ( Figure 2) (Stams, 1994;Czárán et al., 2002;Duan et al., 2009). We construct mechanistic models for these two-species communities and attempt to derive from them pairwise models. A mechanistic reference model offers several advantages: community dynamics is deterministically known; deriving a pairwise model is not limited by inaccuracy of experimental methods; and the flexibility in creating different reference models allows us to explore a variety of interaction mechanisms. We demonstrate that a single pairwise equation form often fails for commonly-encountered diverse pairwise microbial interactions. We conclude by discussing when pairwise models might or might not be useful, in light of our findings.

Results
Throughout this work, we consider communities grown in a well-mixed environment where all individuals interact with each other with an equal chance. A well-mixed environment can be found in industrial fermenters. Moreover, at a sufficiently small spatial scale, a spatially-structured environment can be approximated as a well-mixed environment, as chemicals are uniformly-distributed locally. Motile organisms also reduce the degree of spatial structure. A well-mixed environment allows us to use ordinary differential equations (ODEs), which are more tractable than partial differential equations demanded by a spatially-structured environment. This in turn allows us to sometimes analytically demonstrate failures of pairwise models.

Mechanistic model versus pairwise model
A mechanistic model describes how species release or consume chemicals and how chemicals stimulate or inhibit species growth ( Figure 1A left). In contrast, in pairwise models, interation mediators are not explicitly considered ( Figure 1A right). Instead, the growth rate of an individual of species S i is the sum of its basal fitness (r i0 , net growth rate of the individual in the absence of any intra-species or inter-species interactions) and fitness effects from intra-species and inter-species interactions. The fitness effect from species S j to species S i is represented by f ij S j À Á , where S j is the density of species S j . f ij S j À Á is a linear or nonlinear function of only S j and not of another species. When j ¼ i, f ii S i ð Þ represents density-dependent fitness effect within S i (e.g. density-dependent growth inhibition or stimulation). In a multi-species pairwise model, a single form of f ij is used for all pairwise species interactions. For example, the most popular L-V model is linear L-V: Here, r i0 is the basal fitness of an individual of S i , and can be positive, negative, or zero; r ij is the fitness effect per S j individual on S i . Positive, negative, or zero r ij represents growth stimulation, inhibition, or no effect, respectively. An example of linear L-V is the logistic L-V pairwise model traditionally used for competitive communities: Here, nonnegative r i0 is the basal fitness of S i ; positive L ij is the carrying capacity imposed by limiting shared resource (e.g. space or carbon source) such that a single S i individual will have a zero net growth rate when competing with a total of L ij individuals of S j .
Alternative forms of fitness effect f ij (Wangersky, 1978) include L-V with delayed influence, where the fitness influence of one species on another may lag in time (Gopalsamy, 1992), or saturable L-V (Thébault and Fontaine, 2010) where Here, r i0 is the basal fitness of an individual of S i , r ij is the maximal fitness effect species S j can exert on S i , and K ij (>0) is the S j at which half maximal fitness effect on S i is achieved. r i0 and r ij can be positive, negative, or zero. Note that at a low concentration of influencer, the saturable form can be converted to a linear form.
Our goal is to test whether a single equation form of pairwise model can qualitatively predict dynamics of species pairs engaging in various types of interactions commonly found in microbial communities (e.g. Figure 2). To do so, we use a combination of analytical and numerical approaches ( Figure 1-figure supplement 2). Analytically deriving a pairwise model from a mechanistic model not only reveals assumptions required to generate the pairwise model, but also alleviates any concern that we may have failed to identify the optimal pairwise model parameters. When interactions become more complex (e.g. involving multiple mediators), we take the numerical approach, which is typically used to infer pairwise models from experimental results (Pascual and Kareiva, 1996). In the numerical approach, we mimic experimentalists by first deciding on a pairwise model to be used, and then employing a nonlinear least squares routine to numerically identify model parameters that minimize the average difference D between pairwise and mechanistic model dynamics within a training time window T (Figure 1-figure supplement 2; Methods-Summary of simulation files). To evaluate how well a pairwise model predicts long-term mechanistic model dynamics, we 'buy time' by introducing 'dilutions' in numerical simulations of both models and quantify their difference D.

Reusable versus consumable mediators require different pairwise models
In this section, we analytically derive pairwise models from mechanistic models of two-species communities where one species affects the other species through a single mediator. The mediator is either reusable such as signaling molecules in quorum sensing (Duan et al., 2009;Jakubovics, 2010) or consumable such as metabolites (Stams, 1994;Freilich et al., 2011) (Figure 2). We show that a single pairwise model may not encompass these different interaction mechanisms and that for consumable mediator, the choice of pairwise model also depends on details such as the relative fitness and initial densities of the two species. Consider a commensal community where species S 1 stimulates the growth of species S 2 by producing a reusable ( Figure 3A) or a consumable ( Figure 3B) chemical C 1 . We consider community dynamics where species are not limited by any abiotic resources, such as within a dilution cycle of a turbidostat experiment where all other metabolites are in excess.
When C 1 is reusable, the mechanistic model ( Figure 3A,i) can be transformed into a saturable L-V pairwise model (compare Figure 3A,ii with Equation 3), especially after the concentration of the mediator (which is initially zero) has acclimated to be proportional to the producer population size ( Figure 3A legend; Figure 3-figure supplement 1). This saturable L-V pairwise model is valid regardless of whether the producer coexists with the consumer, outcompetes the consumer, or is outcompeted by the consumer.
If C 1 is consumable, different scenarios are possible ( Figure 3B; Methods). Case I: When supplier S 1 always grows faster than consumer S 2 (the basal fitness of S 1 is higher than the maximal fitness of S 2 ), C 1 will eventually accumulate proportionally to S 1 ( Figure 4A left; Figure 3. Interactions mediated via a single mediator are best represented by different forms of pairwise models, depending on whether the mediator is consumable or reusable and on the relative fitness and initial densities of the two species. S 1 stimulates the growth of S 2 via a reusable (A) or a consumable (B) chemical C 1 . In mechanistic models of the two cases (i), equations for S 1 and S 2 are identical but equations for C 1 are different. In (A), C 1 can be solved to yield S 10 , assuming zero initial C 1 . Here, S 10 is S 1 at time zero. We have approximated C 1 by omitting the second term (valid after the initial transient response has passed so that C 1 has become proportional to S 1 ). This approximation allows an exact match between the mechanistic model and the saturable L-V pairwise model (ii). In (B), depending on the relative growth rates of the two species, and if additional requirements are satisfied (Methods; Figure 3  Methods-Deriving a pairwise model for interactions mediated by a single consumable mediator Case I). In this case, C 1 may be approximated as a reusable mediator and can be predicted by the saturable L-V pairwise model ( Figure 4A right, compare dotted and solid lines).
Case II: When S 1 and S 2 can coexist (the basal fitness of S 1 is higher than the basal fitness of S 2 but less than the maximal fitness of S 2 ), a steady state solution for C 1 and species ratio R S ¼ S 2 =S 1 exists ( Figure 4B; Methods-Deriving a pairwise model for interactions mediated by a single consumable mediator Case II,Equation 11). To arrive at a pairwise model, we will need to eliminate C 1 which is mathematically possible (i.e. after community dynamics converges to the 'f -zero-isocline' on the phase plane of mediator C 1 and species ratio R S , as depicted by blue lines in Figure 3-figure supplement 2A-D). However, the derived pairwise model differs from the saturable L-V model: where constants r 20 , r S2C1 , and ! ¼ 1 À K S2C1 =K C1S2 can be positive, negative, or zero, and c Figure 1 table for parameter definitions and see Equation 13 in Methods). We will refer to this equation as 'alternative pairwise model', although the fitness influence term is a function of both S 1 and S 2 instead of the influencer S 1 alone as defined in the traditional L-V pairwise model.
Case III: When supplier S 1 always grows slower than consumer S 2 , i.e. when the basal fitness of S 1 (r 10 ) is less than the basal fitness of S 2 (r 20 ), consumable C 1 declines to zero concentration. This is because C 1 is consumed by S 2 whose relative abundance over S 1 eventually exponentially increases at a rate of r 20 À r 10 . Similar to Case II, under certain conditions (i.e. after community dynamics converges to the f -zero-isocline as seen in For both Case II and Case III, we analytically demonstrate that in the absence of dilutions, alternative pairwise model dynamics can converge to mechanistic model dynamics (see Figure 3-figure supplements 3 and 5 for initial condition requirement and time scale of convergence). However, if initial S 1 and S 2 are such that the time scale of convergence is long compared to the duration of one dilution cycle (e.g. Figure 3-figure supplement 2C and G), then we will have to perform dilutions and the saturable L-V model can sometimes be more appropriate than the alternative model (Figure 3-figure supplement 4). Thus in these cases, whether a saturable L-V or an alternative model is more appropriate also depends on initial conditions. The alternative model (Equation 4) can be further simplified to if additionally, the half-saturation constant K for C 1 consumption (K C1S2 ) is identical to that for C 1 's influence on the growth of consumer (K S2C1 ), and if S 2 has not gone extinct. This equation form has precedence in the literature (e.g. [Mougi and Kondoh, 2012]), where the interaction strength r 21 reflects the fact that the consumable mediator from S 1 is divided among consumer S 2 . Thus, we can regard the alternative model (Equation 4) or its simplified version (Equation 5) as a 'divided influence' model. The saturable L-V model and the alternative model are not interchangeable (Figure 4). When a consumable mediator accumulates without reaching a steady state within each dilution cycle ( Figure 4A left; inset: C 1 eventually becomes proportional to S 1 ), the saturable L-V model is predictive of community dynamics ( Figure 4A right, compare dotted and solid lines). In contrast, . Saturable L-V and alternative pairwise models are not interchangeable. Consider a commensal community with a consumable mediator C 1 . (A) The mediator accumulates without reaching a steady state within each dilution cycle as the consumer S 2 gradually goes extinct ( Figure 3B, Case I). After a few tens of generations, C 1 becomes proportional to its producer density S 1 (inset in left panel). In this case, a saturable L-V (dotted) but not the alternative pairwise model (dashed) is suitable. All parameters are listed in Figure 4-source data 1. (B) The consumable mediator reaches a non-zero steady state within each dilution cycle ( Figure 3B, Case II). From mechanistic dynamics where initial species ratio is 1, we use two training windows to derive saturable L-V (dotted) and alternative (dashed) pairwise models. We then use these pairwise models to predict dynamics of communities starting at two different ratios. The alternative model but not the saturable L-V predicts the mechanistic model dynamics. All parameters are listed in Figure 4-source data 2. Note that in all figures, population fractions (instead of population densities) are plotted, which fluctuate less during dilutions compared to mediator concentration. DOI: 10.7554/eLife.25051.017 The following source data is available for figure 4: Source data 1. List of parameters for simulations in Figure 4 on an interaction through a reusable mediator. DOI: 10.7554/eLife.25051.018 Source data 2. List of parameters for simulations in Figure 4 on an interaction through a consumable mediator. DOI: 10.7554/eLife.25051.019 predictions from the alternative pairwise model are qualitatively wrong ( Figure 4A right, compare dashed and solid lines). When a consumable mediator eventually reaches a non-zero steady state within each dilution cycle ( Figure 4B, black), could a saturable L-V model still work? The saturable L-V model derived from training window i (initial 10 generations) fails to predict species coexistence regardless of initial species ratios ( Figure 4B left magenta box, compare solid with dotted). In comparison, the saturable L-V model derived from training window ii (at steady-state species ratio) performs better, especially if the starting species ratio is identical to that of the training dynamics ( Figure 4B, top panel in right magenta box). However, at a different starting species ratio, the saturable L-V model fails to predict which species dominates the community ( Figure 4B, bottom panel in right magenta box). In contrast, community dynamics can be described by the alternative pairwise model derived from either window i or ii ( Figure 4B, compare dashed and solid lines in left and right magenta boxes).
We have shown here that even when one species affects another species via a single mediator, either a saturable L-V model or an alternative pairwise model may be appropriate. The appropriate model depends on whether the mediator is reusable or consumable, how fitness of the two species compare, and initial species densities ( Figure 3; Figure 3-figure supplements 2-5). Choosing the wrong pairwise model generates qualitatively flawed predictions ( Figure 4). Considering that reusable and consumable mediators are both common in microbial interactions, our results call for revisiting the universality assumption of pairwise modeling.

Two-mediator interactions require pairwise models different from single-mediator interactions
A species often affects another species via multiple mediators (Kato et al., 2008;Yang et al., 2009;Traxler et al., 2013;Kim et al., 2013). For example, a fraction of a population might die and release numerous chemicals, and some of these chemicals can simultaneously affect another individual. Here we examine the case where S 1 releases two reusable chemicals C 1 and C 2 , both affecting the growth of S 2 ( Figure 5A). Since the effect of each mediator can be described by a saturable L-V pairwise model ( Figure 3A), we ask when the two mediators can be mathematically regarded as one mediator and described by a saturable L-V pairwise model ( Figure 5B).
We assume that fitness effects from different chemical mediators on a focal species are additive. Not making this assumption will likely violate the additivity assumption essential to pairwise models. Additive fitness effects have been observed for certain 'homologous' metabolites. For example, in multi-substrate carbon-limited chemostats of E. coli, the fitness effects from glucose and galactose were additive (Lendenmann and Egli, 1998). 'Heterologous' metabolites such as carbon and nitrogen sources likely affect cell fitness in a multiplicative fashion. However, if W C and W N , the fitness influences of released carbon and nitrogen with respect to those already in the environment, are both small (i.e. W C , W N < < 1), the additional relative fitness influence will be additive: ð1 þ W C Þð1 þ W N Þ À 1 » W C þ W N . However, we need to keep in mind that even among homologous metabolites, fitness effects may not be additive (Hermsen et al., 2015). 'Sequential' metabolites (e.g. diauxic shift) provide another example of non-additivity. Similar to the previous section, we assume that all abiotic resources are unlimited.
For the two reusable mediators, depending on their relative 'potency' (defined in Figure 5A legend), their combined effect generally cannot be modeled as a single mediator except under special conditions (Methods-Conditions under which a saturable L-V pairwise model can represent one species influencing another via two reusable mediators). These special conditions include: (1) mediators share similar potency ( Figure 5-figure supplement 1B), or (2) one mediator dominates the interaction ( Figure 5-figure supplement 1C). If these conditions are not satisfied, we can easily find examples where saturable L-V pairwise models derived from a low-density community and from a high-density community have qualitatively different parameters ( Figure 5-figure supplement 1D). Consequently, the future dynamics of a low-density community can be predicted by a saturable L-V model derived from a low-density community but not by a model derived from a high-density community ( Figure 5C). Thus, even though each mediator can be modeled by saturable L-V, their joint effects may or may not be modeled by saturable L-V depending on the relative potencies of the two mediators and sometimes even on initial conditions (high or low initial S 1 ).
Similarly, when both mediators are consumable and do not accumulate (as in Cases II and III of Figure 3B), the fitness effect term becomes !C 2 S1þ C 2 S2 . Except under special conditions (e.g. when ! C1 and ! C2 are zero, or when ! C1 =! C2 ¼ C1 = C2 , or when one mediator dominates the interaction), the two mediators may not be regarded as one. By the same token, when one mediator is a steady-state consumable and the other is reusable, they generally may not be regarded as a single mediator and would require yet a different pairwise model (i.e. with the fitness effect term rS 2 C 1 S1 !C 1 S1þ C 1 S2 þ rS 2 C 2 S1 S1þKS 2 C 2 r10=b C 2 S 1 ).
In summary, when S 1 influences S 2 through multiple mediators, rarely can we approximate them as a single mediator. Sometimes, a pairwise model derived from one community may not apply to communities initiated at different densities ( Figure 5C  . An example of a two-mediator interaction where a saturable L-V pairwise model may succeed or fail depending on initial conditions. (A) One species can affect another species via two reusable mediators, each with a different potency K Ci where K Ci is K S2Ci r 10 =b CiS1 (Methods-Conditions under which a saturable L-V pairwise model can represent one species influencing another via two reusable mediators). A low K Ci indicates a strong potency (e.g. high release of C i by S 1 or low C i required to achieve half-maximal influence on S 2 ). (B) Under what conditions can an interaction via two reusable mediators with saturable effects on recipients be approximated by a saturable L-V pairwise model? (C) A community where the success or failure of a saturable L-V pairwise model depends on initial conditions. Here, K C1 = 10 3 cells/ml and K C2 = 10 5 cells/ml. Community dynamics starting at low S 1 (solid) can be predicted if the saturable L-V pairwise model is derived from reference dynamics starting at low (dotted). However, if we use a saturable L-V pairwise model derived from a community with high initial S 1 , prediction is qualitatively wrong (dash dot line). See L-V competition model can fail if two competing species engage in an additional interaction So far, by assuming that abiotic resources are always present in excess (e.g. in turbidostats), we have not considered species competition for abiotic resources. In this section, we consider a competitive commensal community in a batch environment where S 1 and S 2 compete for an essential shared resource C 1 supplied by the environment at a constant rate (e.g. constant light), and S 1 supplies an essential consumable metabolite C 2 to promote S 2 growth ( Figure 6A, left). We show that an L-V pairwise model works for some but not all communities even though these communities qualitatively share the same interaction mechanism. In our mechanistic model (Methods-Competitive commensal interaction, Equation 47), the fitness of S 2 is multiplicatively affected by C 1 and C 2 (Mankad and Bungay, 1988). We choose parameters such that the effect from C 2 to S 2 is far from saturation (e.g. linear with respect to C 2 and S 1 ) to simplify the problem. In our L-V pairwise model ( Figure 6A, right; Methods-Competitive commensal interaction, Equation 48), intra-and inter-species competition is represented by the traditional logistic L-V model (Equation 2; Gause, 1934;Thébault and Fontaine, 2010;Mougi and Kondoh, 2012). We then introduce a linear term (r 21 S 1 ) to describe the fitness effect of commensal interaction.
We tested various sets of mechanistic model parameters where the two species coexist in a steady fashion ( Figure 6B), or one species goes extinct ( Figure 6C), or species composition fluctuates ( Figure 6D). L-V pairwise models deduced from a fixed period of training time could predict future dynamics in the first two cases, but failed to do so in the third case. Thus, depending on dynamic details of communities, a pairwise model sometimes works and sometimes fails.
To summarize our work, even for pairwise microbial interactions, depending on interaction mechanisms (reusable versus consumable mediator, single mediator versus multiple mediators), we will need to use a plethora of pairwise models to avoid qualitative failures in predicting which species dominates a community or whether species coexist (Figures 3, 4 and 5). Sometimes, even when different communities share identical interaction mechanisms, depending on details such as relative species fitness, interaction strength, and initial conditions, the best-fitting pairwise model may or may not predict future dynamics ( Figure 3B Figure 6). This defeats the very purpose of pairwise modeling -using a single equation form to capture fitness effects of all pairwise species interactions regardless of interaction mechanisms or quantitative details. In a community of more than two microbial species, interaction modification can cause pairwise models to fail (Figure 7). Even if species interact in an interaction chain and thus interaction modification does not occur, various chain segments may require different forms of pairwise models. Taken together, a pairwise model is unlikely to be effective for predicting community dynamics especially if interaction mechanisms are diverse.

Discussions
Multispecies pairwise models are widely used in theoretical ecology due to their simplicity. These models assume that all pairwise species interactions can be captured by a single pairwise model regardless of interaction mechanisms or quantitative details of a community (universality assumption). This assumption may be satisfied if, for example, interaction mediators are always species themselves (e.g. prey-predation in a food web) so that pairwise models are equivalent to mechanistic models. However, interactions in microbial communities are diverse and often mediated by chemicals ( Figure 2). Here, we consider the validity of universality assumption of pairwise models in wellmixed, two-species microbial communities. We have focused on various types of chemical-mediated interactions commonly encountered in microbial communities (Figure 2) (Kato et al., 2005;Gause, 1934;Ghuysen, 1991;Jakubovics et al., 2008;Chen et al., 2004;D'Onofrio et al., 2010;Johnson et al., 1982;Hamilton and Ng, 1983). For each type of species interaction, we construct a mechanistic model to generate reference community dynamics (akin to experimental results). We then attempt to derive the best-matching pairwise model and ask how predictive it is.
We first consider cases where abiotic resources are in excess. When one species affects another species via a single chemical mediator, either the saturable L-V or the alternative pairwise model is appropriate, depending on the interaction mechanism (consumable versus reusable mediator), relative fitness of the two species, and initial conditions (Figure 3; Figure 3-figure supplement 2 to Left: Two species S 1 and S 2 compete for shared resource C 1 . Additionally, S 1 produces C 2 that promotes the growth of S 2 upon consumption. Right: An L-V pairwise model captures the intra-and inter-species competition as well as the commensal interaction between the two species. (B,C) Examples where L-V pairwise models predict the mechanistic reference dynamics well. (D) An example where the L-V pairwise model fails to predict the dynamics qualitatively (note the much longer time range). Here, population fractions fluctuate due to changes in relative concentration of C 1 compared to C 2 . In all cases, the pairwise model is derived from the population dynamics in the initial stages of growth (150 hr in all cases). Simulation parameters are listed in Figure 6-source data 1. DOI: 10.7554/eLife.25051.024 Figure 6 continued on next page Figure 3-figure supplement 5). These two models are not interchangeable (Figure 4). If one species influences another species through multiple mediators, then in general, these mediators may not be regarded as a single mediator nor representable by a single pairwise model. For example, for two reusable mediators, unless their potencies are similar or one mediator is much more potent than the other, saturable L-V model parameters can qualitatively differ depending on initial community density ( Figure 5-figure supplement 1D). Consequently, a pairwise model derived from a highdensity community generates false predictions for low-density communities ( Figure 5C), limiting the usefulness of pairwise models. We then consider a community where two species compete for a shared resource while engaging in commensalism via a single chemical mediator. We find that the best-fitting L-V pairwise model can predict future dynamics in some but not all communities, depending on parameters used in the mechanistic model ( Figure 6). Thus, although a single equation form can work in many cases, it generates qualitatively wrong predictions in many other cases.
In communities of more than two microbial species, indirect interactions via a third species can occur. When indirect interactions take the form of interaction chains, if each chain segment of two species engages in an independent interaction and can be represented by a pairwise model, then multispecies pairwise models can work ( Figure 7A-B). However, as discussed above, pairwise equation forms may vary among chain segments depending on interaction mechanisms and quantitative details of a community. When indirect interactions take the form of interaction modification, even if each species pair can be accurately represented by a pairwise model, a multispecies pairwise model may fail ( Figure 7C-F, ). Interaction modification includes trait modification (Wootton, 2002;Werner and Peacor, 2003;Schmitz et al., 2004), or, in our cases, mediator modification. Mediator modification is very common in microbial communities. For example, antibiotic released by one species to inhibit another species may be inactivated by a third species, and this type of indirect interactions can stabilize microbial communities (Kelsic et al., 2015;Bairey et al., 2016). As another example, interaction mediators are often generated by and shared among multiple species. For example in oral biofilms, organic acids such as lactic acid are generated from carbohydrate fermentation by many species (Bradshaw et al., 1994;Marsh and Bradshaw, 1997;Kuramitsu et al., 2007). Such by-products are also consumed by multiple species (Kolenbrander, 2000).
One can argue that an extended pairwise model (e.g. dS2 dt ¼ r 20 S 2 þ rS 2 C S1 &þ!S1þ S2 S 2 ) embodying both the saturable form and the alternative form can serve as a general-purpose model at least for pairwise interactions via a single mediator. In fact, even the effects of indirect interactions may be quantified and included in the model by incorporating higher-order interaction terms (Case and Bender, 1981;Worthen and Moore, 1991), although with many challenges (Wootton, 2002). In the end, although these strategies may lead to a sufficiently accurate phenomenological model especially within the training window, they may fail to predict future dynamics.
When might a pairwise model be useful? First, pairwise models have been instrumental in understanding ecological phenomena such as prey-predator oscillatory dynamics and coexistence of competing predator species (Volterra, 1926;MacArthur, 1970;Case and Casten, 1979;Chesson, 1990). In these cases, mechanistic models are either identical to pairwise models or can be transformed into pairwise models under simplifying assumptions. Second, pairwise models of pairwise species interactions can provide a bird's-eye view of strong or weak stimulatory or inhibitory interactions in a community. For example, Vetsigian et al., 2011 found that interactions between soil-isolated Streptomyces strains are enriched for reciprocity -if A inhibits or promotes B, it is likely that B also inhibits or promotes A (Vetsigian et al., 2011). Third, pairwise models have been useful in qualitatively understanding species assembly rules in small communities (Friedman et al., 2017). That is, qualitative information regarding species survival in competitions among a small number of species may be used to predict survival in more diverse communities within a similar time window. Fourth, a pairwise model can serve as a starting point for generating hypotheses on species The following source data is available for figure 6: Source data 1. List of parameters for simulations in Figure 6 on an interaction through a consumable mediator, for species consuming a shared abiotic resource. DOI: 10.7554/eLife.25051.025 Figure 7. Interaction chain but not interaction modification may be represented by a multispecies pairwise model. We examine three-species communities engaging in indirect interactions. Each species pair is representable by a two-species pairwise model (saturable L-V or alternative pairwise model, purple in the right columns of B, D, and F). We then use these two-species pairwise models to construct a three-species pairwise model, and test how well it predicts the dynamics known from the mechanistic model. In B, D, and F, left panels show dynamics from the mechanistic models (solid lines) and three-species pairwise models (dotted lines). Right panels show the difference metric D. (A-B) Interaction chain: S 1 affects S 2 , and S 2 affects S 3 . The two interactions employ independent mediators C 1 and C 2 , and both interactions can be represented by the saturable L-V pairwise model. The threespecies pairwise model matches the mechanistic model in this case. Simulation parameters are provided in Figure 7-source data 1. (C-F) Interaction modification. In both cases, the three-species pairwise model fails to predict reference dynamics even though the dynamics of each species pair can be represented by a pairwise model. (C-D) S 3 consumes C 1 , a mediator by which S 1 stimulates S 2 . Parameters are listed in Figure 7-source data 2. Here, S 1 changes the nature of interaction between S 2 and S 3 : S 2 and S 3 do not interact in the absence of S 1 , but S 3 inhibits S 2 in the presence of S 1 . The three-species pairwise model makes qualitatively wrong prediction about species coexistence. As expected, if S 3 does not remove C 1 , the three-species pairwise model works (Figure 7-figure supplement 1A-B). (E-F) S 1 and S 3 both supply C 1 which stimulates S 2 . Here, no species changes 'the nature of interactions' between any other two species: both S 1 and S 3 contribute reusable C 1 to stimulate S 2 . S 1 promotes S 2 regardless of S 3 ; S 3 promotes S 2 regardless of S 1 ; S 1 and S 3 do not interact regardless of S 2 . However, a multispecies pairwise model assumes that the fitness effects from the two producers on S 2 will be additive, whereas in reality, the fitness effect on S 2 saturates at high . As a result, the three-species pairwise model qualitatively fails to capture relative species abundance. As expected, if C 1 affects S 2 in a linear fashion, the community dynamics is accurately captured in the multispecies pairwise model (Figure 7 Source data 1. List of parameters for simulations in Figure 7B on interaction between three species in a chain. DOI: 10.7554/eLife.25051.027 Source data 2. List of parameters for simulations in Figure 7D on interaction modification through consumption of a shared mediator by a third species. DOI: 10.7554/eLife.25051.028 Figure 7 continued on next page interactions (e.g. Li et al., 2015). Note that when applied to microbial communities (Mounier et al., 2008;Stein et al., 2013;Marino et al., 2014), a fitting pairwise model means that the training dynamics of the community under investigation can be approximated by a theoretical community where species interactions satisfy the additivity and universality assumptions of pairwise models. Even though the theoretical community is likely different from the real community, hypothesis formulation can still be valuable. Finally, pairwise models can be useful in making predictions of limited scales. For example, Stein et al. used 2/3 of community dynamics data as a training set to derive a multispecies pairwise model, and in the best-case scenario, the model generated reasonable predictions on the remaining 1/3 of data (Stein et al., 2013). However, as we have shown, pairwise models can generate qualitatively wrong predictions (Figures 4-7), especially if interaction mechanisms are diverse such as in microbial communities. Not surprisingly, predicting qualitative consequences of species removal or addition using a pairwise model has encountered difficulties, especially in communities of more than three species (Mounier et al., 2008;Friedman et al., 2017).
An alternative to a pairwise model is a mechanistic model. How much information about interaction mechanisms do we need to construct a mechanistic model? That is, what is the proper level of abstraction which captures the phenomena of interest, yet avoids unnecessary details (Li et al., 2015;Durrett and Levin, 1994)? For example, Tilman argued that if a small number of mechanisms (e.g. the 'axes of trade-offs' in species traits) could explain much of the observed pattern (e.g. species coexistence), then this abstraction would be highly revealing (Tilman, 1987). However, the choice of abstraction is often not obvious. Consider for example a commensal community where S 1 grows exponentially (not explicitly depicted in equations in Figure 8) and the net growth rate of S 2 , which is normally zero, is promoted by mediator C from S 1 in a linear fashion (Figure 8). If we do not know how S 1 stimulates S 2 , we can still construct an L-V pairwise model ( Figure 8A). If we know the identity of mediator C and realize that C is consumable, then we can instead construct a mechanistic model incorporating C ( Figure 8B). However, if C is produced from a precursor via an enzyme E released by S 1 , then we get a different form of mechanistic model ( Figure 8C). If, on the other hand, E is anchored on the membrane of S 1 and each cell expresses a similar amount of E, then equations in Figure 8D are mathematically equivalent to Figure 8B. This simple example, inspired by extracellular breakdown of cellulose into a consumable sugar C (Bayer and Lamed, 1986;Felix and Ljungdahl, 1993;Schwarz, 2001), illustrates how knowledge of mechanisms may eventually help us determine the right level of abstraction.
In summary, under certain circumstances, we may already know that microbial interaction mechanisms fall within the domain of validity for a particular pairwise model. In these cases, a pairwise model provides the appropriate level of abstraction, and constructing such a pairwise model is much easier than a mechanistic model (Figure 1). However, if we do not know whether a pairwise model is valid, we will need to be cautious since pairwise models can fail to even qualitatively capture pairwise microbial interactions. We need to be equally careful when extrapolating and generalizing conclusions obtained from pairwise models, especially for communities where species interaction mechanisms are diverse. Considering recent advances in identifying and quantifying interactions, we advocate a transition to models that incorporate interaction mechanisms at the appropriate level of abstraction. . Different levels of abstraction in a mechanistic model. How one species (S 1 ) may influence another (S 2 ) can be mechanistically modeled at different levels of abstraction. For simplicity, here we assume that interaction strength scales in a linear (instead of saturable) fashion with respect to mediator concentration or species density. The basal fitness of S 2 is zero. (A) In the simplest form, S 1 stimulates S 2 in an L-V pairwise model. (B) In a mechanistic model, we may realize that S 1 stimulates S 2 via a mediator C which is consumed by S 2 . The corresponding mechanistic model is given. (C) Upon probing more deeply, it may become clear that S 1 stimulates S 2 via an enzyme E, where E degrades an abundant precursor (such as cellulose) to generate mediator C (such as glucose). In the corresponding mechanistic model, we may assume that E is released by S 1 at a rate z ES1 and that E liberates C at a rate h CE . (D) If instead E is anchored on the cell surface (e.g. cellulosome), then E is proportional to S 1 . If we substitute E into the second equation, then (B) and (D) become equivalent. Thus, when enzyme is anchored on cell surface but not when enzyme is released, the mechanistic knowledge of enzyme can be neglected. DOI: 10.7554/eLife.25051.033

Interaction modification but not interaction chain violates the additivity assumption
In a pairwise model, the fitness of a focal species S i is the sum of its 'basal fitness' (r i0 , the net growth rate of a single S i individual in the absence of any intra-species or inter-species interactions) and the additive fitness effects exerted by pairwise interactions with other members of the community. Mathematically, an N-species pairwise model is often formulated as Here, f ij S j À Á describes how S j , the density of species S j , positively or negatively affects the fitness of S i , and is a linear or nonlinear function of only S j .
Indirect interactions via a third species fall under two categories (Wootton, 1993). The first type is known as 'interaction chain' or 'density-mediated indirect interactions'. For example, the consumption of plant S 1 by herbivore S 2 is reduced when the density of herbivore is reduced by carnivore S 3 . In this case, the three-species pairwise model does not violate the additivity assumption (compare with Equation 6 (Case and Bender, 1981;Wootton, 1994).
The second type of indirect interactions is known as 'interaction modification' or 'trait-mediated indirect interactions' or 'higher order interactions' (Vandermeer, 1969;Wootton, 1994;Billick and Case, 1994;Wootton, 2002), where a third species modifies the 'nature of interaction' from one species to another (Wootton, 2002;Werner and Peacor, 2003;Schmitz et al., 2004). For example, when carnivore is present, herbivore will spend less time foraging and consequently plant density increases. In this case, f 12 in Equation 7 is a function of both S 2 and S 3 , violating the additivity assumption.

Summary of simulation files
Simulations are based on Matlab and executed on an ordinary PC. Steps are: Step 1: Identify monoculture parameters r i0 , r ii , and K ii (Figure 1-figure supplement 2C, Row 1 and Row 2).
Step 3: Calculate distance D between population dynamics of the reference mechanistic model and the approximate pairwise model over a period of time outside of the training window to assess if the pairwise model is predictive.
Fitting is performed using nonlinear least squares (lsqnonlin routine) with default optimization parameters. The following list describes the m-files used for different steps of the analysis: Returns growth dynamics for communities of two species competing for an environmental resource while engaging in an additional interaction, based on the logistic L-V pairwise model (Figure 6) C2Sp2_ARCLi_NoSatDp_FitBFLogLV_DI.m Source code 14

File name Function
Estimates logistic L-V pairwise model interaction parameters for communities of two species competing for an environmental resource while engaging in an additional interaction, and compares community dynamics from pairwise and mechanistic models ( Figure 6) Dynamics_WM_NetworkDpMM_ODE23.m Source code 15 Defines differential equations when using Matlab's ODE23 solver to calculate community dynamics Case_C1Sp2_CmnsDp_ODE23.m Source code 16 Example of using Matlab ODE23 solver for calculating community dynamics

Deriving a pairwise model for interactions mediated by a single consumable mediator
To facilitate mathematical analysis, we assume that requirements calculated below are eventually satisfied within each dilution cycle (see Figure 3-figure supplement 4 for an example where dilution cycles necessitated by long convergence time violate requirements for a pairwise model to converge to the mechanistic model). We further assume that r 10 >0 and r 20 >0 so that species cannot go extinct in the absence of dilution. See Figure 3-figure supplement 5 for a summary of this section. When S 1 releases a consumable mediator which stimulates the growth of S 2 , the mechanistic model as per Figure 3B, is dS1 dt Let C 1 ðt ¼ 0Þ ¼ C 10 ¼ 0; S 1 ðt ¼ 0Þ ¼ S 10 ; and S 2 ðt ¼ 0Þ ¼ S 20 . Note that the initial condition C 10 ¼ 0 can be easily imposed experimentally by pre-washing cells. Under which conditions can we eliminate C 1 so that we can obtain a pairwise model of S 1 and S 2 ?
Define R S ¼ S 2 =S 1 as the ratio of the two populations.
Since R S declines exponentially with a rate faster than jr 20 þ r S2C1 À r 10 j, we can ignore the third term of the right hand side of Equation 10 if it is much smaller than the first term. That is, Thus for t ) ln jr 20 þ r S2C1 À r 10 j, dC1 dt » b C1S1 À r 10C1 . When initialC 1 is 0, this equation can be solved to yield:C 1 » b C1S1 1 À exp Àr 10 t ð Þ ð Þ=r 10 . After time of the order of 1=r 10 , the second term can be neglected. Thus,C 1 » b C1S1 =r 10 after time of the order of max ln jr 20 þ r S2C1 À r 10 j; 1=r 10 . Then C 1 can be replaced by b C1S1 =r 10 À Á S 1 in Equation 8, and a saturable L-V pairwise model can be derived.
Case II: r S 2 C 1 >r 10 À r 20 >0 For Equation 8, we find that a steady state solution for C 1 and R S , denoted respectively as C Ã 1 and R Ã S , exist. They can be easily found by setting the growth rates of S 1 and S 2 to be equal, and dC 1 =dt to zero.
However, if C 1 has not yet reached steady state, imposing steady state assumption would falsely predict R S at steady state and thus remaining at its initial value (Figure 4Bii , dotted lines). Since dC 1 =dt in Equation 8 is the difference between two exponentially growing terms, we factor out the exponential term S 1 to obtain When f » 0, we can eliminate C 1 and obtain an alternative pairwise model Or where v and c are constants (Figure 3Bii). For certain conditions (which will be discussed at the end of this section, Figure 3-figure supplement 5A), this alternative model can make reasonable predictions of community dynamics even before the community reaches the steady state (Figure 4Bii , compare dashed and solid lines). Below we discuss the general properties of community dynamics and show that there exists a time scale t f after which it is reasonable to assume f » 0 and the alternative model can be derived. We also estimate t f for several scenarios.
We first make C 1 and R S dimensionless by definingĈ 1 ¼ C 1 =C Ã 1 andR S ¼ R S =R Ã S ('^' indicating scaling against steady state values). Equation 9 can then be rewritten as whereK S2C1 ¼ K S2C1 =C Ã 1 . From Equations 8 and 11, we obtain Using these scaled variables, f (i.e. the square bracket in Equation 15) can be rewritten as and Equations 14 and 17 allow us to construct a phase portrait where the x axis isĈ 1 and the y axis iŝ R S (Figure 3-figure supplement 2A-D). Note that at steady state,Ĉ 1 ;R S À Á ¼ ð1; 1Þ. Setting Equation 16 to zero:R defines the f -zero-isocline on theĈ 1 ÀR s phase plane (i.e. values ofĈ 1 ;R S À Á at which fĈ 1 ;R S À Á ¼ 0 and thusĈ 1 can be eliminated to obtain a pairwise model; Figure 3-figure supplement 2A-D blue lines). As shown in Figure 3-figure supplement 2A, the phase portrait is divided into four regions by the f -zero-isocline (blue) and the steady stateĈ 1 ¼ 1 (vertical solid line), and grey arrows dictate the direction of the community dynamics trajectory (Ĉ 1 ,R S ). Starting from 'initial state' (Ĉ 1 ðt ¼ 0Þ ¼ 0, It is difficult to solve Equations 14 and 15 analytically because the detailed community dynamics depends on the parameters and the initial species composition in a complicated way. However, under certain initial conditions, we can estimate t f , the time scale for the community to approach the f -zero-isocline. Note that t f is not a precise value. Instead it estimates the acclimation time scale after which a pairwise model can be derived. One assumption used when estimating all t f is that S 10 is sufficiently high (Figure 3-figure supplement 5B) to avoid the long lag phase that is otherwise required for the mediator to accumulate to a high enough concentration.
From Equation 18, the asymptotic value for the f -zero-isocline is This is plotted as a black dotted line in Figure 3-figure supplement 2A-D.
Below we consider three different initial conditions forR S t ¼ 0 ð Þ: , this becomes R S 0 ð Þ=R Ã S ) maxð1; r10Àr20 r20þrS 2 C 1 Àr10 Þ. A typical trajectory of the system is shown in Figure 3-figure supplement 2B: at time t ¼ 0, using Equations 14 and 15, the community dynamics trajectory (orange solid line in Figure 3-figure supplement 2B inset) has a slope of From Equation 18, the slope of the f -zero-isocline (blue line in Figure 3 The approximation in the last step is due to the very definition of Case II-1: The initial steepness of the community dynamics trajectory (Equation 20) will be much smaller than that of the f -zero-isocline (Equation 21) if If we do not scale, together with Equation 11, this becomes: In this case, the community dynamics trajectory before getting close to the f -zero-isocline can be approximated as a straight line (the orange dotted line) and the change inR S can be approximated by the green segment in the inset of Figure 3-figure supplement 2B. Since the green segment, the orange dotted line and the red dashed line form a right angle triangle, the length of green segment can be calculated once we find the length of the red dashed line DĈ 1 , which is the horizontal distance between (Ĉ 1 0 ð Þ,R S 0 ð Þ) and the f -zero-isocline and can be calculated from Equation 16: The green segment DR S is then the length of red dashed line ( ( 1: In case II-1, before the system reaches the f -zero-isocline, from Equation 24,Ĉ 1 DĈ 1 <1=R S ð0Þ thus From the top portion of Equation 11, According to the condition,

RSð0Þ
( 1 Thus, the above approximation of Equation 14 is valid, and we obtain r 20 À r 10 ð Þ.
Since here DR S (R S 0 ð Þ and ln 1 þ x ð Þ~x for small x, together with Equation 25, we have If unscaled, using Equation 11, this becomes If S 10 is low, a typical example is shown in Figure 3-figure supplement 2D. Here, because it takes a while for C 1 to accumulate, during this lagging phasê R S t ð Þ »R S 0 ð Þ exp Àjr 10 À r 20 jt ð Þ and there is a sharp plunge inR S before the trajectory levels off and climbs up. Although the trajectory eventually hits the f -zero-isocline where the alternative pairwise model can be derived, estimating t f is more complicated. Here we consider a simpler case where S 10 is large enough so that the trajectory levels off immediately after t ¼ 0, andR S » 1 before the trajectory hits the f -zero-isocline (Figure 3-figure supplement 2A). SinceR S decreases untilĈ 1 ¼ 1 and from Equation 20, and similar to the reasoning in Case II-1, if is To calculate the time it takes for the trajectory to reach the f -zero-isocline, let D sĈ1 ¼Ĉ 1 À 1 and D sRS ¼R S À 1 at any time point t respectively represent deviation of (Ĉ 1 t ð Þ,R S t ð Þ) away from their steady state values of (1, 1). We can thus linearize Equation 14 and Equation 15 around the steady state. Note that since at the steady state f = 0, thus D s f ¼ f .
During t f 1 ,Ĉ 1 increases from 0 to 1. Thus, 1 »b C 1 S 1 S1ð0Þ r10 ðe r10tf 1 À 1Þ. t f 1 » lnðr 10 =ðb C1S1 S 10 Þ þ 1Þ=r 10 . If t f 1 » ðb C1S1 S 10 Þ À1 ( r À1 10 . Using Equation 14 and sinceĈ 1 is very large, This yields and a conservative estimation of t f is In the unscaled form, this becomes: Case III: r 10 <r 20 In this case, supplier S 1 always grows slower than S 2 . As t ! ¥, R S ¼ S 2 =S 1 ! ¥ and C 1 ! 0. The phase portrait is separated into two parts by the f-zero-isocline (Figure 3-figure supplement 2E), where, as in Equation 12, Note that the asymptotic value of R S (black dotted line, Figure 3-figure supplement 2E-H) is From Equation 9, dR S =dt>0. From Equation 8, below the f -zero-isocline, dC1=dt>0 and above the f -zero-isocline, dC1=dt<0. Thus if the system starts from 0; R S 0 ð Þ ð Þ, the phase portrait dictates that it moves with a positive slope until a time of a scale t f when it hits the f -zero-isocline, after which it moves upward to the left closely along the f -zero-isocline (Figure 3-figure supplement 2E). After t f , the alternative pairwise model can be derived. Although t f is difficult to estimate in general, it is possible for the following cases.
Similar to Case II-2, if S 10 is small, there is a lagging phase during which the trajectory rises steeply before leveling off (Figure 3-figure supplement 2H). Although the alternative pairwise model can be derived once the trajectory hits the f -zero-isocline, t f takes a complicated form. Here we consider two cases where S 10 is large enough so that we can approximate the trajectory as a straight line going through ð0; R s ðt ¼ 0ÞÞ (Figure 3-figure supplement 2F). Graphically, S 10 is large enough so that the green segment in Figure 3-figure supplement 2F, whose length is DR S , is much smaller than R S 0 ð Þ. In other words, From Equations 8 and 9 Figure 3-figure supplement 2F, is the horizontal distance between 0; R S 0 ð Þ ð Þ and the f -zero-isocline and then from Equation 9 and r 20 >r 10 , the upper bound of t f can be calculated as A typical example is displayed in Figure 3-figure supplement 2G. The trajectory moves with a small positive slope so that the intersection of the community dynamics trajectory with the f-zero-isocline is near the black dotted line b C1S1 =a C1S2 (Equation 39) where C 1 =K C1S2 is large. The upper bound of t f can thus be estimated from Equation 9: which yields a conservative estimate of Conditions for the alternative pairwise model to approximate the mechanistic model Cases II and III showed that population dynamics of the mechanistic model could be described by the alternative pairwise model. However, since the initial condition for C 1 cannot be specified in pairwise model, problems could occur. To illustrate, we examine the phase portrait of the pairwise equation . From Equations 8 and 13, Below, we plot Equation 43 under different parameters (Figure 3-figure supplement 3) to reveal conditions for convergence between mechanistic and pairwise models.
. Case II (r S2C1 >r 10 À r 20 >0): steady state R Ã S exists for mechanistic model. Figure 3-figure supplement 3A): When R S S Ã , dR S =dt is positive. When R S S Ã , dR S =dt is negative. Thus, wherever the initial R S , it will always converge toward the only steady state R Ã S of the mechanistic model. If !<0 (Figure 3-figure supplement 3B): ! þ R S ¼ 0 or R S ¼ À!= creates singularity. Pairwise model R S will only converge toward the mechanistic model steady state if . Case III (r 10 <r 20 ): R S increases exponentially in mechanistic model (Equation 9). Thus, C 1 will decline toward zero as C 1 is consumed by S 2 whose relative abundance over S 1 exponentially increases. Hence, according to Equation 9, R S eventually increases exponentially at a rate of r 20 À r 10 .
If ! ! 0 ( , which is based on alternative pairwise model, also predicts that R S will eventually increase exponentially at a rate of r 20 À r 10 , similar to the mechanistic model. Conditions under which a saturable L-V pairwise model can represent one species influencing another via two reusable mediators Here, we examine a simple case where S 1 releases reusable C 1 and C 2 , and C 1 and C 2 additively affect the growth of S 2 (see example in Figure 5). Similar to Figure 3A, the mechanistic model is: S 1 ¼ S 10 exp r 10 t ð Þ dS2 dt ¼ r 20 þ rS 2 C 1 S1 S1þKS 2 C 1 r10=b C 1 S 1 þ rS 2 C 2 S1 S1þKS 2 C 2 r10=b C 2 S 1 S 2 ( Now the question is whether the saturable L-V pairwise model S 1 ¼ S 10 exp r 10 t ð Þ dS2 dt ¼ r 20 þ r 21 S1 S1þK21 S 2 ( can be a good approximation. For simplicity, let's define K C1 ¼ K S2C1 r 10 =b C1S1 and K C2 ¼ K S2C2 r 10 =b C2S1 . Small K Ci means large potency (e.g. small K C2 can be caused by small K S2C2 which means low C 2 required to achieve half maximal effect on S 2 , and/or large synthesis rate b C2S1 ). Since S 1 from pairwise and mechanistic models are identical, we have D ¼ 1 2T R T j log 10 S 2;pair À Á À log 10 S 2;mech À Á jdt ¼ 1 2T ln 10 ð Þ R T j ln S 2;pair À Á À ln S 2;mech À Á jdt ¼ 1 2T ln 10 ð Þ R T j R t r 20 þ r 21 S1 S1þK21 dt À R t r 20 þ rS 2 C 1 S1 S1þKC1 þ rS 2 C 2 S1 S1þKC2 dt dt ¼ 1 2T ln 10 ð Þ R T R t r 21 S1 S1þK21 À rS 2 C 1 S1 S1þKC1 þ rS 2 C 2 S1 S1þKC2 h i dt dt (46) D can be close to zero when (i) K C1 » K C2 or (ii) rS 2 C 1 S1 S1þKC1 and rS 2 C 2 S1 S1þKC2 (effects of C 1 and C 2 on S 2 ) differ dramatically in magnitude. For (ii), without loss of generality, suppose that the effect of C 2 on S 2 can be neglected. This can be achieved if (iia) r S2C2 is much smaller than r S2C1 , or (iib) K C2 is large compared to S 1 .

Competitive commensal interaction
For the community in Figure 6A, our mechanistic model is: Here, S 1 and S 2 are the densities of the two species; r i0 is the basal net growth rate of S i (negative, representing death in the absence of the essential shared resource C 1 ); C 1 is supplied at a constant rate b 0 ; b C2 S 1 is the production rate of C 2 by S 1 ; a Ci S j is the amount of resource C i consumed to produce a new S j cell.
The growth of S 2 is controlled by C 1 and C 2 . When C 1 is limiting (C 1 =K S2C1 ( C 2 =K S2C2 ), the fitness influence of the two chemicals on S 2 becomes: which is the standard Monod equation. A similar argument holds for limiting C 2 . We have intentionally chosen very large K S2 C 2 to ensure that the fitness effect of C 2 on S 2 is linear with respect to C 2 . This way, we minimize the number of pairwise model parameters that need to be estimated.
For our L-V pairwise model, to capture intra-species competition, we use where non-negative b i0 represents the maximal birth rate of S i at nearly zero population density (no competition), and non-negative d i represents the constant death rate of S i . Positive k i is the 'carrying capacity' imposed by the limiting resource, and is the S i at which birth rate becomes zero. This equation can be simplified to: When L i >0 (i.e. when b i0 >d i ), this resembles standard L-V model traditionally used for competitive interactions (compare to Equation 2; Gause, 1934;Thébault and Fontaine, 2010;Mougi and Kondoh, 2012).
Thus, for the competitive commensal community, we have: dS1 dt ¼ b 10 1 À S1 L11 À S2 Here, birth rate of each species is reduced by competition from the two species, and L ij is the carrying capacity such that a single S i individual will have a zero birth rate when encountering a total of L ij individuals of S j . For S 2 , We used b 20 þ r 21 S 1 ð Þ 1 À S1 L21 À S2

L22
S 2 þ r 21 S 1 S 2 so that when the shared resource is exhausted (i.e. 1 À S1 L21 À S2 L22 =0), S 2 does not keep growing due to the presence of S 1 .

Additional information
. . Source code 11. Estimates saturable L-V pairwise model interaction parameters (r 21 and K 21 ) in cases where we know that S 2 is only affected by S 1 , to accelerate optimization. DOI: 10.7554/eLife.25051.044 . Source code 12. Estimates alternative pairwise model interaction parameter (r 21 ) in cases where we know that S 2 is only affected by S 1 and that K S2C1 =K C1S2 to accelerate optimization. DOI: 10.7554/eLife.25051.045 . Source code 13. Returns growth dynamics for communities of two species competing for an environmental resource while engaging in an additional interaction, based on the logistic L-V pairwise model ( Figure 6). DOI: 10.7554/eLife.25051.046 . Source code 14. Estimates logistic L-V pairwise model interaction parameters for communities of two species competing for an environmental resource while engaging in an additional interaction, and compares community dynamics from pairwise and mechanistic models ( Figure 6)