Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

# Modelling microbiome recovery after antibiotics using a stability landscape framework

## Abstract

Treatment with antibiotics is one of the most extreme perturbations to the human microbiome. Even standard courses of antibiotics dramatically reduce the microbiome’s diversity and can cause transitions to dysbiotic states. Conceptually, this is often described as a ‘stability landscape’: the microbiome sits in a landscape with multiple stable equilibria, and sufficiently strong perturbations can shift the microbiome from its normal equilibrium to another state. However, this picture is only qualitative and has not been incorporated in previous mathematical models of the effects of antibiotics. Here, we outline a simple quantitative model based on the stability landscape concept and demonstrate its success on real data. Our analytical impulse-response model has minimal assumptions with three parameters. We fit this model in a Bayesian framework to data from a previous study of the year-long effects of short courses of four common antibiotics on the gut and oral microbiomes, allowing us to compare parameters between antibiotics and microbiomes, and further validate our model using data from another study looking at the impact of a combination of last-resort antibiotics on the gut microbiome. Using Bayesian model selection we find support for a long-term transition to an alternative microbiome state after courses of certain antibiotics in both the gut and oral microbiomes. Quantitative stability landscape frameworks are an exciting avenue for future microbiome modelling.

## Introduction

### Stability and perturbation in the microbiome

The human microbiome is a complex ecosystem. While stability is the norm in the gut microbiome, disturbances and their consequences are important when considering its impact on health [1]. A course of antibiotics is a major perturbation, typically leading to a marked reduction in species diversity before subsequent recovery [2]. Aside from concerns about the development of antibiotic resistance, even a brief course can result in long-term effects on community composition [3]. However, modelling the recovery of the microbiome is challenging, due to the difficulty of quantifying the in vivo effects of antibiotics on the hundreds of co-occurring species that make up microbial communities within the human body.

Artificial perturbation experiments are widely used to explore the underlying dynamics of macro-ecological systems [4]. In the context of the gut microbiome, the effects of antibiotics have previously been investigated [5,6,7], but despite interest in the application of ecological theory to the gut microbiome [8] the nature of this recovery remains unclear. While responses can appear highly individualized [7] this does not preclude the possibility of generalized models applicable at the population level.

Applying mathematical models to other ecological systems subject to perturbation can give useful insight [9,10,11]. Crucially, it allows the comparison of different hypotheses about the system using model selection. Developing a consistent mathematical framework for quantifying the long-term effects of antibiotic use would also facilitate comparisons between different antibiotics and different regimens, with the potential to inform approaches to antibiotic stewardship [12].

### Previous modelling approaches

A great deal of modelling work has focused on the gut microbiome’s response to antibiotic perturbation. We mention a few important examples here. Bucci et al. [13] used a two-compartment density model with species categorized as either antibiotic-tolerant or antibiotic-sensitive, and fitted their model to data from Dethlefsen and Relman [7]. In a later review, Bucci and Xavier argued that models of wastewater treatment bioreactors could be adapted for the gut microbiome, with a focus on individual-based models [14]. The most commonly-used individual-based model is the multispecies Generalized Lotka–Volterra (GLV) model, which describes pairwise interactions between bacterial species (or other groupings). In a pioneering work, Stein et al. [15] extended a GLV model to include external perturbations, and fitted their model to a study where mice received clindamycin and developed Clostridium difficile infection (CDI) [16]. The same approach was also subsequently applied to human subjects, identifying a probiotic candidate for treating CDI [17]. Bucci et al. [18] have combined and extended their previous work into an integrated suite of algorithms (MDSINE) to infer dynamical systems models from time-series microbiome data.

While all of these models have provided useful insights into microbiome dynamics, to make meaningful inference they require dense temporal sampling and restriction to a small number of species. For example, the examples of application of MDSINE had “26–56 time points” for accurate inference of dynamics, measurements of relative concentrations of bacteria, and frequent shifts of treatment—for these reasons the in vivo experiments were conducted in gnotobiotic mice [18]. Similarly, Stein et al. restricted their analysis of CDI to the ten most abundant bacterial genera [15]. Such restrictions reduce the suitability of these methods for opportunistic analysis of existing 16S rRNA gene datasets from the human microbiome, which currently comprise the majority of clinically relevant datasets. GLV models can undoubtedly be extremely useful for simple synthetic consortia, as shown by Venturelli et al. who inferred the dynamics of a 12-species community [19]. However, it has been shown that even for very small numbers of species, pairwise microbial interaction models do not always accurately predict future dynamics, suggesting that pairwise modelling has its own limitations [20].

Starting from broader ecological principles allows quantitative investigation of high-level statements and hypotheses about microbiome dynamics. For example, Coyte et al. built network models based on principles from community ecology to show that competitive interactions in the gut microbiome are associated with stable states of high diversity [21]. More recently, Goyal et al. took inspiration from the ‘stable marriage problem’ in economics and showed that multiple stable states in microbial communities can be explained by nutrient preferences and competitive abilities [22]. There is therefore great value in exploring alternative modelling approaches to GLV models as well as continuing to refine and extend them.

### A stability landscape approach

In a popular schematic picture taken from classical ecology, the state of the gut microbiome is represented by a ball sitting in a stability landscape [1, 23,24,25]. Perturbations can be thought of as forces acting on the ball to displace it from its equilibrium position [25] or as alterations of the stability landscape [26]. While this image is usually provided only as a conceptual model to aid thinking about the behaviour of the ecosystem, here we use it to derive a mathematical model.

