Introduction

Antibiotics are cornerstones of modern medicine due to their ability to inhibit the growth of pathogens during infections. Antibiotics are broadly characterized by their inhibitory mechanism as bacteriostatic (growth-halting) or bactericidal (death-causing), and by their spectrum of activity as broad or narrow1. The effects of most antibiotics have been predominantly investigated in species monocultures2, despite the fact that treatment in a clinical setting inevitably has unintended consequences on the multispecies communities that colonize the human gut3. Antibiotics can exert collateral damage on gut bacteria4 and reduce gut microbiota diversity5,6,7, the latter of which has been linked to increased propensity for Clostridiodes difficile infection8,9,10 and increased mortality after cancer treatment11. A deeper understanding of the interplay between antibiotic activity and community context could provide mechanisms to ameliorate treatment side effects and to mitigate the growing threat of antibiotic resistance12,13.

Community dynamics during antibiotic perturbations can be challenging to predict since context can alter antibiotic effects through interspecies interactions, pH modulation, and metabolic transformation6,14,15,16. The use of a variety of treatment regimens such as variable dosage13, sequential scheduling of multiple compounds17, and concurrent treatment with cocktails18 further complicates predictions. Moreover, concurrent application of multiple drugs can lead to synergistic or antagonistic effects19,20,21, whereby the degree of killing is greater or less, respectively, than the sum of the drugs individually. Importantly, intrinsic competition for nutrients within a community is a major driver of community dynamics in the absence22,23,24,25 and presence of antibiotics26,27. This plethora of phenomena motivates the development of a theoretical approach to untangle the network of interspecies interactions from activity of the antibiotic itself.

To interrogate the potential for emergent effects of antibiotics on community dynamics, we utilized consumer-resource (CR) models in which species growth is governed by nutrient availability28. Within CR models, species can coexist only when they occupy distinct resource niches29,30,31; how antibiotic perturbations affect species coexistence remains unclear. Here, we incorporate species-specific death rates into CR models to map the complex behaviors that can arise from the interplay between resource competition and antibiotic activity or other growth-inhibiting perturbations. Although we focus on antibiotic-related scenarios, our model is applicable to other scenarios such as bacteriophage addition or environmental (e.g., temperature) changes.

We derived a general framework describing how species-specific death rates shift the resource competition landscape, and hence the criteria for coexistence and the consequences for community diversity. Using this framework, we delineated the effects of antibiotic dosage, scheduling, and combination. We found that increasing the degree of targeting of a single species, akin to varying the concentration of a narrow-spectrum antibiotic, can result in non-monotonic changes in richness. In addition, the order of sequential application of multiple antibiotics can qualitatively affect the final community architecture, and treatment with antibiotic combinations can result in synergism or antagonism at the level of community diversity. These phenomena arose solely from resource competition, independent of other biological mechanisms. Importantly, these phenomena were prevalent, even in communities with many species and in the presence of metabolic cross-feeding, suggesting that they may typically occur in microbial communities.

Results

Conditions for coexistence in a CR model with antibiotic activity

We explore the effects of antibiotics on community dynamics using an established formulation of a well-mixed CR model of \(m\) species competing for \(p\) supplied resources in a chemostat29 described by the equation

$$\frac{d{n}_{i}}{{dt}}={n}_{i}\left(\mathop{\sum }\limits_{\mu=1}^{p}\frac{{R}_{i\mu }{s}_{\mu }}{{\sum }_{k}{n}_{k}{R}_{k\mu }}-d\right),$$
(1)

where ni is the abundance of species i, \({R}_{i\mu }\) is the rate at which species \(i\) consumes resource \(\mu\), \({s}_{\mu }\) is the supply rate of resource \(\mu\), and \(d\) is the dilution rate of the chemostat, which affects each species uniformly (Fig. 1a, Table 1). To model the effects of bacteriostatic antibiotics, we assumed that the consumption rates \({R}_{i\mu }\) of species \(i\) decrease by a factor \({b}_{i}\), modifying Eq. 1 as follows:

$$\frac{d{n}_{i}}{{dt}}={n}_{i}\left(\mathop{\sum }\limits_{\mu=1}^{p}\frac{({R}_{i\mu }/{b}_{i}){s}_{\mu }}{{\sum }_{k}{n}_{k}({R}_{k\mu }/{b}_{k})}-d\right).$$
(2)

To model the effects of bactericidal antibiotics, we assumed that species \(i\) experiences death at rate \({d}_{i}\) in addition to the effects of dilution (Fig. 1a), modifying Eq. 1 as follows:

$$\frac{d{n}_{i}}{{dt}}={n}_{i}\left(\mathop{\sum }\limits_{\mu=1}^{p}\frac{{R}_{i\mu }{s}_{\mu }}{{\sum }_{k}{n}_{k}{R}_{k}}-\left(d+{d}_{i}\right)\right).$$
(3)

Importantly, when \({b}_{i}=(d+{d}_{i})/d\), Eqs. 2 and 3 are identical up to rescalings of time, species abundances, and resource consumption rates (Supplementary Text). Therefore, within this model, the effects of antibiotic activity on species coexistence can be understood as a reduction of the enzyme budget of species \(i\), \({E}_{i}={\sum }_{\mu }{R}_{i\mu }\), by a species-specific factor \({b}_{i}\) regardless of antibiotic mechanism (Fig. 1b). Steady-state species abundances are also typically similar between bactericidal and bacteriostatic antibiotic activity given the transformation described above, particularly for communities with larger overlap in consumption niche (Supplementary Fig. S1a, b), suggesting that antibiotic mechanism of action may be less impactful on community composition than the nutrient niches of the targeted species. More generally, reduction of enzyme budget can represent species-specific, deleterious effects of other perturbations. Although Eq. 1 does not account for complexities such as dynamic nutrient supply or interspecies interactions unrelated to nutrient competition, it represents a null model from which we can establish basic expectations.

