Introduction

Microbial communities living in similar environments often display different community types, each characterized by a unique composition of species1-4. Changes in environmental factors, fluctuations of species abundances, or transient invasions can trigger abrupt and irreversible transitions between two types5-7. Such transitions, also known as regime shifts, lead to the dramatic alterations of microbiome functions and are tightly associated with host diseases, soil fertility, marine biogeochemical flux, or bioproduction yield8-12. Understanding the origin of different community types has broad implications in environments, engineering and health1,3.

Multistability, a phenomenon where multiple stable states coexist for the same set of system parameters, is one of the most important mechanisms behind alternative community types and has been widely observed in a variety of natural or experimental microbiomes1,4,7,13-17. Under perturbations, a multistable system can be driven away from a former stable state, cross the tipping point and reach a new steady state. The population can persist in the new state even after the perturbations are withdrawn, exhibiting a behavior of ‘hysteresis’3,13. Despite its conceptual importance, the determinants underlying microbiota multistability have been poorly understood due to the intrinsic complexity of microbial interactions14.

Understanding the origin and the underlying determinants of multistability in complex microbiota is an important challenge in microbial ecology and evolution. In host-associated microbiota, regime shifts between alternative stable states can trigger the critical transitions between healthy microbiome and dysbiosis8,18. Unravelling how different biological processes drive community multistability is important for the predictive control of complex microbiota, and can inspire novel treatments to modulate the communities towards the desired stable states or away from the unhealthy states.

Mathematical models are indispensable to decipher the emergent properties of complex populations19. Different ecological models have been developed to analyze the origin of multistability in microbial communities. For instance, based on the generalized Lotka-Volterra (LV) model, Gonze D et al. showed that multistability could emerge in communities where different species mutually inhibited each other1. Dubinkina V et al. applied a consumer-resource model in which microbes competed for different metabolites, and showed that multistability required microbial species to have different stoichiometries of essential nutrients14. These works provide critical insights on the determinants of community multistability, yet the roles of many other mechanisms remain to be understood. Chief among these is horizontal gene transfer (HGT), a process where microbes share mobile genetic elements (MGEs) with their neighbors20.

Indeed, HGT is prevalent in microbial world and mobile genes occupy a substantial proportion in microbial gene pool21-23. For instance, among the closely related microbial isolates in the same human body site, HGT occurs in more than 40% of the species pairs24. In the draft genomes of human gut microbes, tens of thousands of genes were mobilizable22. Depending on the encoded traits, MGEs shape microbial growth rates, host adaptability and even social interactions between microbes25. The dynamic gain and loss of MGEs are also a major source of evolutionary innovations of prokaryotic genomes26. However, despite its functional and ecological importance, the interplay between genetic exchange and community multistability has not been rigorously examined in previous studies and a general conclusion remains lacking.

In this work, we focus on communities of competing microbes, a model system for microbiome multistability1,14,27. By combining mathematical modelling and numerical simulations, we demonstrated that the horizontal transfer of plasmids, a major type of MGEs, could promote the emergence of alternative stable states which otherwise would not exist. We further extended our analysis to scenarios where HGT changed interspecies interactions, where microbial communities were subjected to strong environmental selections and where microbes lived in metacommunities consisting of multiple local habitats. We also analyzed the role of different mechanisms, including interspecies interaction strength, the growth rate effects of MGEs, MGE epistasis and microbial death rates in shaping the multistability of microbial communities. These results created a comprehensive framework to understand how different dynamic processes, including but not limited to HGT rates, collectively shaped community multistability and diversity. Our results provide valuable insights for microbial ecology, health and microbiome engineering.

Results

The role of HGT on bistability of two-species populations

To illustrate the basic concepts, let’s first consider a population of two competing species. Without HGT, the community dynamics can be captured by the classic LV model that accounts for species growth rates (µ1 and µ2), interspecies interaction strengths (γ1 and γ2) and the dilution or death rate (D). When all the parameters are given, one can simulate the system dynamics from the initial abundances of the two species. The system will reach an equilibrium, characterized by the steady-state abundances of the two species. Bistability means the coexistence of two distinct stable states (Fig. 1a)1,14. Depending on the initial abundances, either one of the two species can dominate the community. With bistability, even when the model parameters are not altered, a change in initial species abundances is sufficient to drive the system to a different stable state (Fig. 1a). In contrast, if monostable, the population will always rest at the same steady state regardless of the initial composition (Fig. 1a). Given the simplicity of this model, the condition of the system being bistable can be analytically solved as γ1 >ϕ2/ϕ1 and γ2 >ϕ1/ϕ2 where ϕ and (see Methods for more details). This condition predicted the thresholds on the strengths of interspecies interactions in order for the system to be bistable.

Horizontal gene transfer (HGT) promotes bistability of communities consisting of two competing microbes.

(a) Schematics of monostable and bistable systems. A monostable system will always rest at the same steady state no matter where the system starts from. In contrast, a bistable system can reach two distinct steady states, depending on the initial ratio between the two competitors. The right panel is a diagram depicting how a microbial community responds to changes on initial species abundances. The red marble stands for the system state, which will always roll “downhill” on the landscape towards stable states at the low points. The x axis represents the community composition and the valleys in the landscape are the stable states (or equilibrium points) when the community composition will stop changing. Depending on parameter values, the landscape can have one valley (called “monostable”) or two valleys (called “bistable”). When the system is bistable, the marble can reach either valley, depending on where it starts.