We model the effect of a brief course of antibiotics on the microbial community’s phylogenetic diversity as the impulse response of an overdamped harmonic oscillator (Fig. 1; see Methods), and compare parameters for four widely-used antibiotics by fitting to empirical data previously published by Zaura et al. [3]. This model is significantly less complicated than previous models developed for similar purposes, but still captures some of the essential emergent features of such a system while avoiding the computational difficulties of fitting hundreds of parameters to a sparse dataset. After demonstrating the effectiveness of this modelling approach for the gut and oral microbiome, we also show that the framework can easily be used to test hypotheses about microbiome states. We compare a model variant, which allows a transition to a new equilibrium, and find that this model is better supported for clindamycin and ciprofloxacin, allowing us to conclude that these antibiotics can produce state transitions across different microbiomes. We also find a transition to a new equilibrium when reanalyzing a separate dataset from Palleja et al. [27], using a different diversity metric that had already been calculated by the authors (richness) based on applying a different sequencing approach (shotgun metagenomics) to an different antibiotic regimen (meropenem, gentamicin, and vancomycin). This modelling approach can therefore be easily applied to sparse datasets from different human microbiomes, antibiotics, and sequencing approaches, providing a simple but consistent foundational framework for quantifying the in vivo impacts of antibiotics.

## Results

### Ecological theory motivates a simplified representation of the microbiome

Taking inspiration from classical ecological theory, the microbiome can be considered as an ecosystem existing in a stability landscape: it typically rests at some equilibrium, but can be displaced (Fig. 1a). The shape of this landscape is determined by the extrinsic environmental factors; a change in these could produce a (reversible) change in the shape of the landscape e.g. shifts in the human gut microbiome when an individual temporarily relocates from the USA to Southeast Asia, which are reversed on return [28]. Here we assume that these environmental factors remain approximately constant at the timescales considered (<1 year), based on previous observations e.g. that the oral microbiome can exhibit stability over periods of at least 3 months [29], and the gut microbiome for up to 5 years [30]. Any quantitative model of the microbiome based on this concept then requires a definition of equilibrium and displacement. While earlier studies sought to identify a equilibrium core set of ‘healthy’ microbes, disturbances of which would quantify displacement, it has become apparent that this is not a practical definition due to high inter-individual variability in taxonomic composition [25]. More recent concepts of a healthy ‘functional core’ appear more promising, but characterization is challenging, particularly as many gut microbiome studies use 16S rRNA gene sequencing rather than shotgun metagenomic sequencing.

For these reasons, we choose a metric that offers a proxy for the general functional potential of the gut microbiome: phylogenetic diversity [25]. Diversity is commonly used as a summary statistic in microbiome analyses and higher diversity in the gut microbiome has previously been generally associated with health [31] and temporal stability [32]. Of course, describing the microbiome using only a single number loses a great deal of information. Furthermore, there is no general relationship between ‘diversity’ and ‘stability’: the relationship depends on the specific definitions of both quantities. We are interested in the scenario of fixed-length perturbations, where ‘stability’ can be quantified in terms of the rate of return to equilibrium after perturbation—this stability has been empirically observed to increase with greater species diversity [33]. If we are seeking to build a general model of microbiome recovery after perturbation, it seems appropriate to consider a simple metric first to see how such a model performs before developing more complicated definitions of equilibrium, which may generalize poorly across different niches and individuals. Other scenarios might require different definitions and correspondingly different assumptions.

We assume the equilibrium position to have higher diversity than the points immediately surrounding it i.e. creating a potential well (Fig. 1b). However, there may be alternative stable states (Fig. 1b) that perturbations may move the microbiome into (Fig. 1c). These states may be either higher or lower in diversity; for our purposes, all we assume is that they are separated from the initial equilibrium by a potential barrier of diversity, i.e. a decrease of diversity is required to access them, which helps to keep the microbiome at equilibrium under normal conditions. Our strong assumption here is obviously influenced by the specific perturbation scenario: we know a priori that antibiotics decrease diversity in the short-term, so we are not attempting to model other types of transition. However, considering the empirical evidence and the consensus view among ecologists that a diversity of species with a range of sensitivities to different environmental conditions should lead to greater stability [33, 34], we feel this rule may hold in a range of other scenarios: ecosystems may often exist at or near a (local) maximum value of diversity. An equilibrium does not have to be believed in as a true and eternal state; we attempt here to use insights from theoretical communities with well-defined mathematical equilibria to move to modelling empirical communities where they are approximate concepts, valid over some given time period.

### The model

Mathematically, small displacements of a mass from an equilibrium point can be approximated as a simple harmonic oscillator [35] for any potential function (continuous and differentiable). This approximation comes naturally from the first terms in the Taylor expansion of a function [36], and can be extremely accurate for small perturbations. By assuming the local stability landscape of the microbiome can be reasonably approximated as a harmonic potential, we are assuming a ‘restoring’ force proportional to the displacement x from the equilibrium position (−kx) and also a ‘frictional’ force acting against the direction of motion ($$- b\dot x$$). The system is a damped harmonic oscillator with the following equation of motion:

$$\frac{{d^2x}}{{dt^2}} + b\frac{{dx}}{{dt}} + kx = 0$$
(1)

Additional forces acting on the system—perturbations—appear on the right-hand side of this equation. Consider a course of antibiotics of duration τ. If we are interested in timescales of $$T \gg \tau$$ (e.g. the long-term recovery of the microbiome a year after a week-long course of antibiotics) we can assume that this perturbation is of negligible duration. This assumption allows us to model it as an impulse of magnitude D acting at time t = 0:

$$\frac{{d^2x}}{{dt^2}} + b\frac{{dx}}{{dt}} + kx = D\delta \left( t \right)$$
(2)

This second-order differential equation can be solved analytically and reparameterized (see Methods) to give a model with three parameters, with a general qualitative shape of sudden change followed by slower recovery (Model 1, Fig. 1c):

$$x_1\left( t \right) = \frac{{De^{\phi _1}e^{\phi _2}}}{{e^{\phi _2} - e^{\phi _1}}} \cdot \left( {e^{ - e^{\phi _1}t} - e^{ - e^{\phi _2}t}} \right)$$
(3)

### Fitting the model to empirical data

We fit the model to published data from a paper from Zaura et al. [3] where individuals received a 10-day course of either a placebo or one of four commonly-used antibiotics (Table 1). Faecal and saliva samples were taken at baseline (i.e. before treatment), directly after treatment, and then 1 month, 2 months, 4 months, and 1 year after treatment. Zaura et al. conducted pairwise comparisons between timepoints and comprehensively reported statistical associations, but did not attempt any explicit modelling of the time-response over the year. This dataset provides an ideal test case for our model. Not only does it allow us to simultaneously model the recovery of both the gut and oral microbiomes after different antibiotics, but it also demonstrates how our modelling framework permits further conclusions beyond the scope of the initial study. We additionally fit our model to a shotgun metagenomics dataset from a recent antibiotic perturbation experiment from Palleja et al. [27].

### A stability landscape framework successfully describes initial microbiome dynamics

Although individual microbiome responses were personalized (Supplementary Figure 1), normalized diversity trajectories followed the same general pattern for each antibiotic (Supplementary Figure 2). We used a Bayesian approach to fit the model to each treatment group and microbiome separately, successfully capturing the main features of the initial response to antibiotics (Fig. 2). Diversity decreased (i.e. positive displacement from equilibrium increased) before a slow return to equilibrium. Despite large variability between samples from the same treatment group, reassuringly the placebo group clearly did not warrant an impulse response model, whereas data from individuals receiving antibiotics were qualitatively in agreement with the model. Even without the model, it is apparent that clindamycin and ciprofloxacin represent greater disturbances to the microbiome than minocycline and amoxicillin, but a consistent model allows comparison of the values of various parameters (see ‘Comparison of parameters between antibiotics’ below).

In their original analysis, Zaura et al. noted significantly (p < 0.05) reduced Shannon diversity in individuals receiving ciprofloxacin comparing samples after a year to baseline. This reduced diversity could in principle merely be due to slow reconstitution and return to the original equilibrium. However, by taking into account each individual’s temporal response with a model rather than pairwise comparisons it appears that slow reconstitution cannot be the whole story. Instead, the skewed distribution of residuals after a year, when the response has flattened off, indicates that the longer-term dynamics of the system do not obey the same impulse response as the short-term dynamics. A scenario involving a long-term transition to an alternative stable state is consistent with this observation (Fig. 1). We therefore developed a variant of the model to take into account alternative equilibria, aiming to test the hypothesis that the microbiome had transitioned to an alternative stable state.

### Support for the existence of antibiotic-induced state transitions

In our approach, a transition to an alternative stable state means that the value of diversity displacement from the original equilibrium asymptotically tends to a non-zero value. There are many options for representing this mathematically; for reasons of simplicity, we add a single parameter A and a term that asymptotically grows over time (Model 2, Fig. 1c):

$$x_2\left( t \right) = \frac{{De^{\phi _1}e^{\phi _2}}}{{e^{\phi _2} - e^{\phi _1}}} \cdot \left( {e^{ - e^{\phi _1}t} - e^{ - e^{\phi _2}t}} \right) + A \cdot \left( {1 - e^{ - e^{\phi _1}t}} \right)$$
(4)

Qualitatively, this slightly more complex model gave a similar fit (Fig. 3) but some treatment groups had a clear non-zero final displacement from equilibrium, corresponding to an alternative stable state. We compared models with the Bayes factor BF, where BF > 1 indicates support for a state transition (Table 2). A state transition was supported in the ciprofloxacin and clindamycin treatment groups for both the gut (BFcipro = 3.06, BFclinda = 10.94) and oral (BFcipro = 16.87, BFclinda = 7.47) microbiomes. The posterior estimates for the asymptote parameter in the gut microbiome were positively skewed (Fig. 4), providing evidence of a transition to a state with lower phylogenetic diversity. Contrastingly, in the oral microbiome the asymptote parameter was negatively skewed, suggesting a transition to a state with greater phylogenetic diversity. Strikingly, these are the respective states associated with poorer health in both microbiomes.

### Comparison of parameters between antibiotics

Comparing the posterior distribution of parameters for model 2 fits allows quantification of the ecological impact of different antibiotics (Table 3, Fig. 4). Unsurprisingly, greater perturbation is correlated with the transition to an alternative stable state. We can also consider the ecological implications of the parameters we observe. The damping ratio $$\zeta = b/\left( {2\sqrt k } \right)$$ summarizes how perturbations decay over time, and is considered as an inherent property within the model. Therefore, if our modelling framework and ecological assumptions were valid we would expect to find a consistent damping ratio across both the clindamycin and ciprofloxacin groups in the gut microbiome. This is indeed what we observed with median (95% credible interval) damping ratios of $$\zeta _{{\mathrm{clinda}}}$$ = 1.07 (1.00–1.65) and $$\zeta _{{\mathrm{cipro}}}$$ = 1.07 (1.00–1.66), substantially different from the prior distribution, supporting the view that the gut microbiome dynamics can be approximated by a damped harmonic oscillator.