Fig. 1: Implementation of antibiotic activity in a CR model.
figure 1

a Schematic of a well-mixed CR model29 with species-specific death rates \({d}_{i}\). Depicted are cells (colored ovals) from three species competing for two resources (small circles) supplied at rates \({s}_{\mu }\). b The effects of species-specific death rates on coexistence can be determined by reducing the consumption rates \({R}_{i\mu }\) by \({b}_{i}=(d+{d}_{i})/d\). The transformed consumption rates (open circles) have lower enzyme budgets compared to the original consumption rates (filled circles). c When a community of three species competes for three resources, the consumption rates can be visualized on a simplex representing the hyperplane containing the consumption niches of the three species in the space of rescaled consumption rates. In the case shown, the convex hull of the species consumption rate vectors (dashed line and shaded gray) encloses the point representing the normalized resource supply rates (star), hence all species coexist29. d Example in which two possible hyperplanes (dashed lines, i and ii) dictate the conditions for coexistence of three species (colored circles) competing for two resources. The third hyperplane (hashed gray line) does not satisfy the conditions for coexistence. e Along each hyperplane, a pair of species coexists if the normalized resource supply rates \({\hat{s}}_{\mu }\) lie between the rescaled consumption rates (colored triangles) of the species pair (hatched multicolored regions). Otherwise, only the species with \({\hat{R}}_{i\mu }\) closest to \({\hat{s}}_{\mu }\) persists (solid regions). f Species dynamics (bottom) for the community shown in (d) for one case of supply rates (triangle, top).

Table 1 Definitions of key variables and terms

It was previously shown that within the chemostat CR model described by Eq. 1, a set of species \(i\) with the same enzyme budgets (\({E}_{i}=E\)) will coexist if the convex hull of their consumption rates contains the normalized resource supply rates \((E/S){s}_{\mu }\) (Fig. 1c), where \({S}=\,{\sum }_{\mu }{s}_{\mu }\) is the total resource supply rate29. Motivated by the implementation of antibiotic activity described above, we found that we could generalize this coexistence rule to species-specific enzyme budgets \({E}_{i}\) and \({d}_{i}=0\) without loss of generality as follows. For a set of \(m\) species, a subset of \({m{{\hbox{'}}}}\) species will coexist if their consumption rates lie on a hyperplane defined by steady-state resource concentrations \({c}_{\mu }^{*}\) such that \({\sum }_{\mu }{R}_{i\mu }{c}_{\mu }^{*}=d\) for all species \(i\) in the subset, and if the hyperplane satisfies the following requirements: (1) all axis-intercepts \(d/{c}_{\mu }^{*}\) are positive and finite (so that \({c}_{\mu }^{*}\) are positive and finite); (2) no species have consumption rates that lie on the side of the hyperplane away from the origin, i.e., \({\sum }_{\mu }{R}_{i\mu }{c}_{\mu }^{*}\le d\) for all species \(i\) (since a species whose consumption rates lie above the hyperplane has a large enough enzyme budget that it will drive species on the hyperplane extinct); and (3) the normalized resource supply rates \({\hat{s}}_{\mu }={s}_{\mu }(d/S)\) lie within the convex hull of the rescaled consumption rates \({\hat{R}}_{i\mu }={R}_{i\mu }{c}_{\mu }^{*}\) of the \({m{{\hbox{'}}}}\) species (Supplementary Text). In an example community with three species competing for two resources, there are two hyperplanes (lines) that satisfy the first two conditions (Fig. 1d), and along each line, the species that will persist are determined according to the third condition (Fig. 1e, f). Unless otherwise specified, we will work in the space of rescaled consumption rates and normalized supply rates with no loss of generality (Supplementary Text), and we assume \({d}={S}=\,1\). As presented in the sections below, these rules produce intuitive behaviors as well as complex behaviors emerging from the interplay between species-specific antibiotic activity and resource competition, each of which can inform the interpretation of experiments.

Antibiotic treatment can promote coexistence in resource competition regimes involving generalists

To interrogate how antibiotic activity affects species coexistence, we first applied the coexistence conditions in Fig. 1 to analyze the minimal scenario of two species competing for two resources, \(m=p=2\). We considered four qualitatively distinct types of communities: two specialist consumers (each with only one nonzero consumption rate) with no niche overlap, one generalist (with two nonzero consumption rates) and one specialist, a pair of generalists with preference for distinct resources, and a pair of generalists with preference for the same resource (Fig. 2a). Naively, one might expect that increasing the death rate of a species would generally decrease the probability that it can persist in a community, and hence decrease the proportion of supply rates inside the convex hull, i.e., the size of the coexistence region. For two generalists with preference for distinct resources, as the ratio of their enzyme budgets changed from 1 due to antibiotic perturbation, the coexistence region size indeed decreased (Fig. 2a, red). However, for the trivial case of two specialists, there is no competition and hence the two species coexisted regardless of death rates (Fig. 2a, purple). For a generalist and a specialist, decreasing the enzyme budget of the generalist increased the coexistence region size (Fig. 2a, green), indicating that antibiotic activity targeting a generalist can promote coexistence. For two generalists with preference for the same resource, coexistence region size can exhibit non-monotonic dependence on enzyme budgets (Fig. 2a, yellow).