(b) The phase diagram of the population with (bottom panel, η = 0.2 hr−1) or without HGT (top panel). Different combinations of µ1 and µ2 between 0 and 1 hr−1 were tested. For each combination, the initial abundance of each species was randomized 200 times between 0 and 1 following uniform distributions. The system was monostable if all initializations led to the same steady state. Otherwise, the system was bistable. All combinations of µ1 and µ2 resulting in bistability were marked in blue in the diagram. Other parameters are γ = 1.1, κ = 0.005 hr−1,D = 0.2 hr−1,. Two states, P (µ1 = 0.3 hr−1, µ2 = 0.8 hr−1) and Q (µ1 = 0.4 hr−1, µ2 = 0.6 hr−1), were labeled as examples.

(c-d) Population dynamics of P and Q under 100 different initializations. Here, the dynamic changes of species 1’s abundance were shown. Three different HGT rates (0, 0.1, 0.2 hr−1 from top to bottom) were tested. When gene transfer rate increases, the system at Q changed from monostable to bistable, while the system at P remained monostable.

To analyze the effect of HGT on bistability, we applied a mathematical model that we previously developed to describe the conjugative transfer of plasmids between competing species28. While in classic LV model µ1 and µ2 are constants, our model dissected species growth rates into two components: the basal growth rates ( and ) determined by chromosomal genes, and the growth rate effects (λ1 and λ2) of plasmids. The two components were assumed to combine multiplicatively: . HGT creates subpopulations (denoted as p1 and p2) within each species that acquire the mobilizable genes from its competitor. The dynamics of p1 and p2 were governed by cell growth, plasmid transfer (the rate denoted as η) and plasmid loss (the rate denoted as κ). The gain and loss of p1 and p2 in turn lead to the temporal change of the effective growth rates ( and ) of each species: , (see Methods for more details). Therefore, plasmid transfer allows the two competitors to partially exchange their growth benefits or disadvantages. Here, we assumed that the species internal inhibition was independent of the acquired MGEs. We sought to understand whether the process of HGT would reshape the stability landscape of the system.

After HGT being introduced, analytical solution becomes infeasible due to the increase of modeling complexity. Instead, we determined whether the system was bistable by numerical simulations with randomized initial compositions27. In general, the resolution of this approach increases with the number of randomizations. Without loss of generality, here we randomly initialized the species abundances for 200 times between 0 and 1 following uniform distributions (Fig. S1a). Then we simulated the population dynamics for each initialization until steady state and obtained their species abundances. A system is called monostable if all populations starting from different compositions converge into the same state. In contrast, if two attractors exist, the system is called bistable (Fig. 1a). We calculated the number of stable states for a wide range of µ1 and µ2 values and drew the phase diagram (Fig. 1b). Whether it is easy for the system to achieve bistability is reflected by the total area of bistability region on the phase diagram. Our numerical results suggested that increasing HGT enlarged the region, creating bistability in many systems which would otherwise be monostable (Fig. 1b-d). Here, the number of initializations was not critical for the conclusion (Fig. S1a). The results were not fundamentally changed when the interspecies interaction strengths or gene transfer rates were altered (Fig. S1b-d), suggesting the robustness of our conclusion.

Our results suggested that increasing HGT made it more feasible for the system to become bistable. However, this should not be taken as an assertion that the system will always be bistable when HGT exists (Fig. 1c and d). For two species with large growth rate difference, the system might remain monostable when gene transfer rate increases (Fig. 1c). In this case, the strong competitor will always win despite the gene flow. The effect of HGT in promoting bistability is more applicable between species with smaller growth rate difference (Fig. 1b and d).

Previous studies showed that the cell death rate determines the bistability of two interacting species29. To evaluate the impact of death rate D on the interplay between HGT and system bistability, we performed additional analysis by calculating the bistability probability under different D values (Fig. S2). Our results suggested that varying death rate indeed changed the bistability of the system. When the death rate equaled zero, mobile genetic elements that only modified growth rates would have no effects on population bistability. These results highlighted the importance of added death rate in driving multistability.

The strength of interspecies interaction also shaped the community bistability. By calculating the bistability probability under different values of γ (Fig. S3), we showed that while changing γ didn’t fundamentally alter our conclusion, the influence of HGT on population bistability became weak when interspecies interaction strength got smaller than 1. These results suggested that the role of HGT was more significant in population with strong competitions.

HGT shapes the stability landscape of multi-species communities

The modeling framework can be readily generalized to more complex communities consisting of multiple competing species by taking into account the gene transfer between every pair of species. Consider a community of m species. Let si be the abundance of the i-th species. γij represents the interspecies interaction strength that the i-th species imposes on the j-th species (i, j = 1,2, …, m). ηjki is the transfer rate of the sj -originated plasmid from species k to species i. κij is the loss rate of the j-th mobile genetic element in the i-th species. The growth rate effect of the j-th plasmid on the i-th species is denoted as λij. pij describes the abundance of the subpopulation in the i-th species that carries the plasmid from the j-th species. The effective growth rate of the i-th species can be calculated based on all the plasmids that it carries: . The population dynamics can then be simulated by m + m2 equations that describe the temporal change of si and pij, respectively (see Methods for more details).