### Application to other sequencing approaches and diversity metrics

In a recent paper, Palleja et al. [27] used deep shotgun metagenomic sequencing to characterize the gut microbiomes of twelve healthy men for 180 days after a 4-day course of meropenem, gentamicin, and vancomycin. They observed that while there were no significant differences in the Shannon diversity between baseline and day 180, there was a significant difference in species richness. Furthermore, they noted that compositional changes between day 42 and day 180 were not significantly different when compared to paired samples in Human Microbiome Project controls. Both these two pieces of information suggest a state transition, although Palleja et al. do not use this terminology and instead refer to a return to “stable composition”. Reanalyzing this species richness data with our model shows that the gut microbiomes of these individuals had transitioned to a new alternative state (Supplementary Figure 3; Table 4), strengthening Palleja et al.’s conclusion that some bacteria may have been permanently lost [27]. Other future metagenomic datasets could also be analyzed using our model in this way.

### Connection to generalized Lotka–Volterra models

We sought to establish a link between our framework and the conventional ‘bottom-up’ approach of GLV models. We investigated the behaviour of a 3-species Lotka–Volterra system to establish if perturbation to an alternative state was possible in this simple case (see Methods: ‘Lotka–Volterra simulations’). We found that only 0.079% of 3-species Lotka–Volterra systems exhibit the behaviour required by our two-state model—because we assume that diversity is continuous, this model is unrealistic for small species numbers. However, for larger numbers, theoretical ecology gives strong justification for our assumptions. As the number of species n increases, the number of fixed points that are stable increases [37], and the proportion of simulations from random parameters that have multiple fixed points also increases e.g. with n = 400, this proportion is >97% [38]. This suggests that the overwhelming majority of mathematically possible systems at relevant numbers of species exhibit multiple fixed points; the fraction of biologically possible systems exhibiting this behaviour is likely even higher. Furthermore, when the realistic assumption of resource competition is incorporated, all these fixed points become stable or marginally stable [38]. Goyal et al. recently showed that multiple resilient stable states can exist in microbial communities if microbes utilize nutrients one at a time [22]. We can therefore state confidently that: the gut microbiome can be treated as having multiple stable equilibria; its community composition is history-dependent; and perturbations lead to transitions between the multiple possible stable states. These assumptions are the basis of the simplistic coarse-grained model we describe here, which effectively takes these high-level emergent properties of multispecies Lotka–Volterra models to build a substantially simpler model based on a single, commonly-used metric: diversity.

## Discussion

Starting from a conceptual picture of the microbiome resting in a stability landscape, we have developed a mathematical model of its response to antibiotic perturbation. Our framework, based on phylogenetic diversity, successfully captures the dynamics of a previously published 16S rRNA gene dataset for four common antibiotics [3], providing quantitative support for these simplifying ecological assumptions. Using model selection, our framework provides additional insight—we find that the effects of clindamycin persist for a year after exposure, and also identify a state transition in the oral microbiome with clindamycin, neither of which was detected by the initial authors. We also demonstrate the flexibility of our model by fitting it to data from a recent shotgun metagenomics antibiotic perturbation experiment [27].

While pairwise comparisons of diversity can still identify differences in microbiome state, they provide no information on dynamics. Our framework therefore gives additional insight in this regard. Zaura et al. observed that the lowest diversity in the gut microbiome was observed after a month rather than immediately after treatment [3]. This cannot be due to a persistence of the antibiotic effect, as all antibiotics used have short half-lives of the order of hours [39, 40]. Within our framework, this can be understood as an overdamping effect: we found a consistent damping ratio for both ciprofloxacin and clindamycin. This is not in itself a complete explanation (it does not identify a mechanistic biological process behind the ‘damping’) but it gives insight that such a process may exist.

We have also demonstrated how our framework could be used to compare different hypotheses about the long-term effects of antibiotic perturbation by fitting different models and using Bayesian model selection. Our model provides an additional line of evidence that while short-term restoration obeys a simple impulse response, the underlying long-term community state can be fundamentally altered by a brief course of antibiotics, as suggested previously [7], raising concerns about the long-term impacts of antibiotic use. While this state transition may not necessarily equate to any negative health impacts for the host (none of the participants involved in the original study [3] reported any gastrointestinal disturbance), the transition to a new state with reduced diversity in the gut microbiome may increase the risk of colonisation and overgrowth of pathogenic species. It has been shown experimentally in Drosophila that invasion and subsequent colonization is a stochastic process that is reduced by a more diverse gut [41]. Conversely, in the oral microbiome the state transition was to a state with increased diversity, which is correspondingly associated with a greater risk of disease in the oral cavity [42]. We believe this makes sense within a stability landscape framework. Even if only marginal, when considered at a population level, such effects may mean that antibiotics have substantial negative health consequences, which could support reductions in the length of antibiotic courses independently of concerns about antibiotic resistance [43]. Modelling the long-term impact on the microbiome of different doses and courses could help to influence antibiotic use in routine clinical care. Our sample size is small, so the precise posterior estimates for parameters that we obtain should not be over-interpreted, but comparing antibiotics using these parameter estimates represents another practical application.