Fig. 2: Resource competition results in complex dependence of species coexistence on antibiotic activity.
figure 2

a Effect of antibiotic activity on two species (\(a\) and \(b\)) competing for two resources. (Left) Four types of communities with qualitatively distinct consumption niches were considered, including a specialist and a generalist (green), two specialists (purple), two symmetrically distributed generalists (red), and two asymmetrically distributed generalists (yellow). (Right) The fraction of supply rates that lead to coexistence (coexistence region size) can depend non-monotonically on the relative enzyme budget (\({E}_{a}/{E}_{b}\) for species \(a\) and \(b\) on the left). b Example community consisting of a non-targeted species (blue) and a targeted species (orange) that was initially more of a generalist (more equal consumption of both resources). (Left) Antibiotic activity resulted in decreased enzyme budget (empty circles). (Right) Map of coexistence regions as in Fig. 1e for the scenarios on the left. c Average richness during antibiotic perturbation (blue) and average coexistence region size during antibiotic perturbation (green) decreases with increasing antibiotic concentration \(c\) (left) and decreasing coexistence region size before antibiotic perturbation for simulations with \(c=1\) (right). Simulations of randomly drawn communities of three species competing for three resources (\(m=p=3\)) with consumption rates \(\vec{{R}_{i}}\) sampled uniformly from the unit simplex and all resources supplied at equal rates. Average richness was calculated across all communities with richness of 3 before antibiotic perturbation; shading denotes one standard deviation from the mean with a cutoff at a maximum richness of 3. Antibiotic concentration \(c\) scales the death rates, i.e., \({d}_{i}\to c{d}_{i}\). d A reservoir of species can lead to an increase in average richness during antibiotic perturbation. As in (c), but for communities with richness of 2 before antibiotic perturbation without (blue) or with a re-seeding pool of species to transiently repopulate the initially distinct species during antibiotic perturbation (red). Shading denotes one standard deviation from the mean with a cutoff at a maximum richness of 2 in the case without a re-seeding reservoir.

These non-monotonic behaviors arise because antibiotic activity affects the shape of the coexistence region rather than simply rescaling its size (Fig. 2b). The following example provides intuition for how the shape of the coexistence region changes with antibiotic activity. In the case of two generalists, when the more generalist of the two species (the one with more equal consumption of both resources) was targeted (Fig. 2b, i), its consumption niche was encroached upon by the non-targeted species (Fig. 2b, ii). As a result, the bounds of the coexistence region shifted toward the consumption niche of the targeted species since supply rates must be closer to the consumption rates of the targeted species to enable its coexistence. Thus, the coexistence region size initially increased with death rate and reached its maximum when the remapped boundaries were symmetric about the point of equal supply rates (Fig. 2b, ii). When the death rate of the targeted species was increased further (Fig. 2b, iii), expansion of the consumption niche of the non-targeted species and the concomitant shrinkage of the consumption niche of the targeted species led to an overall decrease in coexistence region size (Fig. 2b, iii). Steady-state community evenness in species abundance (measured as the exponential of the Shannon diversity index32) was similarly non-monotonic for this scenario (Supplementary Fig. S1c), demonstrating that antibiotic perturbations have similar effects on richness \(\rho\) and evenness.

To assess richness changes across communities, we investigated communities with three species competing for three resources (\(m=p=3\)) with consumption rates \({\vec{R}}_{i}\) sampled uniformly from the unit simplex of equal enzyme budgets (i.e., \({\sum }_{\mu=1}^{p}{R}_{i\mu }\,=\,1\) with equal probability of sampling all vectors that satisfy this constraint). Species-specific death rates were also drawn uniformly from the unit simplex for each community, and all resources were supplied at equal rates. For communities in which all three species coexisted prior to antibiotic perturbation, the average richness across all communities decreased as expected following the implementation of species-specific death rates, and the decrease in richness was larger for communities with smaller coexistence regions prior to antibiotic perturbation (Fig. 2c, right). Consistent with this trend, mimicking an increase in antibiotic concentrations for each community by multiplying all species-specific death rates by a factor \(c\) caused average richness to decrease monotonically (Fig. 2c, left). As expected, the average coexistence region size during antibiotic perturbation followed similar trends as the average richness (Fig. 2c). However, unlike the scenario above, in natural contexts there is often an external reservoir of species that can repopulate initially extinct species during antibiotic perturbation7. Simulations of communities in the presence of such a re-seeding pool of species and in which only two of the three species coexisted prior to antibiotic perturbation showed that the average richness during antibiotic perturbation can increase for communities under small antibiotic concentrations or with intermediate coexistence region sizes prior to perturbation (Fig. 2d), highlighting the potential prevalence of complex behavior involving species coexistence.

Increasing death rate can lead to non-monotonic changes in richness

Our simulations of randomly drawn communities showed that richness can increase upon antibiotic treatment in some cases (Fig. 2d). To investigate this behavior in more detail, we considered a community with \(m=p=3\) in which only one species (blue) persisted at steady state prior to antibiotic perturbation (Fig. 3a, b). As the death rate of this species was increased, in the presence of a re-seeding reservoir of all three species, the other two species (orange and green) were able to coexist with the targeted species (blue) during low levels of antibiotic perturbation (Fig. 3b, \({d}_{1}=0.5\)), analogous to the initial increase in coexistence region size when the more generalist species was targeted in a two-member community (Fig. 2b). As the death rate of the targeted species was increased further, the targeted species became more specialized in terms of its rescaled consumption rates (i.e., moved away from the supplied resource point at the center of the simplex). As in the two-member case, the perturbed convex hull shifted toward the niche of the targeted species (Fig. 3a, Supplementary Fig. S2), and in doing so, transited through six coexistence states (Fig. 3b), including two where all three species coexisted (Fig. 3b, \({d}_{1}=0.5\), \({d}_{1}=8\)), until the targeted species eventually became extinct at large enough death rates (Fig. 3b, \({d}_{1}=10\)). This example demonstrates that increasing antibiotic concentration can lead to numerous, non-monotonic richness changes.