To understand how changing gene transfer rate affects the stability landscape of complex microbiota, we estimated the number of alternative stable states by randomly initializing the abundance of each species 500 times between 0 and 1 following uniform distributions. For each initialization, we simulated the population dynamics for 2000 hours till the systems reached equilibrium and calculated the steady-state abundances of different species (Fig. S4). Limit cycles were not observed in our simulations (Fig. S5).

The calculate the absolute number of stable states, we grouped the steady states into different attractors using a given threshold. Steady states with their Euclidean distances smaller than the threshold belonged to the same group (Fig. S6). However, the estimation of this number can be biased by the intrinsic limitations of the numerical approach. For instance, the limited number of initializations can underestimate this number. In contrast, the inability of a system to reach equilibrium within the limited time window of simulations can cause its overestimation. To overcome such limitations, we developed an alternative metric χ to measure the multistability of a system by borrowing the concept of ‘entropy’. Let φ be the number of stable states and xi be the relative size of each domain of attraction (∑i xi = 1, i = 1,2, …, φ). χ is calculated as χ = exp (− ∑i xi logxi), which accounts for the absolute number of stable states as well as the size of each basin. χ equals 1 in monostable systems. χ gets larger when more stable states emerge or the distribution of the basin sizes become more even. Numerical tests suggested that χ was robust to the variations of distance threshold, simulation timespan or number of initializations (Fig. S7).

As shown in Fig. 2, when HGT is absent, the number of stable states was usually small in a multi-species population. Increasing gene transfer rate reshaped the stability landscape of a microbiome by creating additional stable states (Fig. 2a and b). Each stable state is characterized by a different dominant species (Fig. 2a). The number of stable states is positively associated with HGT rate (Fig. 2c, Fig. S8 and S9). This prediction is generally applicable to communities consisting of different number of species (Fig. S8 and S9). For communities of two species, bistability is not possible when γij’s are smaller than 1. However, for communities of multiple species, multistability becomes possible even if all γij values are smaller than 1 (Fig. S10). The effects of HGT on multistability held for different strengths of interspecies interactions (Fig. S10). Initializing the pij subpopulations with non-zero abundances didn’t change the conclusion, either (Fig. S11).

The number of alternative stable states in multi-species communities increases with HGT rate.

(a), A schematic of the stability landscape of a population composed of multiple competing species with or without HGT. Each alternative stable state is characterized by a different dominant species (shown in filled circles).

(b), The emergence of alternative stable states in a five-species community with gene transfer. We simulated the dynamics of 500 parallel communities, each with the same kinetic parameters but different initial compositions. The species compositions of these communities at three different timepoints were shown by principal component analysis from left to right. Without HGT (η = 0), all populations converged into a single stable state. In contrast, with HGT (η = 0.2 hr-”), four different attractors appear. Here, populations reaching different stable states were marked with different colors. Other parameters are , µ1 = 0.52 hr−1, µ2 = 0.48 hr−1, µ3 = 0.44 hr−1, µ4 = 0.60 hr−1, µ5 = 0.31 hr−1, γ = 1.05, κ = 0.005 hr−1, D = 0.2 hr−1.

(c), The number of stable states (top panel) and the multistability coefficient χ increase with HGT rate in communities consisting of 8 competing species. We calculated the number of stable states by randomly initializing the species abundances 500 times between 0 and 1 following uniform distributions. Then we simulated the steady states and clustered them into different attractors by applying a threshold of 0.05 on their Euclidean distances. The data were presented as mean ± standard deviation of 10 replicates. Each replicate corresponded to a different combination of randomized species growth rates.

Here we assumed the interactions among different species were homogeneous. To evaluate whether this assumption was critical, we extended our analysis by considering heterogenous interaction strengths in multispecies communities (Fig. S12). In particular, we randomly sampled γij values from uniform distributions. Our results suggested the mean value and variance of γij played a role in shaping multistability. The effects of HGT on community multistability becomes stronger when the mean value of γij gets larger than 1 and the variance of γij is small (Fig. S12). Nevertheless, the heterogeneous distribution of γij didn’t fundamentally change our conclusion.

MGEs can drive large growth rate differences when they encode adaptative traits like antibiotic resistance. In many cases, however, the growth rate effects of MGEs can be small. To evaluate the influence of λij magnitude, we also analyzed different ranges of growth rates effects of mobile genetic elements, by sampling λij values from uniform distributions with given widths (Fig. S13). Greater width led to larger magnitude of growth rate effects. We used five-species populations as an example and tested different ranges. Our results suggested that multistability was more feasible when the growth rate effects of MGEs were small (Fig. S13b). The qualitative relationship between HGT and community was not dependent on the range of growth rate effects (Fig. S13a).

So far, our analysis has been focused on communities where the interaction network is fully connected, and each species competes with every other member. In each of such populations, it is highly infeasible to achieve the stable coexistence of different species. While this analysis provides the basic proof of principle, natural environments often consist of many niches30. Species living in the same niche competes while species from different niches can coexist (Fig. S14a). To understand whether our conclusion is still applicable when niche effects are considered, we extended our analysis to communities carrying a random number of niches. Each species was randomly allocated into one of the niches, and the stability landscape was analyzed in the same way by randomly initializing the systems (see Methods for more details). Our results suggested that increasing HGT rate still promoted multistability, regardless of the niche structure of the competing communities (Fig. S14b-d).