Our framework lends itself naturally to comparing different dynamical models. We see our two variant models as a starting point for stability landscape approaches, and would hope that better models can be constructed. Hierarchical mixed effects models may offer an improved fit, particularly if they take into account other covariates; we lacked the necessary metadata on the participants from the original study (Table 1) to explore such models. Furthermore, diversity as a single metric clearly fails to capture all the complexity of the microbial community and its interactions, and there are multiple issues with calculating it accurately. Nevertheless, the observation that treating phylogenetic diversity as the key variable in the stability landscape captures microbiome dynamics supports observations of functional redundancy in the microbiome [31]. An interesting extension of this work would be to systematically fit the model to a variety of diversity metrics or other summary statistics and assess the model fit to see which metric (or combination of metrics) is most appropriately interpreted as the state variable parameterising the stability landscape. A complementary approach could consider the ‘resistome’, which should conversely rise in diversity after antibiotic treatment [44].

Expanding the stability landscape approach to other microbiome datasets might require re-examining our assumptions. A non-diversity metric might well be superior in situations where the ‘ideal’ state of the microbiome can be clearly defined: for example, in a bioreactor where experimental conditions can be maintained to consistently produce a given equilibrium community composition, one could define displacement using ecological distance from this well-defined state. However, even a single microbial strain under constant conditions can exhibit astonishing and unpredictable complexity over time [45], so we feel that diversity is a good starting point. As a general guide for experiments, because an impulse response model for a perturbation of length τ assumes an experiment length $$T \gg \tau$$, we suggest the appropriate sampling effort for microbiomes undergoing perturbation should be to have samples immediately before and after, as well as samples out to T > 30τ. We recommend more dense sampling at longer times to firmly establish whether a new equilibrium state has been reached.

We would not expect the behaviour of the microbiome after longer or repeated courses of antibiotics to be well-described by our model, which assumes a course of negligible duration. Nevertheless, it would be possible to use the stability landscape framework given here to obtain an analytic form for the possible system response by convolving any given perturbation function with the impulse response, although the model might break down in such circumstances. If the model fails to give a good fit, the inclusion of higher-order terms in the Taylor expansion of the chosen potential function about equilibrium (and correspondingly modifying Eq. 1) could prove useful.

As we have demonstrated, while the precise nature of the gut microbiome’s response to antibiotics is individualized, a general model still captures important dynamics. We believe it would be a mistake to assume that our model is ‘too simple’ to provide insight on a complex ecosystem. At this stage of our understanding, creating a comprehensive inter-species model of the hundreds of members of the gut microbiome is intractable; it may also be unnecessary if the aim is to inform clinical treatment based on sparse data. We believe there is a place for both fine-grained models using pairwise interactions—particularly for systems of reduced complexity—and coarse-grained models built from high-level ecological principles, as we have demonstrated here. Shade has argued that microbiome diversity is “the question, not the answer” [46]; diversity can still be an extremely useful quantity for modelling, but the patterns we report here warrant more mechanistic investigation. We have argued that a ‘top-down’ framework with multiple stable states of different diversities is consistent with the emergent behaviour of a multispecies Lotka–Volterra model. Further mathematical work to connect these two extremes would be worthwhile.

## Materials and methods

### Mathematical model of trajectories in the potential landscape

Treating the microbiome as a unit mass resting in a stability landscape parameterized by phylogenetic diversity leads to a second-order differential equation. To solve this equation, we assume that b2 > 4k (the ‘overdamped’ case) based on the lack of any oscillatory behaviour previously observed in the microbiome. Then, subject to the initial conditions x(t = 0) = 0 and $$\dot x\left( {t = 0} \right) = D$$ we obtain the following equation describing the system’s trajectory:

$$x\left( t \right) = \frac{D}{{2 \cdot \sqrt {\left( {\frac{b}{2}} \right)^2 - k} }}\left( {e^{ - \left( {\frac{b}{2} - \sqrt {\left( {\frac{b}{2}} \right)^2 - k} } \right)t} - e^{ - \left( {\frac{b}{2} + \sqrt {\left( {\frac{b}{2}} \right)^2 - k} } \right)t}} \right)$$
(5)

Fitting the model therefore requires fitting three parameters: b (the damping on the system), k (the strength of the restoring force), and D (how strong the perturbation is). For the purposes of fitting the model, having parameters be allowed values over all real numbers (−∞, +∞) is preferable to only positive numbers (0, +∞), so we choose to reparameterize the model using the following definitions:

$$b = e^{\phi _1} + e^{\phi _2}$$
(6)
$$k = e^{\phi _1 + \phi _2}$$
(7)

This results in Model 1 (Eq. 3, Fig. 1c).

Antibiotics may lead not just to displacement from equilibrium, but also state transitions to new equilibria [2]. To investigate this possibility, we also consider a model where the value of equilibrium diversity asymptotically tends to a new value A. To minimize model complexity, we add a single parameter with a term that asymptotically grows over time, resulting in Model 2 (Eq. 4, Fig. 1c).

### Main experimental dataset

To apply our framework, we fitted both models to two empirical datasets (see Supplementary Text 1). Zaura et al. [3] conducted a study on the long-term effect of antibiotics on the gut and oral microbiomes, where individuals were randomly assigned to one of five treatment groups: placebo, clindamycin, ciprofloxacin, minocycline, or amoxicillin (Table 1). Samples were collected at baseline (before treatment), immediately after exposure, then at 1 month, 2 months, 4 months, and 1 year after treatment.

### Phylogenetic diversity

There are many possible diversity metrics that could be used to compute the displacement from equilibrium. Because of our assumptions (see ‘Ecological theory motivates a simplified representation of the microbiome’), we chose to use Faith’s phylogenetic diversity [47] (see Supplementary Text 1).

### Bayesian model fitting