Fig. 3: Richness can change non-monotonically with increasing death rate.
figure 3

a Trajectories of rescaled consumption rates as the death rate of the targeted species (blue) is increased. Arrow denotes the direction of increasing death rate. Circles mark the six death rates shown in (b). With increasing death rate, the targeted species eventually became more specialized, while the non-targeted species became more of a generalist and closer to the supplied resource point at the center of the simplex. b Population dynamics at the six death rates marked in (a). (\({d}_{1}=0\)) In the absence of antibiotic targeting, only the blue species persisted. (\({d}_{1}=0.3\)) For low death rates of the blue species, the orange species was able to coexist. (\({d}_{1}=0.5\)) There was a range of death rates that allowed for coexistence of all three species. (\({d}_{1}=1.5\)) As the death rate was increased further, the orange species went extinct. (\({d}_{1}=8\)) As the death rate increased even further, coexistence of all three species was again realized. (\({d}_{1}=10\)) Finally, at sufficiently high death rate the blue species went extinct. c Number of richness changes until the extinction of the targeted species as its consumption niche was varied across the simplex, while the consumption niches of the non-targeted species were fixed as in (a).

To quantify the prevalence of non-monotonic richness changes in response to increasing antibiotic concentration, we fixed the resource consumption rates of the two non-targeted species as in Fig. 3a and varied the consumption rates of the targeted species throughout the simplex. For each set of consumption rates, we calculated the number of changes in community richness as the death rate of the targeted species was increased from zero until the targeted species went extinct. As long as the targeted species was able to coexist prior to antibiotic perturbation, which was true for almost all of the simplex in this example, there were at least two richness changes (Fig. 3c), corresponding to a non-targeted species emerging from extinction into coexistence followed by the targeted species going extinct. Moreover, when the consumption niche of the targeted species was biased against the resource that was least preferred by the non-targeted species (resource 3 in Fig. 3c), the number of richness changes was typically larger, with a maximum value of five occurring when the targeted species consumed its two preferred resources at approximately equal rates (Fig. 3c). Taken together, these results demonstrate that non-monotonic behavior is likely to be prevalent across resource competition landscapes.

Non-transitive effects during sequential antibiotic treatments typically arise from promotion of antibiotic-induced extinctions by resource competition

Antibiotics are commonly administered sequentially to reduce the emergence of antibiotic resistance in the targeted species17. To predict the effects of sequential treatment in a community context, we asked whether the final richness in our model is dependent on the sequence in which two antibiotics are sequentially applied (transitivity). We first examined a community of three coexisting species and simulated the sequential application of two narrow-spectrum antibiotics that each target one of the three species (Fig. 4a). For each antibiotic, we simulated the population dynamics until steady state was reached. In this example, the orange species was driven extinct when it was targeted first (Fig. 4b, top left). Next, the antibiotic targeting the orange species was removed. The blue species was then targeted and became extinct as the green species encroached on its niche (Fig. 4b, top right). Thus, this treatment sequence eventually led to the presence of only one species (Fig. 4c, top). However, when the antibiotic treatment sequence was reversed, the community reached a distinct state. When the blue species was targeted first, it went extinct (Fig. 4b, bottom left). Next, when the orange species was targeted, it was not outcompeted by the green species (Fig. 4b, bottom right) and the two coexisted (Fig. 4c, bottom). Thus, the reverse sequence of treatment qualitatively altered the final coexistence (Fig. 4c, bottom) and the absolute value of the richness difference between the two sequences \(\triangle \rho\) was 1 (non-transitivity, Fig. 4c).

Fig. 4: Final coexistence is dependent on the sequence of antibiotic treatment.
figure 4

a An example community of three species (colored circles) for which the sequence of narrow-spectrum antibiotics can affect the final richness. The blue species promotes the action of the antibiotic that targets the orange species, causing the final richness to be non-transitive to the sequence of antibiotic treatment. b (Top left) Remapping of the consumption niche of all species when the death rate of the orange species was increased. The orange species went extinct, as the remapped convex hull does not enclose the supplied resource point. (Top right) Increasing the death rate of the blue species after the extinction of the orange species led to its extinction. (Bottom row) Same as top row, but the sequence of sequential antibiotics was reversed. Now, the green and orange species coexisted after the two treatments, thus \(\triangle \rho=1\). c Population dynamics were simulated until steady state for the scenarios in (b): (top) first with zero death rates, then with nonzero death rate for the orange species, then with nonzero death rate for the blue species (and zero death rate for the now extinct orange species); (bottom) with the reversed sequence of death rates. d An example community with nonzero \(\triangle \rho\) due to the blue species neutralizing the action of the antibiotic that targets the orange species. e Like (b) but for the community in (d). f Like (c) but for the community in (d). g Prevalence of non-transitivity via promotion (red) or neutralization (blue) as a function of the resource competition structure. \(\Delta \rho\) was calculated and the mechanism of non-transitivity was determined for communities of the form in (a) and (d) across parameters (\({D}_{T1}\), \({D}_{T2}\), \({D}_{N}\), \({d}_{1}\), \({d}_{2}\)), for death rates \({d}_{1}\in (0,\,1)\), \({d}_{2}\in (0,\,1)\) and \({D}_{T1}\), \({D}_{T2}\), and \({D}_{N}\) across their entire domains. The fraction of promotion and neutralization were averaged across all combinations \({D}_{N}\), \({d}_{1}\), and \({d}_{2}\). Non-transitivity due to promotion (neutralization) was more likely for low (high) \({D}_{T1}\) and low (high) \({D}_{T2}\). h Same as (g) but averaged across all \({D}_{T1}\), \({D}_{T2}\), and \({d}_{2}\) (or equivalently, \({d}_{1}\) if \({d}_{2}\) was shown on the x-axis).