The role of HGT on community multistability when mobile genes modify interspecies interactions

Our previous analysis has focused on the role of HGT in communities where MGEs only affect species growth rates and have no influences on interspecies interactions. To evaluate how this modeling structure and the underlying assumptions affected the prediction, we extended our framework by accounting for the modifications of interspecies interactions by mobile genes.

In nature, the horizontal transfer of some genes can change the interspecies interaction strengths between different species. For instance, the sharing of many mobile genes can promote niche overlapping, leading to an increase of competition strength31,32. To understand how the transfer of these genes would influence community multistability, we adapted the previous model by considering the dynamic change of competition strength during HGT (see Supplementary Materials for more details). For two-species populations, we divided the interspecies interactions into two components: the basal competition strengths (γ1 and γ2) and the added parts by HGT (δ1 and δ2). The overall competition strength was calculated as and , respectively. Positive δ’s mean HGT promotes the inter-species competition, while negative δ’s mean HGT reduces the strength of interspecies competition (Fig. 3a-b). Numerical simulations with randomized parameters suggested that when δ was positive, HGT still promoted the bistability, whereas if δ was negative, gene transfer would reduce the chance of bistability (Fig. 3c-d). We further extended our analysis to multispecies communities and calculated the number of stable states. As shown in Fig. 3e and f, the number of stable states increases with HGT rate when MGEs promotes competition, while decreases with HGT rate when MGEs reduces competition.

The effects of HGT on population multistability when MGEs promote or reduce the strength of interspecies competition.

(a-b), The schematics of HGT promoting or reducing competition.

(c), For populations of two species, when MGEs promote competition, increasing HGT rate enlarges the area of bistability region in the phase diagram. Here, δ describes the effect of mobile genes on the competition strength. Positive δ represents HGT promoting competition. In numerical simulations, we tested three different δ values (marked in different colors). When calculating the area of bistability region, we randomized µ1 and µ2 500 times between 0 and 1 hr-1 following uniform distributions while keeping and constants. For each pair of growth rates, we randomized the initial abundance of each species 200 times between 0 and 1 following uniform distributions. The system was monostable if all initializations led to the same steady state. Otherwise, the system was bistable. Then we calculated the fraction of growth rate combinations that generated bistability out of the 500 random combinations. Other parameters are γ1 = γ2 = 1.1, κ = 0.005 h−1, D = 0.2 h−1.

(d), When MGEs reduce competition, the area of bistability region decreases with HGT rate. Three negative values δ were tested and shown as examples here.

(e), For populations of 5 species, when MGEs promote competition, the number of stable states increases with HGT rate. We calculated the number of stable states by randomly initializing the species abundances 500 times. Then we simulated the steady states and clustered them into different attractors by applying a threshold of 0.05 on their Euclidean distances. The data were presented as mean ± standard deviation of 10 replicates. Each replicate corresponds to a different combination of randomized species growth rates. Other parameters are γij = 1.1, κ = 0.005 h−1, D = 0.2 h−1, δ = 0.5.

(f), When MGEs reduce competition, the number of stable states decrease with HGT rate. The data were presented as mean ± standard deviation of 10 replicates. δ = −0.5 was used in the simulation.

(g), For populations of two species without HGT, reducing the magnitude of λ (promoting ecological neutrality) enlarges the area of bistability. When gene transfer rate equals zero, changing δ does not influence bistability. When calculating bistability probability, we randomized λ1 and λ2 500 times between −α and α following uniform distributions. α represents the magnitude of λ variations. µ1 and µ2 were calculated as and , respectively. The overall competition strength was calculated as and . We tested different combinations of α (the magnitude of λ variations) and δ values. We then calculated the fraction (f0) of growth rate combinations that generated bistability out of the 500 random combinations. Other parameters are γ1 = γ2 = 1.1, κ = 0.005 h−1, D = 0.2 h−1.

(h), In populations of two species with HGT, reducing the magnitude of λ (promoting ecological neutrality) or promoting δ value enlarges the area of bistability (f1). η being 0.4 was tested as an example here.

(i), The effect of HGT on community bistability depends on how mobile genes modify growth rates and competition. Compared with the population without HGT, gene transfer promotes bistability when δ is zero or positive, while reduces bistability when δ is largely negative.

These results suggested that the effects of HGT on bistability depended on how mobile genes shaped species growth rates and competitions. To place these two factors in a comprehensive framework, we further generalized the model structure, by accounting for the scenario where mobile genes modified growth rates and competitions at the same time. The effect of mobile genes on growth rates was represented by the magnitude of λ’s, and the influence on competition is described by the parameter δ (Fig. 3g to i). By varying these two parameters, we can evaluate how the model structure and the underlying assumptions affected the baseline expectation. We performed additional simulations with broad ranges of λ and δ values. In particular, we analyzed whether HGT would promote the likelihood of bistability in two-species communities compared with the scenario without gene transfer. Our results suggested that: (1) With or without HGT, reducing λ (increasing ecological neutrality) promoted bistability (Fig. 3g and h); (2) With HGT, increasing δ promoted bistability (Fig. 3h); (2) Compared with the population without HGT, gene transfer promoted bistability when δ was zero or positive, while reduces bistability when δ was largely negative (Fig. 3i). These results suggested that the interplay among HGT, species growth and interactions added new insights into the fundamental question of how microbes competing for a limited number of resources stably coexisted.