We used a Bayesian framework to fit our basic model 1 (Eq. 3) using Stan [48] and RStan [49] to the gut and oral microbiome samples for the five separate groups: placebo, ciprofloxacin, clindamycin, minocycline, and amoxicillin (i.e. n = 2 × 5 = 10 fits). In brief, our approach used four chains with a burn-in period of 1000 iterations and 9000 subsequent iterations, verifying that all chains converged ($$\hat R$$ = 1) and the effective sample size for each parameter was sufficiently large (n_eff  > 1000). We additionally fitted model 2 with a possible state transition (Eq. 4) to all non-placebo groups (n= 2 × 4 = 8 fits).

We used non-informative priors for all parameters in the original model 1 without a state transition (Eq. 3). For all groups, we used the same uniformly distributed prior for D (positive i.e. decrease in diversity) and uniform priors for ϕ1, ϕ2. For fitting model 2, we used an additional uniform prior centred at zero for the new equilibrium value A and the same priors for other parameters. In summary, the priors are as follows:

$$D\sim {\mathrm{uniform}}\left( {0,10} \right)$$
(8.1)
$$\phi _1\sim {\mathrm{uniform}}\left( { - 1.99,1,99} \right)$$
(8.2)
$$\phi _2\sim {\mathrm{uniform}}\left( { - 2,2} \right)$$
(8.3)
$$A\sim {\mathrm{uniform}}\left( { - 2,2} \right)$$
(8.4)

We compared models 1 and 2 (Supplementary Files 1 and 2). for each antibiotic treatment group using the Bayes factor [50, 51] after extracting the model fits using bridge sampling with the bridgesampling R package v0.2-2 [52]. A prior sensitivity analysis (not shown) showed that choice of priors did not affect our conclusions about model selection, although the strength of the Bayes factor varied.

Full code and data for fitting the models and reproducing figures is available with this article (Supplementary Files 15).

### Shotgun metagenomics dataset

For fitting to the dataset released by Palleja et al. [27], we used the published species richness data with an arbitrary scaling factor (see Supplementary Text 1 for details, Supplementary File 6 for code, Supplementary File 7 for downloaded data).

### Lotka–Volterra simulations

We numerically simulated 59 = 1953125 parameter sets of the GLV model with n = 3 species and investigated their behaviour and stable states. For more details see the corresponding supplementary discussion (Supplementary Text 2) and Mathematica notebook (Supplementary File 8).

## Data availability

The original sequencing dataset from Zaura et al. [3] used in this paper is available in the NCBI Short Read Archive (SRA Accession: SRP057504). Full code and reanalyzed datasets supporting the conclusions of this article are included as Supplementary Information. A full archive of main analyses including cached model fits is available in figshare (https://doi.org/10.6084/m9.figshare.6754880.v1).

## References

1. 1.

Relman DA. The human microbiome: ecosystem resilience and health. Nutr Rev. 2012;70 Supplement 1:S2–9. https://doi.org/10.1111/j.1753-4887.2012.00489.x.

2. 2.

Modi SR, Collins JJ, Relman DA. Antibiotics and the gut microbiota. J Clin Invest. 2014;124:4212–8. https://doi.org/10.1172/JCI72333.

3. 3.

Zaura E, Brandt BW, Teixeira de Mattos MJ, Buijs MJ, Caspers MPM, Rashid M-U, et al. Same exposure but two radically different responses to antibiotics: resilience of the salivary microbiome versus long-term microbial shifts in feces. mBio. 2015;6:e01693–15. https://doi.org/10.1128/mBio.01693-15.

4. 4.

Wootton JT. Experimental species removal alters ecological dynamics in a natural ecosystem. Ecology. 2010;91:42–8.

5. 5.

Sullivan Å, Edlund C, Nord CE. Effect of antimicrobial agents on the ecological balance of human microflora. Lancet Infect Dis. 2001;1:101–14. https://doi.org/10.1016/S1473-3099(01)00066-4.

6. 6.

Dethlefsen L, Huse S, Sogin ML, Relman DA. The pervasive effects of an antibiotic on the human gut microbiota, as revealed by deep 16S rRNA sequencing. PLoS Biol. 2008;6:e280. https://doi.org/10.1371/journal.pbio.0060280.

7. 7.

Dethlefsen L, Relman DA. Incomplete recovery and individualized responses of the human distal gut microbiota to repeated antibiotic perturbation. PNAS. 2011;108 Supplement 1:4554–61. https://doi.org/10.1073/pnas.1000087107.

8. 8.

Pepper JW, Rosenfeld S. The emerging medical ecology of the human gut microbiome. Trends Ecol Evol. 2012;27:381–4. https://doi.org/10.1016/j.tree.2012.03.002.

9. 9.

Skellam JG. Random dispersal in theoretical populations. Biometrika. 1951;38:196–218. https://doi.org/10.1093/biomet/38.1-2.196.

10. 10.

May RM. Stability and complexity in model ecosystems. p. 265. Princeton: Princeton University Press; 1973.

11. 11.

Scheffer M, Carpenter S, Foley JA, Folke C, Walker B. Catastrophic shifts in ecosystems. Nature. 2001;413:591–6. https://doi.org/10.1038/35098000.

12. 12.

Doron S, Davidson LE. Antimicrobial stewardship. Mayo Clin Proc. 2011;86:1113–23. https://doi.org/10.4065/mcp.2011.0358.

13. 13.

Bucci V, Bradde S, Biroli G, Xavier JB. Social interaction, noise and antibiotic-mediated switches in the intestinal microbiota.) PLoS Comput Biol.2012;8: e1002497. https://doi.org/10.1371/journal.pcbi.1002497.

14. 14.