For this community, the extinction of the orange species was dependent on competition between the orange and blue species (Fig. 4b), hence an antibiotic that eliminated the blue species allowed the orange species to coexist with the green species even when the orange species was later targeted (Fig. 4b, bottom). That is, the mechanism leading to non-transitivity was competition promoting the action of the antibiotic that targets the orange species (Fig. 4b, top left, bottom right), while the antibiotic that targets the blue species caused the extinction of the blue species regardless of community context (Fig. 4b, top right, bottom left). Another scenario that can result in non-transitivity is competition neutralizing the action of one antibiotic but not the other. In an example of neutralization (Fig. 4d–f), the antibiotic that targets the orange species only caused extinction of the orange species when the blue species was absent (Fig. 4e, top left and Fig. 4e, bottom right). Because the antibiotic that targets the orange species was neutralized by competition while the antibiotic that targets the blue species caused the blue species to go extinct regardless of community context (Fig. 4e, bottom left and Fig. 4e, top right), \(\triangle \rho=1\) (Fig. 4f).

To explore the conditions under which the final richness depends on antibiotic sequencing, we calculated \(\Delta \rho\) for the community in Fig. 4a across a five-dimensional parameter space: the distances \({D}_{T1}\in (0,\sqrt{2/3})\) and \({D}_{T2}\in (0,\sqrt{2/3})\) from the supplied resource point to the consumption rates of the two targeted species, the distance between the non-targeted species and the supplied resource point \({D}_{N}\in (0,\sqrt{2/3})\), and the death rates of the two targeted species, \({d}_{1}\in (0,\,1)\), \({d}_{2}\in (0,\,1)\). We varied each of these five parameters independently across their respective domains, calculating \(\triangle \rho\) for all combinations of parameter values. In all cases, \(\triangle \rho\) was 0 or 1, with \(\triangle \rho=1\) when the final richness after an antibiotic sequence was 2 and the final richness after the reverse sequence was 1 (or vice versa); if the final richness after an antibiotic sequence is 3, then the final richness after the reverse sequence must also be 3, and thus \(\triangle \rho=0\). This behavior occurs when \({D}_{N}\) is sufficiently large (\({D}_{N} \, \gtrsim \, 0.5\)), so that the non-targeted species is a specialist for its unique resource and hence cannot outcompete any other species in pairwise competition. As a result, the richness after any antibiotic sequence was \(\ge 2\) (Supplementary Fig. S3), hence \(\triangle \rho\) was always 0.

We found that all occurrences of nonzero \(\triangle \rho\) could be classified by resource competition either promoting (Fig. 4a–c) or neutralizing (Fig. 4d–f) antibiotic action for one of the two antibiotics. Neutralization was less common than promotion, with neutralization and promotion accounting for 23.1% and 76.9%, respectively, of nonzero \(\triangle \rho\) cases. Resource competition structures strongly affected the prevalence of non-transitivity by promotion or neutralization (Fig. 4g, h). On average across all values of other parameters, promotion was most likely to occur when \({D}_{T1}\) or \({D}_{T2}\) was \( < 0.2\) (Fig. 4g, red), in which case one of the targeted species is a generalist and thus can outcompete the other targeted species to extinction (Fig. 4b, top left). Furthermore, promotion was more likely for intermediate \({D}_{N} \sim 0.4\) such that the non-targeted species could outcompete one of the targeted species during pairwise competition but not the other (Fig. 4b). Conversely, neutralization was most likely to occur when both \({D}_{T1}\) and \({D}_{T2}\) were \( > 0.4\) (Fig. 4g, blue), in which case the targeted species cannot outcompete each other during antibiotics since they are specialists with distinct niches. Instead, extinction occurred because the non-targeted species was a generalist that could outcompete one of the targeted species in pairwise competition (\({D}_{N} \, \lesssim \, 0.3\), Fig. 4h, blue). For both promotion and neutralization, we found that there must be a balance between \({D}_{N}\) and the death rates such that resource competition promotes or neutralizes the action of only one of the antibiotics but not the other (Fig. 4h). In sum, these simulations show that resource competition structures can be prone to non-transitivity under sequential treatment via either promotion or neutralization of antibiotic activity (Fig. 4g, h).

Antagonistic effects on community richness due to antibiotic combinations are more common than synergism

In addition to dosage and scheduling, another common strategy for treating infections is the simultaneous use of multiple antibiotics to avoid the emergence of resistance, which creates the potential for synergistic or antagonistic effects19,33,34. To investigate the extent of interactions among antibiotics in a community context, we considered three species with equal enzyme budgets competing for three resources (Fig. 5a), with symmetry of the community under swapping of the two targeted species (\({D}_{T1}={D}_{T2}\)) and the antibiotics that target them (\({d}_{1}={d}_{2}\)). When either one of the targeted species was individually subjected to a sufficiently large death rate, it was driven extinct (Fig. 5b), as expected. However, when the death rates of both targeted species were increased simultaneously, all species were able to coexist (Fig. 5c). The changes in enzyme budgets due to both antibiotics effectively nullified each other, returning the consumption rate vectors to locations near their original locations in the simplex (Fig. 5c), hence neither of the targeted species gained a competitive advantage over the other. Although the non-targeted species (green) became more of a generalist under the activity of both antibiotics, it was initially sufficiently specialized that the remapped convex hull still included the supplied resource point. Thus, for this community, the combination of antibiotics resulted in antagonism.