The role of HGT on community multistability when MGE epitasis effects are present

In previous analysis, we also assumed that the effects of MGEs on host growth (λ1 and λ2) were independent of the host species. In nature, however, the same MGE can have different growth rate effects in different genomic backgrounds, a phenomenon called epistasis33-36. There are two types of epistasis: magnitude epistasis, where the host genomic background only affects the magnitude but not the sign of λ value, and sign epistasis, where the same MGE is burdensome in one species while beneficial in the other host. The model can be readily extended to account for these two types of epistasis (see Supplementary Materials for more details). In particular, we dissected the growth rates µ1 and µ2 into two components: the basal growth rate ( and ), and the growth rate effects (λ11 and λ12) of the mobile genetic elements. The growth rates of p1 and p2 were calculated as µ1(1 + λ12) and µ2(1 + λ21), respectively. Here λij (i, j = 1,2) stands for the growth rate effects of the j-th mobile genetic element in the i-th species. Without epistasis, the growth rate effects are independent of the host species (λ11 = λ21 and λ22 = λ12). The epistasis can be quantified by two ratios: ξ1 = λ21/λ11 and ξ2 = λ12/λ22. ξ1 >0 and ξ2 >0 represent magnitude epistasis, whereas ξ1 < 0 or ξ2 < 0 represent the sign epistasis. We carried out additional numerical simulations to evaluate how different epistasis types influenced the role of HGT in community stability. Our results suggested that with magnitude epistasis, HGT still enlarged the area of bistability region (Fig. 4a and b). In contrast, sign epistasis overturned HGT’s role on community stability: with sign epistasis, increasing gene transfer rate reduced the area of bistability region (Fig. 4c and d). These results suggest that MGE epistasis might add another layer of complexities into the interplay between HGT and community stability.

The influence of epistasis on the role of HGT in mediating population bistability.

(a-b) With magnitude epistasis, increasing HGT rate still promotes bistability in populations of two competing species.

(c-d) With sign epistasis, increasing HGT rate reduces the area of bistability region. For each type of epistasis, we considered two scenarios. In a and c, host genetic background influences the growth rate effect of only one MGE, while in b and d, host genetic background influences both MGEs. ξ1 and ξ2 are defined as λ21/λ11 and λ12/λ22, respectively. ξ1 >0 and ξ2 >0 represent magnitude epistasis, while ξ1 < 0 or ξ2 < 0 represents the sign epistasis. Other parameters are γ1 = γ2 = 1.1, κ = 0.005 h−1, D = 0.2 h−1.

Interplay between HGT and the multistability of communities under strong selections

The growth rate effect of an MGE can be extreme in some cases. For instance, under strong antibiotic selection, only cells carrying the antibiotic resistance genes (ARGs) can survive. To examine whether our conclusion is still applicable in this scenario, we generalized our model by considering the transfer of an MGE in a population under strong environmental selection (see Supplementary Materials for more details). Specifically, we assumed that the MGE was initially carried by one species in the populations. Without HGT, only the donor species carrying the MGE can survive due to selection (Fig. 5a). In this case, the system will always be monostable regardless of the initial species compositions. With HGT, the MGE can be transferred to other species, creating chances for other species to survive (Fig. 5b). To understand how HGT would affect community stability under this condition, we first analyzed the phase diagram of the two-species population. Our simulation results suggested that bistability became possible when there existed gene transfer and increasing HGT rate in general enlarged the bistability area (Fig. 5c and d). Here, without loss of generality we assumed that the MGE was initially carried only by species 1.

HGT creates chances of multistability for communities under strong environmental selection.

(a-b), The schematics of communities under strong selection. Without HGT, only the donor species carrying the MGE can survive. HGT allows the other species to acquire MGE from the donor, creating opportunities for the other species to survive under strong selections.

(c), The phase diagram of two-species populations transferring an MGE. Different combinations of µ1 and µ2 between 0 and 1 hr−1 were tested. All combinations of µ1 and µ2 that led to bistability were marked in blue in the diagram. Other parameters are γ = 1.1, κ = 0.005 hr−1, D = 0.2 hr−1, . Here, we assumed that the ARG was initially carried only by species 1. Bistability was more feasible when µ2 >µ1.

(d), Increasing HGT rate enlarges the area of bistability region in the phase diagram of two competing species transferring an MGE. Three different competition strengths were tested (marked in different colors).

(e-f), For communities of 5 or 8 species under strong selection, increasing HGT rate promotes the emergence of alternative stable states. We calculated the number of stable states by randomly initializing the species abundances 500 times. Then we simulated the steady states and clustered them into different attractors. The carriage of the mobile gene changed the species growth rate from 0 to a positive value µi. When calculating the number of stable states in multi-species communities, we randomly drew the µi values from a uniform distribution between 0.3 and 0.7 hr−1. The data were presented as mean ± standard deviation of 10 replicates. Each replicate corresponds to a different combination of randomized species growth rates. Other parameters are γi,j = 1.5, κ = 0.005 h−1, D = 0.2 h−1.