Bucci V, Xavier JB. Towards predictive models of the human gut microbiome. J Mol Biol. 2014;426:3907–16. https://doi.org/10.1016/j.jmb.2014.03.017.

15. 15.

Stein RR, Bucci V, Toussaint NC, Buffie CG, Rätsch G, Pamer EG, et al. Ecological modeling from time-series inference: insight into dynamics and stability of intestinal microbiota. PLoS Comput Biol. 2013;9:e1003388. https://doi.org/10.1371/journal.pcbi.1003388.

16. 16.

Buffie CG, Jarchum I, Equinda M, Lipuma L, Gobourne A, Viale A, et al. Profound alterations of intestinal microbiota following a single dose of clindamycin results in sustained susceptibility to Clostridium difficile-induced colitis. Infection and immunity. 2012;80: 62–73. https://doi.org/10.1128/IAI.05496-11.

17. 17.

Buffie CG, Bucci V, Stein RR, McKenney PT, Ling L, Gobourne A, et al. Precision microbiome reconstitution restores bile acid mediated resistance to Clostridium difficile. Nature. 2014;517:205–8. https://doi.org/10.1038/nature13828.

18. 18.

Bucci V, Tzen B, Li N, Simmons M, Tanoue T, Bogart E, et al. MDSINE: Microbial Dynamical Systems INference Engine for microbiome time-series analyses. Genome Biol. 2016;17:121. https://doi.org/10.1186/s13059-016-0980-6.

19. 19.

Venturelli OS, Carr AC, Fisher G, Hsu RH, Lau R, Bowen BP, et al. Deciphering microbial interactions in synthetic human gut microbiome communities. Mol Syst Biol. 2018;14:e8157. https://doi.org/10.15252/MSB.20178157.

20. 20.

Momeni B, Xie L, Shou W. Lotka-Volterra pairwise modeling fails to capture diverse pairwise microbial interactions. eLife. 2017;6:e25051. https://doi.org/10.7554/eLife.25051.

21. 21.

Coyte KZ, Schluter J, Foster KR. The ecology of the microbiome: Networks, competition, and stability. Science. 2015;350:663–6. https://doi.org/10.1126/science.aad2602.

22. 22.

Goyal A, Dubinkina V, Maslov S. Multiple stable states in microbial communities explained by the stable marriage problem. ISME J. 2018;1:2823–34. https://doi.org/10.1038/s41396-018-0222-x.

23. 23.

Holling CS. Resilience and stability of ecological systems. Annu Rev Ecol Syst. 1973;4:1–23.

24. 24.

Lemon KP, Armitage GC, Relman DA, Fischbach MA. Microbiota-targeted therapies: an ecological perspective. Sci Transl Med. 2012;4:137rv5. https://doi.org/10.1126/scitranslmed.3004183.

25. 25.

Lloyd-Price J, Abu-Ali G, Huttenhower C. The healthy human microbiome. Genome Med. 2016;8:51. https://doi.org/10.1186/s13073-016-0307-y.

26. 26.

Costello EK, Stagaman K, Dethlefsen L, Bohannan BJM, Relman DA. The application of ecological theory toward an understanding of the human microbiome. Science. 2012;336:1255–62. https://doi.org/10.1126/science.1224203.

27. 27.

Palleja A, Mikkelsen KH, Forslund SK, Kashani A, Allin KH, Nielsen T, et al. Recovery of gut microbiota of healthy adults following antibiotic exposure. Nat Microbiol. 2018;3:1255–65. https://doi.org/10.1038/s41564-018-0257-9.

28. 28.

David LA, Materna AC, Friedman J, Campos-Baptista MI, Blackburn MC, Perrotta A, et al. Host lifestyle affects human microbiota on daily timescales. Genome Biol. 2014;15:R89. https://doi.org/10.1186/gb-2014-15-7-r89.

29. 29.

Utter DR, Mark Welch JL, Borisy GG. Individuality, stability, and variability of the plaque microbiome. Front Microbiol. 2016;7:564. https://doi.org/10.3389/fmicb.2016.00564.

30. 30.

Faith JJ, Guruge JL, Charbonneau M, Subramanian S, Seedorf H, Goodman AL, et al. The long-term stability of the human gut microbiota. Science. 2013;341:1237439. https://doi.org/10.1126/science.1237439.

31. 31.

Turnbaugh PJ, Ley RE, Hamady M, Fraser-Liggett CM, Knight R, Gordon JI. The Human Microbiome Project. Nature. 2007;449:804–10. https://doi.org/10.1038/nature06244.

32. 32.

Flores GE, Caporaso JG, Henley JB, Rideout JR, Domogala D, Chase J, et al. Temporal variability is a personalized feature of the human microbiome. Genome Biol. 2014;15:531. https://doi.org/10.1186/s13059-014-0531-y.

33. 33.

Ives AR, Carpenter SR. Stability and diversity of ecosystems. Science. 2007;317:58–62. https://doi.org/10.1126/SCIENCE.1133258.

34. 34.

Hooper DU, Chapin FS, Ewel JJ, Hector A, Inchausti P, Lavorel S, et al. Effects of biodiversity on ecosystem functioning: a consensus of current knowledge. Ecol Monogr. 2005;75:3–35. https://doi.org/10.1890/04-0922.

35. 35.

Riley KF, Hobson MP, Bence SJ. Eigenfunction methods for differential equations. Mathematical methods for physics and engineering. Cambridge: Cambridge University Press; 2002. p. 581–607.

36. 36.

Riley KF, Hobson MP, Bence SJ. Series and limits. Mathematical methods for physics and engineering. Cambridge: Cambridge University Press; 2002. p. 118–53.