Fig. 5: Resource competition can lead to non-additive effects during simultaneous application of two antibiotics, with antagonism more likely than synergism.
figure 5

a A community for which antibiotic targeting leads to antagonism. Before antibiotic treatment, all three species coexisted, as shown by the simplex of the resource consumption rates of three species (colored circles) along with the supply rates of three resources (star) with distances \({D}_{N}\), \({D}_{T1}\), \({D}_{T2}\) as in Fig. 4a, as well as the distance between the two targeted species \({D}_{T}\). b (Top) When the death rate of the orange species in (a) was increased, remapping of the convex hull resulted in extinction of the orange species. (Bottom) When the death rate of the blue species was increased, the blue species similarly went extinct. c When both species in (a) were targeted simultaneously, competition between the targeted species was relieved. (Top) Remapping due to both antibiotics led to only small changes in the consumption rate vectors compared with each antibiotic alone, as compared to unperturbed community in (a). (Bottom) Coexistence of all three species was restored, representing antagonism. d Like (a), but showing a community for which antibiotic targeting led to synergism. e Targeting of the orange (top) or blue (bottom) species in (d) alone preserved coexistence of all three species. f When both species in (d) were targeted simultaneously, the non-targeted species (green) outcompeted the targeted species, representing synergism. g The fraction of synergism (red) and antagonism (blue) for communities of the form in (a) and (d) (i.e., \({D}_{T1}={D}_{T2}\) and \({d}_{1}={d}_{2}\in \left(0,1\right)\)), averaged across all combinations of \({D}_{T2}\), \({D}_{N}\), and \({d}_{2}\). Synergism was more likely for high \({D}_{T1}\) and low \({D}_{N}\), and vice versa for antagonism. h Same as (g) but averaged across all values of \({D}_{T1}\), \({D}_{T2}\), and \({d}_{2}\). i Schematic of communities with consumption rate vectors drawn uniformly from the simplex, both death rates drawn independently from a uniform distribution between 0 and 1, and resources supplied at equal rates. \({D}_{N}\) and \({D}_{T}\) are labeled for a random community. j Of the communities in (i) without symmetry in the consumption rates of the targeted species, a smaller fraction exhibited synergism than antagonism.

Next, we considered a community with larger \({D}_{T1}={D}_{T2}\) and with the non-targeted species (green) more of a generalist than in the example above that exhibited antagonism (Fig. 5d). When one of the species was targeted individually, it became more specialized and the non-targeted species moved toward the consumption niche of the targeted species, but the remapped convex hull still enclosed the supplied resource point, resulting in coexistence of all three species (Fig. 5e). However, when both species were simultaneously targeted, the non-targeted species became more competitive against the targeted species and its remapped consumption rates moved past the supplied resource point, allowing it to drive both targeted species extinct (Fig. 5f). The cumulative effect of targeting both species thus resulted in synergism.

To quantify the prevalence of synergism and antagonism across community structures, we varied the distance between the consumption rates of the two targeted species \({D}_{T}\) by varying \({D}_{T1}={D}_{T2}\), the distance between the non-targeted species and the supplied resource point \({D}_{N}\), and the death rate of both targeted species during antibiotics \({d}_{1}={d}_{2} \in \left({0},{1}\right)\). We varied all three parameters (\({D}_{N},{D}_{T1},{d}_{1}\)) independently and calculated the fraction of communities that exhibited synergism or antagonism as a function of two parameters, averaging over the other parameter. Antagonism occurred most often when the niches of the targeted species were somewhat similar (\({D}_{T} \, \lesssim \, 0.4\)) and the non-targeted species was sufficiently specialized \(({D}_{N} \, \gtrsim \, 0.4)\), and synergism occurred in the opposite regime (Fig. 5g). This behavior is consistent with the example communities discussed above: for antagonism, each targeted species must be driven extinct when targeted alone (\({D}_{T} \, \lesssim \, 0.4\)) and the non-targeted species must not outcompete the two targeted species when both are simultaneously targeted (\({D}_{N} \, \gtrsim \, 0.4\)), and vice versa for synergism. Increasing the death rates of the targeted species commensurately (\({d}_{1}={d}_{2}\)) increased the minimum \({D}_{N}\) required for synergism and antagonism (Fig. 5h), as expected.

To investigate whether these trends generalized, we generated communities with consumption rate vectors sampled uniformly across the simplex without enforcing any symmetry (Fig. 5i), sampled the two death rates independently from a uniform distribution between 0 and 1, and supplied all three resources at equal rates. Similar to the trends observed with symmetry (Fig. 5g, h), communities with smaller \({D}_{N}\) and larger \({D}_{T}\) were more likely to exhibit synergism (Fig. 5j, red) and communities with larger \({D}_{N}\) and smaller \({D}_{T}\) were more likely to exhibit antagonism (Fig. 5j, blue). Moreover, to exhibit synergism, communities with larger \({D}_{N}\) required a larger value of the smaller of the two death rates \({d}_{\min }\) (Supplementary Fig. S4). This condition enables the non-targeted species to outcompete the targeted species, which either requires that the non-targeted species is a generalist that is close to outcompeting the other species before antibiotic perturbation or that the antibiotic perturbation is sufficiently large. Similarly, communities with larger \({d}_{\min }\) required a larger \({D}_{N}\) to exhibit antagonism (Supplementary Fig. S4), generalizing the observation that increasing the death rate of the targeted species in the symmetric scenario in Fig. 5a increased the minimum \({D}_{N}\) required for antagonism (Fig. 5h). These simulations also demonstrated that communities can be prone to synergistic and antagonistic effects due to resource competition alone during antibiotic combinations, but typically not both (Fig. 5g, h, j), and that antagonism is more common (Fig. 5j).