Bistability was more feasible when µ2 >µ1 (Fig. 5c), suggesting that the effect of HGT on promoting bistability would be stronger when the weak competitor acted as the MGE donor. We further analyzed the number of stable states in multispecies communities. As shown in Fig. 5e and f, for these populations under antibiotic selection, increasing transfer rate of the MGE also promoted the emergence of multistability. This conclusion equally held under different interaction strengths or growth rate ranges (Fig. S15), suggesting the general applicability of HGT’s role in promoting multistability for communities under strong selection.

HGT-enabled multistability promotes the regional coexistence of competing species

Our results highlight the role of HGT on shaping the stability landscape of closed local communities. Natural microbiomes, however, exist at scales broader than a localized population. A set of local communities in similar environments, also known as ‘patches’, form a metacommunity37,38. When multiple stable states coexist, the species compositions of different patches may differ from each other due to the variability of their initial configurations. Collectively, the multistability in the local patches might give rise to the regional species diversity in the metacommunity. This intuition leads to our hypothesis that HGT allows the stable coexistence of multiple competing species at regional scale, even when species exclusively outcompete each other in every local population.

To examine this hypothesis, we constructed metacommunities of 100 patches connected by dispersal of microbes. Without loss of generality, we considered a 2-D array of local patches and assumed that the dispersal only occurred between adjacent patches (Fig. S16a, see Methods for more details). Each local patch carried 10 competing species that exchanged mobile gene elements with each other. The dynamics of each patch was governed by the same set of parameters but initialized with different species compositions. We then numerically simulated the dynamics of the metacommunity till it reached the steady state.

Without HGT, the metacommunity exhibited strong spatial homogeneity at regional scale (Fig. S16b). Different patches rested at similar species compositions. In contrast, HGT created a spatial pattern of species distributions across different patches, due to the emergent multistability (Fig. S16b). To analyze the influence of HGT on regional diversity, we pooled all local populations together and calculated the collective species diversity in the pool using Shannon index. Our results suggested that while local diversity remained low regardless of HGT rate, the regional diversity of microbial species increased with HGT rate (Fig. S16b and c). The conclusion is applicable for different dispersal rates (Figs. S17 and S18). These results highlight the fundamental role of HGT in community stability and diversity at local and regional scale.

Discussion

Our work predicts that in many scenarios horizontal gene flow promotes multistability in communities of competing microbes. At the scale of local populations, the emergence of alternative stable states undermines the global stability of the community, making the system less resilient to perturbations and creating greater opportunities for regime shifts. In metacommunities, gene flow creates spatial heterogeneity of species compositions in different patches. Despite the low diversity in every local patch, HGT-driven multistability creates substantial diversity at regional scale. In microbial ecology, how microbes competing for a limited number of resources stably coexist has been a long-standing puzzle39,40. Our results highlight the importance of considering gene exchange when addressing this fundamental challenge.

While this work predicts the potential role of HGT in microbiota diversity and stability, several caveats need to be considered when applying this prediction. For MGEs with sign epistasis, or MGEs that relax interspecies competitions, HGT might reduce the number of stable states. The relative importance of gene flow in a real community might also be context dependent. The effect of HGT in promoting multistability might be stronger between species with intense competition (Fig. S3) and similar growth rates (Fig. S13). The relative importance of HGT in real environment is also dependent on the maximum carrying capacity of the population. Simulations by scanning the η value from 10−7 to 1 suggested that increasing HGT rates started to promote multistability when η value exceeded 10−2 per hour (Fig. S9). This corresponds to a conjugation efficiency of 10−11 cell−1 · hr−1 · mL when the maximum carrying capacity equals 109 cells · mL−1, or a conjugation efficiency of 10−14 cell−1 · hr−1· mL when the maximum carrying capacity equals 1012 cells · mL−1. Therefore, in environments with high cell density and abundant MGEs, such as mammal gut, the role of HGT will be more prominent41. In contrast, the influence of HGT on community multistability might become less important in populations with poor cell density and slow gene transfer.

Our work provided a comprehensive framework to explore how different parameters, including but not limited to HGT rates, collectively shaped community multistability. For instance, our simulations suggested that nonzero cell death or dilution rate was essential for the bistability of two competing species. Promoting competition strength in general enlarged multistability region. Besides, multistability was also dependent on community neutrality, i.e. the growth rate similarities among different competitors. Multistability is more feasible for communities with high neutrality. Which mechanisms contribute most to the multistability of a given community might be context-specific, depending on the values of different parameters in the population.

Our model allowed multiple plasmids to infect a single cell, but ignored the ecological interactions between different plasmids. These complex interactions are governed by many different processes: from systems that exclude the entry of other plasmids, incompatibility system that eliminates within-cell coexistence, to interference in the regulation of plasmid copy number42,43. These interactions can further change the distribution of plasmids among different species, alter the structure of gene transfer network, and reshape the stability landscape of a microbial community. However, the general conclusion regarding how these interactions shape population multistability remains to be established in future studies.