37. 37.

Gibbs T, Grilli J, Rogers T, Allesina S. The effect of population abundances on the stability of large random ecosystems. Phys Rev E. 2017;98:022410.

38. 38.

Bunin G. Ecological communities with Lotka-Volterra dynamics. Phys Rev E. 2017;95:042414. https://doi.org/10.1103/PhysRevE.95.042414.

39. 39.

Bergan T, Thorsteinsson SB, Solberg R, Bjornskau L, Kolstad IM, Johnsen S. Pharmacokinetics of ciprofloxacin: intravenous and increasing oral doses. Am J Med. 1987;82(4A):97–102.

40. 40.

Leigh DA. Antibacterial activity and pharmacokinetics of clindamycin. J Antimicrob Chemother. 1981;7 Supplement A:3–9. https://doi.org/10.1093/jac/7.suppl_A.3.

41. 41.

Obadia B, Güvener ZT, Zhang V, Ceja-Navarro JA, Brodie EL, Ja WW, et al. Probabilistic invasion underlies natural gut microbiome stability. Curr Biol. 2017;27:1999–2006.e8. https://doi.org/10.1016/j.cub.2017.05.034.

42. 42.

Wade WG. The oral microbiome in health and disease. Pharmacol Res. 2013;69:137–43. https://doi.org/10.1016/j.phrs.2012.11.006.

43. 43.

Llewelyn MJ, Fitzpatrick JM, Darwin E, SarahTonkin-Crine, Gorton C, Paul J, et al. The antibiotic course has had its day. BMJ. 2017;358:j3418. https://doi.org/10.1136/BMJ.J3418.

44. 44.

van Schaik W. The human gut resistome. Philos Trans R Soc Lond B Biol Sci. 2015;370:20140087. https://doi.org/10.1098/rstb.2014.0087.

45. 45.

Good BH, McDonald MJ, Barrick JE, Lenski RE, Desai MM. The dynamics of molecular evolution over 60,000 generations. Nature. 2017;551:45–50. https://doi.org/10.1038/nature24287.

46. 46.

Shade A. Diversity is the question, not the answer. ISME J. 2017;11:1–6. https://doi.org/10.1038/ismej.2016.118.

47. 47.

Faith DP. Conservation evaluation and phylogenetic diversity. Biol Conserv. 1992;61:1–10. https://doi.org/10.1016/0006-3207(92)91201-3.

48. 48.

Carpenter B, Gelman A, Hoffman MD, Lee D, Goodrich B, Betancourt M, et al. Stan: a probabilistic programming language. J Stat Softw. 2017;76:1–32. https://doi.org/10.18637/jss.v076.i01.

49. 49.

Stan Development Team. RStan: the R interface to Stan. 2017. https://mc-stan.org/rstan/.

50. 50.

Aitkin M. Posterior Bayes factors. J R Stat Soc Ser B (Methodol). 1991;53:111–42. https://doi.org/10.2307/2345730.

51. 51.

Kass RE, Raftery AE. Bayes factors. J Am Stat Assoc. 1995;90:773–95. https://doi.org/10.1080/01621459.1995.10476572.

52. 52.

Gronau QF, Singmann H, Wagenmakers E-J. bridgesampling: an R package for estimating normalizing constants. arXiv. 2017;1710:08162.

## Acknowledgements

LPS was supported by the Engineering and Physical Sciences Research Council [EP/F500351/1] and the Reuben Centre for Paediatric Virology and Metagenomics. CPB is supported by the Wellcome Trust [209409/Z/17/Z]. We are grateful to Zaura et al. [3] and Palleja et al. [27] for making their data openly available, enabling the reanalysis with our modelling framework presented here.

## Author information

Authors

### Contributions

LPS conceived the model, performed analyses, and wrote the paper. LPS, CPB, HB and FB conceived the analysis of the Lotka–Volterra system, which was performed by HB. All authors contributed to the discussion and development of the model, gave comments, and read and approved the final manuscript.

### Corresponding author

Correspondence to Liam P. Shaw.

## Ethics declarations

### Conflict of interest

The authors declare that they have no conflict of interest.

Publisher’s note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Reprints and Permissions

Shaw, L.P., Bassam, H., Barnes, C.P. et al. Modelling microbiome recovery after antibiotics using a stability landscape framework. ISME J 13, 1845–1856 (2019). https://doi.org/10.1038/s41396-019-0392-1

• Revised:

• Accepted:

• Published:

• Issue Date:

• ### The role of oral bacteria in inflammatory bowel disease

• , Michael A. Curtis
•  & Joana F. Neves

Nature Reviews Gastroenterology & Hepatology (2021)

• ### Persistence of functional microbiota composition across generations

• Christian Ramos
• , Mario Calus
•  & Dirkjan Schokker

Scientific Reports (2021)

• ### Time-course alterations of gut microbiota and short-chain fatty acids after short-term lincomycin exposure in young swine

• Shanlong Tang
• , Shunfen Zhang
• , Ruqing Zhong
• , Dan Su
• , Bing Xia
• , Lei Liu
• , Liang Chen
•  & Hongfu Zhang

Applied Microbiology and Biotechnology (2021)

• ### Understanding the impact of antibiotic perturbation on the human microbiome

• Drew J. Schwartz
• , Amy E. Langdon
•  & Gautam Dantas

Genome Medicine (2020)

• ### GraphKKE: graph Kernel Koopman embedding for human microbiome analysis

• Kateryna Melnyk
• , Stefan Klus
• , Grégoire Montavon
•  & Tim O. F. Conrad

Applied Network Science (2020)