Overlap in mechanisms underlying non-transitivity and non-additivity

Since resource competition structures can be prone to neutralizing or promoting antibiotic action during sequential treatment (non-transitivity, Fig. 4) and to synergism or antagonism during simultaneous treatment (non-additivity, Fig. 5), we wondered to what extent the underlying mechanisms were connected. For communities parametrized by \({D}_{N}\), \({D}_{T1}\), and \({D}_{T2}\), structures prone to neutralization and promotion (Fig. 4h) were approximate subsets of those prone to synergism and antagonism (Fig. 5h), respectively. The same trends generalized to scenarios with randomly drawn structures and death rates (Fig. 5i): Of 1,000,000 communities, non-transitivity due to promotion and neutralization occurred in 104,860 and 6332, respectively, and non-additivity due to antagonism and synergism occurred in 377,979 and 11,460 cases, respectively. Strikingly, 100% of the communities exhibiting non-transitivity due to promotion also exhibited non-additivity due to antagonism, and >97% of the scenarios exhibiting neutralization also exhibited synergism (Table 2). These findings highlight the significant overlap in mechanisms underlying non-additivity and non-transitivity.

Table 2 Cross-occurrences of non-transitivity during antibiotic sequences and non-additivity during antibiotic combinations in 1,000,000 random communities

Non-additivity can be prevalent in larger communities and under metabolic cross-feeding

Microbial communities, particularly those found in a healthy human gut, can contain many coexisting species. To interrogate the response of more diverse communities to growth-inhibitory conditions such as antibiotics, we considered the following simple competition structure. For \(m\) species and \(p=m\) resources, multiple non-targeted species that have symmetrical consumption niches (Supplementary Fig. S5a) can be aggregated into effectively a single non-targeted species (Supplementary Text), suggesting that the findings from our analyses of three-species communities should largely hold if the additional species can be thought of as representing small perturbations away from symmetrical consumption niches. Indeed, simulations analogous to those in Fig. 2d but for \(m=6\) species and \(p=6\) resources demonstrated that average richness often increases during antibiotic perturbation in the presence of a species reservoir even with the larger community size (Supplementary Fig. S5b). Similarly, simulations analogous to those in Fig. 5g, h but for \(m=4\) species and \(p=4\) resources, with the additional species non-targeted, showed that the regimes with non-additivity were largely the same as in three-species communities consisting of the two targeted species and the more generalist of the two non-targeted species (Supplementary Fig. S5c). In other words, the more specialist non-targeted species did not substantially affect the antibiotic response of the community, as expected since generalists are more poised to cause extinction. Since there is significant overlap in the mechanisms underlying non-additivity and non-transitivity, these results suggest that the antibiotic responses observed in three-species communities are likely also prevalent in larger communities.

Microbial communities also often exhibit metabolic cross-feeding26. To incorporate the effects of cross-feeding into our CR model, we assumed that during resource consumption, a fraction of the mass of a resource contributes to growth and the remaining fraction is excreted as metabolic byproducts (leakage31). If all leakage reactions generate a uniform distribution of all supplied resources and the leakage fraction for each resource is the same across species, then the model reduces to our original model without cross-feeding by shifting the resource supply rates (Supplementary Fig. S6a, Supplementary Text). Motivated by this equivalence, simulations analogous to Fig. 5g, h but with low leakage fractions sampled from a uniform distribution between 0 and 0.5 showed that the regimes of non-additivity were largely conserved (Supplementary Fig. S6b), indicating that our findings can be applied to communities with at least some degree of cross-feeding.

Discussion

The ability to predict microbial community dynamics after antibiotic treatment would be a powerful tool for minimizing unintended consequences of treatment. Motivated by growing evidence that resource competition plays a dominant role in shaping microbial community dynamics both without and during antibiotic perturbation, we introduced species-specific death rates to a CR model and analyzed community responses across a wide range of antibiotic treatment strategies. We found that increasing antibiotic intensity can lead to non-monotonic richness changes in the presence of a re-seeding reservoir due to changes in the competitive landscape (Fig. 3), and that the final community can differ qualitatively when the sequence of antibiotic application is reversed (Fig. 4). Furthermore, we quantified properties of resource competition landscapes that give rise to antibiotic synergism or antagonism (Fig. 5), suggesting that the effects of antibiotic perturbation are generally dependent on the metabolic properties of the exposed community. Intriguingly, we find that antagonism emerges in communities with symmetry between the consumption rates of the two targeted species when the non-targeted species is sufficiently specialized (Fig. 5a); this scenario mimics the origins of antagonism in the context of a single species, wherein simultaneous targeting of two distinct cellular processes mitigates the defects due to targeting of only one of the processes19. Our findings reveal a wide range of phenomena explainable by resource competition alone, warranting caution when interpreting phenomena that might otherwise be attributed to chemical transformations of antibiotics or other biological mechanisms.