Previous studies documented the presence of multiple alternative community types in soil15, human vaginal, gut and oral microbiomes2,44,45. In particular, multiple groups of bacteria in human gut exhibit robust bistable abundance distributions, resulting in over 32 different stable state combinations46. Our results provide a plausible explanation for the large number of community types in these populations, even though our interpretation doesn’t exclude other mechanisms including gradients of environmental factors1. Disentangling the contributions of HGT from the other factors in diverse natural microbiomes is a promising topic for future research.

Controlling the multistability of complex microbiota has important applications in human health. For instance, in gut microbiome, the development of unhealthy stable states is closely related to many diseases such as obesity, type 2 diabetes mellitus and gastrointestinal disorders47-49. Strategies have been developed to overcome the resilience of unhealthy states, including fecal transplantation or supplementation with probiotics18. Our work predicts that the horizontal transfer of MGEs such as plasmids might be an additional mechanism for the emergence of the unhealthy states. Indeed, human gut is a ‘hotspot’ of gene flow41. Previous studies suggested that some small molecules such as unsaturated fatty acids can inhibit the conjugative transfer of plasmids50-52. By binding the type IV secretion traffic ATPase TrwD, these compounds limit the pilus biogenesis and DNA translocation53. Therefore, modulating MGE spread using these molecules might offer new opportunities to reshape the stability landscape and narrow down the attraction domains of the disease states51,54.

Methods

Modeling framework of two competing species sharing mobile genes

We used a mathematical model developed in a previous work to analyze the population dynamics of two competing species transferring mobilizable plasmids with growth rate effects28. Briefly, the model includes four ordinary differential equations (ODEs):

S1 and S2 are the abundances of the two species. R1 and R2 describe the strengths of interspecies competition. Nm,1 and Nm,2 are the maximum carrying capacities for species 1 and 2, respectively. D is the dilution rate. Pi (i = 1, 2) represents the abundance of the subpopulation in the i-th species that acquires the mobilizable genes from its competitor. Here, we assumed that the populations would not lose their own native plasmids completely. The internal inhibition within each species was also assumed to be independent of the acquired MGEs. µi represents the maximum ‘per capita’ growth rate of the i-th species when interspecies HGT is absent. µi is calculated as where is the basal growth rate determined by the non-mobilizable genes and λi is the growth rate effect of the plasmids. Interspecies gene flow allows each species to acquire plasmids from its competitor, resulting in the dynamic change of the effective species growth rates , which is calculated as: and . For instance, all cells of species 1 carry the plasmid 1. Therefore, their growth rate can be obtained as . After HGT, the overall growth rate of species 1 changes because some of the individuals get the plasmid from the second species. Such a change is reflected by the λ2 term in . and stand for HGT rates. Here, we described the HGT process by mass action kinetics, an assumption commonly made for plasmid transfer dynamics. We further assumed that intraspecies and interspecies transfer occurred at the same rates. κ1 and κ2 represent the loss rates of the mobile genetic elements. For plasmids, κ1 and κ2 describe the loss rate by segregation errors.

Let . The model can be further simplified as

Here, s1, s2, p1 and p2 are dimensionless. ηi is related with describes the ratio between Nm,2 and Nm,1: ϱ = Nm,2/Nm,1. For simplicity, we assumed that the two species had the same carrying capacity, i.e. ϱ = 1. The unit of η1 and η2 is hour−1. Without HGT, p1 and p2 become consistently 0, and the model is equivalent to the classic Lotka-Volterra (LV) framework:

Stability analysis of the classic LV model

The classic LV model has four fixed points: . The Jacobian matrix of each fixed point can be calculated as , where and are the species abundances at each fixed point.

The system is bistable only when 2 and 3 are both stable. The Jacobian matrix of 2 is . The eigenvalues of J2 can be obtained as and Dµ2. 2 is stable when both eigenvalues are negative, which leads to γ2 >ϕ2/ϕ1 where and . Similarly, 3 is stable when γ1 >ϕ2/ϕ1. Therefore, the condition for the system being bistable is γ2 >ϕ1/ϕ2 and γ1 >ϕ2/ϕ1.

Bistability analysis of two-species populations by numerical simulations

We performed numerical simulations to determine the bistability of a population consisting of two competing species transferring mobile genes. Specifically, for a system with given parameters, we randomly initialized the species abundances between 0 and 1 following uniform distributions for 200 times. Then we simulated the dynamics of each population till the abundance of every species reached equilibrium, and we treated it as a steady state. We grouped the 200 steady states into different attractors by applying the threshold of 0.01. Two steady states with their Euclidean distance smaller than the threshold belonged to the same group. The Euclidean distance was calculated as where k is the species index and sj,k represents the abundance of the k-th species in the i-th steady state.

Theoretical framework of multiple competing species transferring mobile genes

For a community of m competing species that share mobile genes with each other, the modeling framework consists of two groups of ODEs:

si is the abundance of the i-th species. pij is the size of the subpopulation in the i-th species that acquires si -originated MGEs. γji is the negative interaction that sj imposes on the i-th species. D is the dilution rate., the effective growth rate of si, is calculated by is defined as where is the basal growth rate, λij is the growth rate effect of the sj-originated MGEs in the i-th species. ηjki is the transfer rate of the sj-originated plasmids from species k to species i. κij is the loss rate of the j-th mobile genetic element in the i-th species.

Analysis of multistability of complex communities

For a population of m species with given niches and kinetic parameters, we initialized the system 500 times in the ranges of 0 < si < 1 following uniform distributions. The initial conditions for pij’s are pii = si and pij = 0 (ij). Then the dynamics of each population was simulated for 2000 hours till the system reached the steady state. For each steady state we obtained the corresponding species composition and grouped the 500 solutions into different stable states based on their Euclidean distances.

Horizontal gene transfer within communities under strong environmental selection

Under strong antibiotic selections, only cells carrying antibiotic resistant MGEs can survive. To examine whether our conclusion is still applicable in this scenario, we generalized our model by considering the transfer of an antibiotic-resistant gene (ARG) in a population of m species under strong antibiotic selection. Within each species, only cells carrying the MGE can grow, with µi being their maximum growth rate. The cells without the MGE will be eventually depleted by dilution D. The community dynamics can be described by the following ODEs (i = 1,2, …, m):

si is the total abundance of the i-th species, and pi is the abundance of cells carrying the MGE in si. In the first equation, the first term describes the overall growth of the i-th species, which is only contributed by pi since the MGE-free cells are not able to grow. ηji is the MGE transfer rate from the j-th to the i-th species. κi is MGE loss rate in the i-th species. γji describes the inter-species competition strength.

Without loss of generality, we assumed the species 1 was the MGE donor and p1 was equal with s1. Without HGT, the MGE only resides in the donor species, while HGT allows the MGE to be shared with other species. To understand how HGT rate influences community multistability, we calculated the phase diagram of populations of two competing species. Increasing HGT rate enlarged the bistability region. We further analyzed the number of alternative stable states in communities of 5 or 8 species. In particular, we randomly initialized the species abundances 500 times, simulated the steady states and clustered them into different attractors. When calculating the number of stable states in multi-species communities, we randomly drew the µi values from a uniform distribution between 0.3 and 0.7 hr−1. Our results suggested that the number of stable states in general increased with HGT rate.

Niche-based model of multi-species communities

For a community consisting of m competing species, let the number of niches be l. Each niche has a maximum carrying capacity . Each species lives in one of the niches. Let M be the map from species index to the index of its niche. Mi = k means that the i-th species lives in the k-th niche. For species i and j, if Mi = Mj, these two species belong to the same niche and compete with each other. Species from different niche do not directly interact. Therefore, the model becomes:

Here, si is the abundance of the i-th species. pij is the size of the subpopulation in the i-th species that acquires sj-originated mobile genes. γji is the negative interaction that sj imposes on the i-th species. ηjki is the transfer rate of the sj-originated genes from species k to species i. In simulations, the number of niches was randomized between 2 and m/2. The maximum carrying capacity of each niche was randomized between 0 and 1 following uniform distributions. Then each species was randomly allocated into one of the niches.

Theoretical framework of metacommunity dynamics

Consider a metacommunity composed of u × v local patches. We assumed a grid-like arrangement of patched connected by dispersal terms ℋ. The location of each patch can be described by two coordinates [a, b] (a = 1,2, …, u and b = 1,2, …, v). Let ω be the dispersal rate between the adjacent patches. The dynamics of the metacommunity can then be described by generalizing equations (11) and (12) to each local patch:

For the patch located at [a, b], sa,b,i is the abundance of the i-th species, and pa,b,i,j is the size of the subpopulation in the i-th species that acquires sj-originated mobile genes. The effective growth rate is calculated as .

and are the gains of sa,b,i and pa,b,i,j by dispersal, respectively. We assumed that microbial dispersal only occurred between adjacent patches. Therefore, was calculated by summing the dispersal terms at four directions: left, right, up, and down. The left component can be calculated as

Similarly, and is calculated as:

can then be obtained as can be formulated in the similar way.

The collective species diversity in a metacommunity

To analyze the total species diversity in a metacommunity, we first calculated the total abundance of each species across all patches: si = ∑a=1,2,…,ub=1,2,…,v sa,b,j. Then we measured the diversity using Shannon index, a common metric used in ecology. Shannon index can be calculated as . sp is the total species abundance: .

Biological relevance of our analysis

The empirically measured gene transfer rates (denoted as ηc, with the unit of cells−1· mL · hour−1) should be multiplied by Nm, the maximum carrying capacity of the population, before being used in our model. Therefore, the transfer rate η in our analysis are several orders of magnitude higher than the experimentally measured rates55,56. In this work, we focused on HGT rate in the range of 0 < ηi < 0.4 hour−1. Whether this range is biologically relevant depends on Nm of the population. Considering the typical estimates of plasmid transfer rates cross species (10−13 cells−1 · mL · hour−1, from Klebsiella pneumoniae to Escherichia coli) and within species (10−7 cells−1 · mL · hour−1, between E. coli strains) provided by a previous study55, HGT rates in our analysis are relevant in various environments from human colon (∼1012 cells per gram) 57 to deep oceanic subsurface (106∼108 cells per gram)58.

Acknowledgements

This work is supported by Shenzhen Institute of Synthetic Biology Scientific Research Program (Grant No. HSE199011086). The funder had no role in study design, data collection and analysis, the decision to publish, or the preparation of the manuscript.

Code Availability

All the codes and source data associated with the numerical simulations and analysis of this manuscript are available at the Github repository: (https://github.com/twang1993/MultistabilityByHGT).