To predict microbial community dynamics in response to antibiotic cocktails and treatment scheduling strategies35, we analyzed two key building-block scenarios: the swapping of application order of two antibiotics that each target a single species (whether a commensal or a pathogen) and the simultaneous application of two single species-targeting antibiotics. Understanding these minimal scenarios is the first step in predicting community dynamics in more complex scenarios. For example, although our study focused on scenarios in which death rates vary independently for each targeted species, we can straightforwardly apply our model predictions to scenarios in which death rates change in a correlated manner across multiple species (as would be the case for a broad-spectrum antibiotic) by extending our analysis of additivity to multiple targeted species.

Importantly, our model makes several simplifying assumptions that should be relaxed in future work. For example, nutrient supply in natural contexts is typically dynamic, which can result in fundamentally different community responses36. In addition, it will be important to understand the effects of species-specific death rates in CR models that result in multistability37. Networks involving strong dependence on cross-feeding can produce edge cases in which the coexistence of a species relies exclusively on the resources generated by other species, thereby affecting transitivity and additivity. Similarly, interplay between antibiotic activity and other interspecies interactions such as toxin-mediated killing could also lead to complex interdependencies. Nonetheless, our ability to extend our results to larger communities (Supplementary Fig. S5) and to communities with low levels of cross-feeding (Supplementary Fig. S6) exemplify how our modeling framework has broad applicability to the interplay between antibiotic activity and microbial interactions.

Our analyses can be broadly applied to understand the effects of growth inhibition, including in soil communities, which produce numerous antimicrobials38, and wastewater communities, which can contain a wide spectrum of antibiotics resulting from human treatment39. By allowing death rates to be both species-specific and dependent on the presence of other species, our framework could be extended to scenarios in which antibiotics are produced or modified by community members. Moreover, the deleterious effects of diverse bacteriophages on their bacterial host communities are not fully understood40,41, and are likely to be similarly linked to resource competition as we have shown here. Even changes in environmental parameters like temperature42, osmolarity43, or pH44 affect growth rate and hence rescale consumption rates in species-dependent manners. In vitro measurements of the sensitivities of each community member to such parameters could be combined with parameterization of the competitive landscape25 to enable quantitative prediction of community responses. In sum, our findings provide basic intuition for community-dependent antibiotic responses arising from resource competition, with broad implications for interpreting screens of drug-microbiome interactions and predicting community responses to perturbations.

Methods

Simulations of population dynamics

We simulated species abundances over time in Python using the SciPy function scipy.integrate.solve_ivp, an explicit Runge-Kutta method for solving ordinary differential equations. We integrated all species abundances \({n}_{i}\) until they reached steady state, defined as when all species either satisfy \(\left|\frac{{d}^{2}}{{{dt}}^{2}}{{{{{\rm{ln}}}}}}({n}_{i})\right| < {10}^{-6}\) or \({n}_{i}\) decreases below a threshold abundance \({10}^{-7}\) (signifying extinction and removal from the community). To calculate richness, we counted the number of species that satisfied the conditions \({n}_{i} \, > \, {10}^{-7}\) and \(\frac{d}{{dt}}{{{{{\rm{ln}}}}}}({n}_{i}) > -{10}^{-3}\) at steady state. For three species and three resources, the steady-state abundances of the three species can be directly calculated using a straightforward algorithm (Supplementary Text). We initialized simulations with all species present at equal abundances. In the mathematical model we considered, steady-state species abundances are independent of the initial species abundances, assuming all species are initially present (i.e., at non-zero abundance)29. Since our analyses focused exclusively on steady-state species abundances and for scenarios in which all species coexist without antibiotics, our choice to initialize simulations with all species present at equal abundances does not affect any of our results.

Dimensionless parameters

For simulating population dynamics, we introduced dimensionless parameters for time \({t}^{{\prime} }\equiv {td}\), for species abundance \({n}_{i}^{{\prime} }\equiv {n}_{i}\left(d/S\right)\), for resource consumption rate \({R}_{i\mu }^{{\prime} }\equiv {R}_{i\mu }(S/{d}^{2})\), for death rate \({\left(d+{d}_{i}\right)}^{{\prime} }\equiv \left(d+{d}_{i}\right)/d\), and for resource supply rate \({s}_{\mu }^{{\prime} }\equiv {s}_{\mu }/S\). We can write Eq. 3 in terms of these dimensionless parameters as follows:

$$\frac{d{n}_{i}^{{\prime} }}{d{t}^{{\prime} }}={n}_{i}^{{\prime} }\left(\mathop{\sum }\limits_{\mu=1}^{p}\frac{{R}_{i\mu }^{{\prime} }{s}_{\mu }^{{\prime} }}{{\sum }_{k=1}^{m}{n}_{k}^{{\prime} }{R}_{k\mu }^{{\prime} }}-\left(1+{d}_{i}^{{\prime} }\right)\right),$$

where \({s}_{\mu }^{{\prime} }\) is the relative supply rate of resource \(\mu\) such that \({\sum }_{\mu=1}^{p}{s}_{\mu }^{{\prime} }=1\).

Simulations of randomly drawn communities

Unless stated otherwise, we selected \({\vec{R}}_{i}\), \(\vec{d}\) from a uniform distribution on the unit simplex, i.e., from the space of \(m\)-dimensional vectors such that the sum of the elements is 1. We chose \(\vec{s}\) such that all resources were supplied at equal rates.

Statistics and reproducibility

This study is a theoretical investigation using mathematical models and numerical simulations. Results involving random sampling were obtained from >100,000 samples, which was well above the size required for convergence. No statistical method was used to predetermine sample size. No data were excluded from the analyses. The experiments were not randomized. The investigators were not blinded to allocation during experiments and outcome assessment.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.