Article | Open | Published:

# Migration alters oscillatory dynamics and promotes survival in connected bacterial populations

## Abstract

Migration influences population dynamics on networks, thereby playing a vital role in scenarios ranging from species extinction to epidemic propagation. While low migration rates prevent local populations from becoming extinct, high migration rates enhance the risk of global extinction by synchronizing the dynamics of connected populations. Here, we investigate this trade-off using two mutualistic strains of E. coli that exhibit population oscillations when co-cultured. In experiments, as well as in simulations using a mechanistic model, we observe that high migration rates lead to synchronization whereas intermediate migration rates perturb the oscillations and change their period. Further, our simulations predict, and experiments show, that connected populations subjected to more challenging antibiotic concentrations have the highest probability of survival at intermediate migration rates. Finally, we identify altered population dynamics, rather than recolonization, as the primary cause of extended survival.

## Introduction

Spatially extended populations can be distributed heterogeneously, often in the form of a network of relatively dense population patches connected to each other by migration1,2. In macroecology, population networks are pervasive in a variety of social and ecological settings such as human settlements connected by transportation routes3, oceanic islands connected by migration4, and faraway plant populations connected by seed dispersal5,6. Migration patterns shape the population dynamics on these networks7,8,9 and can have a profound impact on population stability and persistence5,10,11.

One major focus of both theoretical work and field studies on connected populations has been conservation ecology, particularly in the context of endangered species12. In general, disconnected networks or fragmented habitats are considered undesirable because isolated populations are susceptible to extinction due to demographic stochasticity or environmental fluctuations13. In the presence of migration, individuals from neighboring populations can stabilize an endangered population14. In addition, migration can counteract stochastic extinction of a local population by creating a metacommunity with a larger total population size10. Furthermore, migrants can repopulate nearby patches that have gone extinct13,15. The concept that migration can prevent permanent population collapse has led to the construction of conservation corridors that are intended to prevent local extinctions by facilitating movement between previously unconnected habitat patches16.

However, excessive migration can lead to synchronization of population dynamics in connected habitat patches12,17,18,19,20,21. In harsh environmental conditions, synchronization can enhance the risk of global stochastic extinction during periods of collective decrease in population size12, since patches effectively merge into one large population in the limit of strong coupling22. Accordingly, a number of computational models predict that intermediate migration rates optimize species persistence time and extend metapopulation extinction time, mainly due to recolonization events following local extinction23,24,25,26. Such recolonization-mediated enhancement in survival has been observed experimentally in metapopulations of plants5, plants and predatory mites27, fruit flies10, and ciliate predator-prey systems15,28.

Apart from enabling recolonization, migration can also perturb population dynamics, potentially giving rise to another mechanism of enhanced survival. Populations exhibiting deterministic oscillations are ideally suited to studying migration-induced perturbations in population dynamics. In particular, time course data enables both quantification of perturbations and identification of extinction and recolonization events, making it possible to ascertain the relative importance of each of these survival mechanisms. While theoretical work on nonlinear maps29 and on predator-prey systems30 has linked perturbed within-patch population dynamics to enhanced survival, experimental validation is lacking owing largely to difficulties in obtaining high-quality time series data.

Here, we develop a bacterial model system composed of two connected oscillating populations to elucidate the impact of migration on population dynamics (Fig. 1a). Our approach is similar to previous studies31,32,33,34,35,36,37 that have employed simple microbial populations in a laboratory setting to test ecological theories. Although it forgoes the complexity of natural population networks, our system is ideal for systematically exploring the relationship between survival and perturbed population dynamics because it allows us to precisely control the migration rate as well as environmental conditions. We also use a mathematical model of antibiotic degradation by bacteria to better understand the effects of migration between patches on our experimental system.

In this work, we first quantify the onset of synchronization in benign environmental conditions, in which individual populations exhibit stable oscillations over the duration of the experiment (Fig. 1b). More importantly, we show that en route to synchronization, the system goes through a series of qualitatively distinct oscillatory dynamics that are not observed in the absence of migration. We further show that these new dynamics enable populations to endure longer in harsh environments, as evidenced by the increase in survival times for moderate levels of migration. We emphasize that intermediate migration rates can lead to different ecological outcomes, even though the migration rate is below the level necessary for the onset of synchronization (Fig. 1b). In a broader context, our results on two connected bacterial populations can be viewed as the first step in a bottom-up approach aimed at probing the role of migration in the population dynamics of more complex networks.

## Results

### Experimental setup

In order to quantify effects such as synchronization in an experimental model system, we use a bacterial cross-protection mutualism that exhibits robust oscillatory population dynamics31. The system is comprised of two strains of Escherichia coli that protect each other from antibiotics in the environment by producing resistance enzymes. One strain (AmpR) is resistant to the antibiotic ampicillin, and the other strain (ChlR) is resistant to the antibiotic chloramphenicol (Fig. 2a). Previous work has already demonstrated that a co-culture of AmpR and ChlR exhibits robust limit cycle oscillations as a function of time over a broad range of antibiotic concentrations, when subjected to serial daily dilutions into fresh media and antibiotics31.

In the serial daily dilution scheme employed in our experiments (Fig. 2b), we propagated co-cultures of the AmpR and ChlR strains in ~24 h growth-dilution cycles in 96-well plates under well-mixed conditions in the presence of LB media, ampicillin, and chloramphenicol. At the end of each growth cycle, we measured the total population density using spectrophotometry and the relative proportion of AmpR and ChlR cells using flow cytometry (see Methods). Next, we diluted the co-cultures by a factor of 100 into fresh media containing antibiotics, and subjected them to another growth cycle for ~24 h. Upon repeating these daily growth-dilution cycles for 15 days, we observed that the population density of AmpR (purple) as well as ChlR (green) cells oscillates with a period of 3 days (Fig. 2c, left panel). We note that the ratio of AmpR cells to ChlR cells constitutes an appropriate characterization of the state of the population because it also exhibits period-3 oscillations, with the oscillation amplitude spanning four orders of magnitude (Fig. 2c, right panel).

In order to examine the effects of migration, we studied pairs of co-cultures and coupled them via transfer of cells between the two patches of each pair. Figure 3a depicts the growth-migration-dilution scheme employed in our experiments. The scheme is similar to the growth-dilution scheme discussed earlier (Fig. 2b), with two important additions. First, we consider two co-cultures instead of one, which we label as habitat patches A and B. The second crucial addition is the migration step, which occurs after growing the co-cultures for 24 h and measuring the total population density and relative abundances of the strains, but before dilution into fresh media. In this step, we transfer a fraction m of the cells from each co-culture into the other (corresponding to a fixed volume). The mixed co-cultures are then diluted into fresh media with antibiotics and grown again for 24 h, as done previously for individual co-cultures. This migration scheme allows us to vary the migration rate over several orders of magnitude, enabling us to experimentally probe the effect of migration on population dynamics, in a systematic manner.

### Synchronization of oscillations in benign conditions

Since migration is known to lead to synchronization in a variety of systems12,18,19,20,21, we first quantified the minimum migration rate necessary for the onset of synchronization under benign environmental conditions (10 μg/ml ampicillin, 8 μg/ml chloramphenicol), in which the system exhibits stable oscillations (Fig. 2c). For each migration rate, we performed daily growth-migration-dilution experiments with three initial relative abundances of AmpR to ChlR cells for each of two biological replicates, i.e., a total of six replicate pairs of co-cultures. While synchronization can sometimes be observed even at very low migration rates (and even at m = 0 when the two populations happen to oscillate in phase without coupling), all replicates showed synchronous dynamics for m ≥ 0.2 (Fig. 3b). This strongly suggests that the onset of complete synchronization lies in the region 0.1 < m ≤ 0.2.

While synchronization is certainly an important effect, it is not clear whether it is the only effect that migration has on population dynamics. In particular, it is worth investigating whether there are additional qualitative differences in population oscillations at intermediate migration rates. To this end, we took a closer look at the population time series data as a function of increasing migration rate. It is evident that our coupled co-cultures exhibit period-3 oscillations in the absence of migration (m = 0, Fig. 3c) as well as very high migration rates (m = 0.2, Fig. 3e), the difference being that the oscillations are asynchronous in the former case and synchronous in the latter. However, the period-3 oscillations are perturbed at intermediate migration rates, and we see signatures of other periods, such as period-4 oscillations at m = 0.1 (Fig. 3d). The perturbed oscillations may also reflect the presence of long transients38. Interestingly, perturbed oscillations appear to be quite common for m = 0.04 and m = 0.1 but are not observed at very low or very high migration rates (Supplementary Figure 1).

### Mechanistic model of population dynamics

The data in Fig. 3c–e demonstrate that migration not only synchronizes population dynamics but also alters them in a qualitative manner. To better understand the sequence of experimental outcomes with increasing migration rate, we turned to an ordinary differential equation based mechanistic model that simulates antibiotic degradation and cell growth. This model was developed in the context of isolated co-cultures and has been shown to reproduce the observed period-3 limit cycle oscillations over a reasonably broad parameter regime31. The model has two variables N1 and N2 corresponding to the population densities of AmpR and ChlR, respectively, and two variables A1 and A2 corresponding to the concentrations of the antibiotics ampicillin and chloramphenicol, respectively. Over the 24 h growth period, the population densities and antibiotic concentrations change with time according to the following equations:

$$\frac{{{\mathrm{d}}N_1}}{{{\mathrm{d}}t}} = \gamma _1\left( {A_2} \right)N_1\left( {1 - \frac{{N_1 + N_2}}{K}} \right)$$
(1)
$$\frac{{{\mathrm{d}}N_2}}{{{\mathrm{d}}t}} = \gamma _2\left( {A_1} \right)N_2\left( {1 - \frac{{N_1 + N_2}}{K}} \right)$$
(2)
$$\frac{{{\mathrm{d}}A_1}}{{{\mathrm{d}}t}} = \frac{{ - V_{{\mathrm{max}}}A_1}}{{K_{\mathrm{m}} + A_1}}N_1\left( {t = 0} \right)$$
(3)
$$\frac{{{\mathrm{d}}A_2}}{{{\mathrm{d}}t}} = - c_2A_2N_2$$
(4)

Here, we assume that bacterial growth is logistic, with antibiotic concentration-dependent growth rates γ1(A2) and γ2(A1). The two strains exhibit neutral resource competition, as reflected in the combined carrying capacity K. Ampicillin degradation is assumed to obey Michaelis-Menten kinetics. In reality, ampicillin is degraded by β-lactamase39,40 molecules produced by AmpR cells during their growth as well as the free ones carried over from the previous day. Our model assumes that the dominant contribution comes from the β-lactamases carried over from the previous day. Since the number of enzyme molecules carried over is proportional to the number of AmpR cells present at the beginning of the day, the equation for A1 contains the initial density of AmpR cells N1(t = 0) rather than their instantaneous density N1(t). These features of the model are supported by our previous findings that there is significant beta-lactamase activity in the media transferred from the previous day41 and that the oscillatory population dynamics in our model of the mutualism most closely reflect those observed in experiments when we use the initial AmpR cell density to determine the ampicillin deactivation rate. Since chloramphenicol degradation is intracellular39, the degradation rate of chloramphenicol is taken to be proportional to the density of ChlR cells. While our mathematical model explicitly considers the inoculum effect due to enzymatic degradation of antibiotics, it does not include other potential sources of an inoculum effect42,43,44, as they were not necessary to recapitulate the dynamics observed in experiments. Finally, since AmpR cells are sensitive to chloramphenicol, and ChlR cells are sensitive to ampicillin, the growth rates of the two strains are proportional to the concentration of the antibiotic to which they are sensitive. These growth rates are given by:

$$\gamma _1\left( {A_2} \right) = \left\{\begin{array}{cl}0 & \qquad t \, < \, t_{{\mathrm{lag}}} \\ \frac{{\gamma _1^{\mathrm{R}}}}{{1 + A_2/I_{12}}} & \qquad t \ge t_{{\mathrm{lag}}}\end{array}\right.$$
(5)
$$\gamma _2\left( {A_1} \right) = \left\{\begin{array}{cl}0 & \qquad t \, < \, t_{{\mathrm{lag}}} \\ - \gamma _2^{\mathrm{D}} + \frac{{\gamma _2^{\mathrm{R}} + \gamma _2^{\mathrm{D}}}}{1 + A_1/I_{21}} & \qquad t \ge t_{{\mathrm{lag}}}\end{array}\right.$$
(6)

Here, we have also incorporated a lag phase, characterized by a time scale tlag over which the cells do not grow or die. Since chloramphenicol is a bacteriostatic antibiotic, i.e., it inhibits sensitive cell growth but does not cause the cells to die, the growth rate of AmpR cells approaches zero at high concentrations of chloramphenicol but never becomes negative (Fig. 4a, green curve). On the other hand, ampicillin is bactericidal, i.e., its presence can cause sensitive cells to die and we therefore model the growth rate of ChlR cells such that it is negative at high concentrations of ampicillin (Fig. 4a, purple curve). Numerical values and descriptions of all parameters used in the simulations are listed in Supplementary Table 1. In a typical simulation over a 24 h growth cycle, the cell densities saturate (Fig. 4b, top panel) and the antibiotics are deactivated (Fig. 4b, bottom panel). We note that the initial and final densities of AmpR and ChR can be substantially different, such that the ratio N1/N2 can vary substantially from day to day.

To gain insight into the experimentally observed changes in oscillatory dynamics with increasing migration rate, we implemented the growth-migration-dilution scheme in our simulations. The chief advantage of simulations is that they allow us to analyze the system’s behavior over timescales that are much longer than those accessible in our experiments. The long timescales enable us to discern whether a given dynamical outcome corresponds to stable oscillations or transient dynamics. Simulations also facilitate a detailed characterization of oscillatory dynamics as well as the range of migration rates over which they are observed. In our simulations, we started with two patches A and B for which we numerically integrated the model equations over 24 h. To implement the migration and dilution steps, we mimicked the experimental protocol by resetting the initial population densities and antibiotic concentrations in the two patches for the next day of growth in accordance with the dilution factor of 100 and the migration rate m. The system’s dynamical outcomes are best summarized in the form of a bifurcation diagram as a function of the migration rate (Fig. 4c). In this bifurcation diagram we have plotted the unique values attained by the population, i.e., the ratio of AmpR to ChlR cells in patch A over the last 50 days of a simulation consisting of 1000 daily dilution cycles.

As expected, we observe a regime of period-3 oscillations at very low migration rates (Fig. 4c, blue region) as well as high migration rates (Fig. 4c, red region). Moreover, these oscillations are asynchronous at very low migration rates and synchronous at high migration rates (Fig. 4c, insets corresponding to blue and red regions. Also see Supplementary Figure 2 for the migration rate dependence of the probability of synchronization.). Quite remarkably, the bifurcation diagram also contains a regime of period-4 limit cycle oscillations (Fig. 4c, orange region and inset) at intermediate migration rates that is surrounded on both sides by narrow regions characterized by irregular dynamics and long transients (Fig. 4c, green regions). The transition from period-3 to period-4 dynamics occurs via an inverse period doubling cascade (Fig. 4c, 0.05 ≤ m ≤ 0.06). Such inverse period doubling cascades are commonly observed in discrete two-patch population dynamics models such as coupled logistic maps or Ricker maps29. Although our model is based on ordinary differential equations, the daily dilution scheme imposes discreteness on the dynamics, and the observed bifurcation structure is analogous to that observed in coupled maps. The dynamics at intermediate migration rates in Fig. 4c are strikingly similar to the perturbed oscillations observed in our experiments (Fig. 3d and Supplementary Figure 1). Indeed, our simple model successfully captures the sequence of experimentally observed dynamical outcomes as a function of the migration rate. In particular, transitions between different dynamical regimes are in reasonable qualitative agreement with our experiments. Moreover, the presence of altered population dynamics in both experiments and simulations suggests that intermediate migration rates can indeed give rise to population dynamics that are distinct from those in the asynchronous and synchronous regimes.

### Intermediate migration rates enhance survival

It is plausible that the disturbance of oscillations at intermediate migration rates may influence a population’s viability in harsh environments, although it is not a priori obvious whether this influence would be harmful or beneficial. As mentioned earlier, it has been suggested that synchronization can enhance the risk of global extinction in harsh environments12,18, which implies that high migration rates may have a deleterious impact on the probability of survival, but it is not clear if this effect is monotonic. To explore the effect of intermediate migration rates on survival probability, we simulated our model in harsh environmental conditions. For these simulations, a harsh environment corresponds to higher antibiotic concentrations (10 μg/ml ampicillin, 16 μg/ml chloramphenicol), where the model predicts that isolated populations go extinct deterministically in the absence of migration. Furthermore, we introduce 15% noise in the migration and dilution steps of our simulations, to mimic the stochastic fluctuations resulting from our experimental protocol. To quantify the impact of migration on survival, we generated probability distributions P(τ) of population lifetimes, i.e., the durations τ for which the populations survived for various m (Fig. 5a). The distributions decay exponentially over a timescale that increases with migration rate for m 0.03 and decrease with migration rate for m 0.1. Interestingly, within a narrow intermediate migration regime (0.04 m 0.07), the survival time distributions have longer tails, which suggests that intermediate migration rates can result in enhanced survival as compared with isolated populations or strongly coupled ones. Overall, the variation of P(τ) with m indicates that moderate levels of migration offer the best chance of survival in harsh conditions.

A more experimentally tractable measure of the effect of migration on survival in challenging environments is the fraction of populations that survive over a given period of time. Towards this end, we computed the probability of survival over 10 days. As expected from the variation in P(τ) with m (Fig. 5a), the survival probability over 10 days changes non-monotonically with the migration rate (Fig. 5b). This qualitative trend occurs regardless of the duration over which we compute survival probability (Supplementary Figure 3). Moreover, the peak in survival probability occurs in the regime where we observe approximately exponential decay in P(τ), once again suggesting that moderate levels of migration perturb population dynamics in a manner that favors extended survival.

Motivated by the simulation results, we proceeded to test whether the predicted non-monotonicity of survival probability with m is also observed in experiments. Accordingly, we performed growth-dilution-migration experiments with higher antibiotic concentrations (10 μg/ml ampicillin, 16 μg/ml chloramphenicol) and measured the fraction of populations that survived over 10 days. As predicted by the simulations, the survival probability indeed shows a peak at intermediate migration rates (Fig. 5c; see Supplementary Figure 4 for population density time series). Further, the location of the maximum shows reasonably good quantitative agreement with the simulations. Collectively, these findings establish that moderate levels of migration promote population dynamics that extended survival in harsh environments.

Interestingly, the dynamics we observe for moderate migration rates resemble noisy antisynchronous period-2 oscillations (see Supplementary Figure 5 for bifurcation diagrams and a representative time series), and we see signatures of such oscillations in some of our surviving experimental populations as well (Supplementary Figure 6). Intuitively, antisynchronous dynamics could ensure that the population sizes in the two patches do not simultaneously become low, which averts the danger of global extinction. In previous computational studies23,29,45,46, such antisynchronous dynamics have been widely recognized as a potential mechanism for survival and our experiments provide direct evidence in support of these numerical findings.

To investigate whether the complex antisynchronous dynamics observed in our model (Supplementary Figure 5) are chaotic, we computed47 the largest Lyapunov exponent from simulated trajectories of the log ratio of AmpR cells to ChlR cells in a given patch, for 0.02 ≤ m ≤ 0.06. We find that chaotic dynamics are indeed present within this regime, as evidenced by positive values for the largest Lyapunov exponent for several migration rates within the range 0.02 ≤ m ≤ 0.042 (Supplementary Figure 7). Since we do not observe period doubling, it is possible that the quasiperiodic route to chaos underlies the chaotic dynamics observed here. The quasiperiodic route has been observed in a system of two linearly coupled logistic maps48 as well as other population dynamics models49,50. While a detailed analysis of the routes to chaos is outside the scope of the present work, we reiterate that the discreteness imposed by daily dilutions may render the dynamics of our system analogous to those observed in coupled nonlinear maps. While the migration rate that maximizes survival probability (m ~ 0.05) is slightly larger than the regime over which we observe chaos, the data in Fig. 5b and Supplementary Figure 7 show that antisynchronous chaotic dynamics contribute to enhanced survival in our model. Given the close agreement between our experiments and simulations, it is tempting to speculate that chaotic dynamics may also help our experimental bacterial populations to survive longer in harsh conditions.

## Discussion

Here, we have shown that two oscillating bacterial populations can synchronize when coupled sufficiently strongly via migration. Furthermore, we have demonstrated that it is possible for the migration rate itself to determine the period of oscillation. In particular, our experimental system exhibits limit cycle period-3 oscillations in the absence of migration. However, we observed disturbances in these dynamics in the presence of migration that were consistent with the period-4 oscillations predicted by the model at intermediate migration rates (Fig. 3d). This finding represents empirical evidence that the characteristics of population oscillations observed in natural microbial communities may not simply be a result of intrinsic inter- or intra-species interactions, but may also be a consequence of spatial structure and migration.

Since migration can perturb population dynamics, it also has the potential to influence the survival of a population in a challenging environment. For instance, we found that populations were most likely to survive the duration of the experiment at intermediate migration rates (Fig. 5). The presence of a maximum in survival probability at intermediate migration rates is potentially relevant in conservation biology and epidemiology in that controlling migration might lead to desired outcomes such as population stability or disease eradication.

In field ecology and metapopulation theory, recolonization of habitat patches after local extinction events is thought to be a major contributor to extended survival in harsh environments13, a claim supported by recent experiments on protists15. However, we observed relatively few instances of such recolonization (Supplementary Figure 8), implying that recolonization is not the major cause of extended survival in our system. Nevertheless, in a more spatially extended population with a larger number of habitats, it may be possible that recolonization plays a more significant role in enabling populations to survive in challenging conditions.

Finally, we note that in challenging environments, evolutionary rescue can also lead to population recovery51. In our system, evolutionary rescue may occur either via enhanced antibiotic tolerance through the evolution of lag time mutants52 or via increased drug resistance in one of the strains. Indeed, we did observe a few cases in which ChlR cells developed a higher resistance to ampicillin, particularly at high migration rates in the harsh environment (10 μg/ml ampicillin, 16 μg/ml chloramphenicol) (Supplementary Figure 9). Interestingly, we found no evidence of such evolution in extremely harsh environments (10 μg/ml ampicillin, 20 μg/ml chloramphenicol), in which all populations became extinct within 7 days (Supplementary Figure 10). These observations suggest that the optimal conditions for evolution of additional antibiotic resistance represent a tradeoff between selection pressure, which is primarily determined by the environment, and survival time, which can be influenced by the migration rate. In addition, the effective population size may also play a role in guiding the course of evolution in that stronger coupling may lead to a larger population size and thus more genetic diversity, but may also lead to reduced survival time. Collectively, our findings highlight the importance of spatial structure and its impact on bacterial population dynamics in the context of the evolution of antibiotic resistance53,54. It is evident that cross-protection can render a population resistant to multiple drugs without any individual strain evolving resistance to more than one drug31. Furthermore, similar to how drug tolerance can promote the evolution of resistance55, it is possible that cross-protection, particularly in combination with spatial structure and migration, could provide time for strains to evolve multidrug resistance de novo.

In the present study, we found that moderate amounts of migration between two coupled bacterial populations can significantly perturb population oscillations and enhance survival in harsh environments (Fig. 3d and Fig. 5c). Given that a simple setup can have significant ecological consequences, it would be interesting to extend this approach to a larger number of connected populations. For example, in addition to the migration rate, the network topology can play an important role in governing synchronization56,57. The network topology also allows exotic forms of partial synchronization such as phase clusters and chimeras58,59,60, whose relevance to ecological systems is hitherto unexplored. The effects of asymmetric migration rates, spatial expansion, and environmental conditions are also worthy of exploration45,61,62,63.

More generally, our experiments suggest that it is worthwhile to explore how concepts from macroecology and network theory apply to microbial systems. Despite extensive work in theoretical ecology and macroecology, relatively little attention has been dedicated to examining the implications of migration on microbial communities, which can exhibit rich population dynamics over spatially extended environments. Spatially fragmented yet dispersed microbial communities can be found in the ocean on organic particulate matter called marine snow64, in the ground on soil grains, and on different human body sites, suggesting that the impact of migration on the ecology of these microbial ecosystems may have implications on topics ranging from the global carbon cycle65 to human health. Given that that there are notable differences between microbes and larger organisms (e.g., relatively large population sizes with fewer stochastic fluctuations), further work is necessary to translate findings from theoretical ecology and macroecology to microbial ecology.

## Methods

### Strains

The strains used are identical to those in our previous paper31. Briefly, the chloramphenicol-resistant strain ChlR is an E. coli DH5α strain transformed with the pBbS5c-RFP plasmid66 which encodes a gene for chloramphenicol acetyltransferase (type I) enzyme as well as a gene for monomeric red fluorescent protein (RFP). The plasmid pbBS5c-RFP was obtained from Jay Keasling (University of California, Berkeley, CA) via Addgene (plasmid 35284)66. The ampicillin-resistant strain is an E. coli DH5α strain transformed with a plasmid encoding a gene for the β-lactamase enzyme (TEM-1) and a gene for enhanced yellow fluorescent protein (EYFP).

### Experiments

Initial monocultures of our strains were grown for 24 h in culture tubes containing 5 ml LB supplemented with antibiotic for selection (50 μg/mL ampicillin and 25 μg/mL chloramphenicol for AmpR and ChlR, respectively) at 37 °C and shaken at 250 rpm. The following day, 200 μL of co-cultures of the two strains were grown at varying initial population fractions in LB without antibiotics. For synchronization experiments, the initial ratios of AmpR cells to ChlR cells were chosen such that the probability for paired co-cultures to be in the same phase of oscillation in the absence of migration (m = 0) was low. Subsequently, serial migration-dilution experiments were performed in well-mixed batch culture with a culture volume of 200 μL. In each cycle, co-cultures were grown for 24 h in LB media supplemented with the antibiotics ampicillin and chloramphenicol. During growth, cultures were shaken at 500 rpm at a temperature of 37 °C. At the end of the growth cycle, we measured the optical density (OD) at 600 nm and prepared flow cytometry samples by diluting 5 μL of each grown co-culture by a factor of 1600 into phosphate buffer (PBS, Corning 21-040-CV). To perform the migration step, we pipetted fixed volumes of each co-culture within a connected pair into the other at the end of each growth cycle; subsequently, these co-cultures were diluted by a factor of 100 into fresh LB media and antibiotics. Growth medium was prepared by using BD’s Difco TM LB Broth (Miller) (catalog no. 244620). Ampicillin stock was prepared by dissolving ampicillin sodium salt (Sigma-Aldrich catalog no. A9518) in LB at a concentration of 50 mg/mL. The solution was filter sterilized, stored frozen at −20 °C, and thawed before use. Chloramphenicol stock was prepared by dissolving chloramphenicol powder (Sigma-Aldrich catalog no. C0378) in 200 proof pure ethanol (KOPTEC) at a concentration of 25 mg/mL. This solution was filter sterilized and stored at −20 °C. Prepared 96-well plates of media supplemented with antibiotics were stored at −80 °C, thawed one day prior to inoculation at 4 °C and warmed for 1 h at 37 °C immediately before inoculation.

### Measurement and data analysis

At the end of each growth cycle, we took spectrophotometric (Thermo Scientific Varioskan Flash at 600 nm) measurements, which serve as a proxy for the total population size. We converted the OD measurement to CFU/μl based on a calibration curve obtained from counting colonies on LB and agar plates originating from cultures at various cell densities. We also took flow cytometry (Miltenyi Biotec MACSQuant VYB) measurements of the cultures to determine subpopulation sizes (see Supplementary Figure 11 for a representative pseudocolor plot exemplifying our gating strategy). We consider two populations to be synchronous if the peaks of their oscillation occur at the same time over the last two oscillation cycles (the final 40% of the experiment), to reduce the influence of transients as well as gather sufficient statistics. Data analysis was performed using a combination of Matlab and Origin. Simulations were performed using Matlab. Flow cytometry data were analyzed using the Python package FlowCytometryTools67.

### Code availability

All data analysis code is available upon request.

## Data availability

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

## References

1. 1.

Gilpin, M. Metapopulation Dynamics: Empirical and Theoretical Investigations (Academic Press, 2012).

2. 2.

Hanski, I. Metapopulation dynamics. Nature 396, 41 (1998).

3. 3.

Guimera, R., Mossa, S., Turtschi, A. & Amaral, L. N. The worldwide air transportation network: anomalous centrality, community structure, and cities’ global roles. Proc. Natl Acad. Sci. USA 102, 7794–7799 (2005).

4. 4.

Cowie, R. H. & Holland, B. S. Dispersal is fundamental to biogeography and the evolution of biodiversity on oceanic islands. J. Biogeogr. 33, 193–198 (2006).

5. 5.

Molofsky, J. & Ferdy, J.-B. Extinction dynamics in experimental metapopulations. Proc. Natl Acad. Sci. USA 102, 3726–3731 (2005).

6. 6.

Nathan, R. Long-distance dispersal of plants. Science 313, 786–788 (2006).

7. 7.

Blasius, B., Huppert, A. & Stone, L. Complex dynamics and phase synchronization in spatially extended ecological systems. Nature 399, 354 (1999).

8. 8.

Gilarranz, L. J., Rayfield, B., Liñán-Cembrano, G., Bascompte, J. & Gonzalez, A. Effects of network modularity on the spread of perturbation impact in experimental metapopulations. Science 357, 199–201 (2017).

9. 9.

Limdi, A., Pérez-Escudero, A., Li, A. & Gore, J. Asymmetric migration decreases stability but increases resilience in a heterogeneous metapopulation. Nat. Commun. 9, 2969 (2018).

10. 10.

Dey, S. & Joshi, A. Stability via asynchrony in Drosophila metapopulations with low migration rates. Science 312, 434–436 (2006).

11. 11.

Abbott, K. C. A dispersal‐induced paradox: synchrony and stability in stochastic metapopulations. Ecol. Lett. 14, 1158–1169 (2011).

12. 12.

Earn, D. J., Levin, S. A. & Rohani, P. Coherence and conservation. Science 290, 1360–1364 (2000).

13. 13.

Harrison, S. Local extinction in a metapopulation context: an empirical evaluation. Biol. J. Linn. Soc. 42, 73–88 (1991).

14. 14.

Gonzalez, A., Lawton, J. H., Gilbert, F. S., Blackburn, T. M. & Evans-Freke, I. Metapopulation dynamics, abundance, and distribution in a microecosystem. Science 281, 2045–2047 (1998).

15. 15.

Fox, J. W., Vasseur, D., Cotroneo, M., Guan, L. & Simon, F. Population extinctions can increase metapopulation persistence. Nat. Ecol. Evol. 1, 1271 (2017).

16. 16.

Hilty, J. A., Lidicker Jr, W. Z. & Merenlender, A. Corridor Ecology: the Science and Practice of Linking Landscapes for Biodiversity Conservation (Island Press, 2012).

17. 17.

Liebhold, A., Koenig, W. D. & Bjørnstad, O. N. Spatial synchrony in population dynamics. Annu Rev. Ecol. Evol. Syst. 35, 467–490 (2004).

18. 18.

Kerr, B., Neuhauser, C., Bohannan, B. J. & Dean, A. M. Local migration promotes competitive restraint in a host-pathogen ‛tragedy of the commons’. Nature 442, 75 (2006).

19. 19.

Grassly, N. C., Fraser, C. & Garnett, G. P. Host immunity and synchronized epidemics of syphilis across the United States. Nature 433, 417 (2005).

20. 20.

Viboud, C. et al. Synchrony, waves, and spatial hierarchies in the spread of influenza. Science 312, 447–451 (2006).

21. 21.

Grenfell, B. T., Bjørnstad, O. N. & Kappey, J. Travelling waves and spatial hierarchies in measles epidemics. Nature 414, 716–723 (2001).

22. 22.

Ray, C. & Hastings, A. Density dependence: are we searching at the wrong spatial scale? J. Anim. Ecol. 65, 556–566 (1996).

23. 23.

Ben-Zion, Y., Fried, Y. & Shnerb, N. M. Migration, coherence and persistence in a fragmented landscape. Theor. Ecol. 5, 481–493 (2012).

24. 24.

Yaari, G., Ben-Zion, Y., Shnerb, N. M. & Vasseur, D. A. Consistent scaling of persistence time in metapopulations. Ecology 93, 1214–1227 (2012).

25. 25.

Khasin, M., Meerson, B., Khain, E. & Sander, L. M. Minimizing the population extinction risk by migration. Phys. Rev. Lett. 109, 138104 (2012).

26. 26.

Lampert, A. & Hastings, A. Synchronization-induced persistence versus selection for habitats in spatially coupled ecosystems. J. R. Soc. Interface. 10, 20130559 (2013).

27. 27.

Ellner, S. P. et al. Habitat structure and population persistence in an experimental community. Nature 412, 538 (2001).

28. 28.

Holyoak, l & Lawler, S. P. Persistence of an extinction‐prone predator‐prey interaction through metapopulation dynamics. Ecology 77, 1867–1879 (1996).

29. 29.

Zion, Y. B., Yaari, G. & Shnerb, N. M. Optimizing metapopulation sustainability through a checkerboard strategy. PLoS Comput. Biol. 6, e1000643 (2010).

30. 30.

Adam, Lampert, Alan, Hastings & John, Drake Stability and distribution of predator–prey systems: local and regional mechanisms and patterns. Ecol. Lett. 19, 279–288 (2016).

31. 31.

Yurtsev, E. A., Conwill, A. & Gore, J. Oscillatory dynamics in a bacterial cross-protection mutualism. Proc. Natl Acad. Sci. USA 113, 6236–6241 (2016).

32. 32.

Hoek, T. A. et al. Resource availability modulates the cooperative and competitive nature of a microbial cross-feeding mutualism. PLoS Biol. 14, e1002540 (2016).

33. 33.

Müller, M. J. I., Neugeboren, B. I., Nelson, D. R. & Murray, A. W. Genetic drift opposes mutualism during spatial population expansion. Proc. Natl Acad. Sci. USA 111, 1037 (2014).

34. 34.

Fussmann, G. F., Ellner, S. P., Shertzer, K. W. & Hairston, N. G. Jr. Crossing the Hopf bifurcation in a live predator-prey system. Science 290, 1358 (2000).

35. 35.

Becks, L., Ellner, S. P., Jones, L. E. & Hairston, N. G. Jr. Reduction of adaptive genetic diversity radically alters eco‐evolutionary community dynamics. Ecol. Lett. 13, 989–997 (2010).

36. 36.

Zomorrodi, A. R. & Segrè, D. Synthetic ecology of microbes: mathematical models and applications. Eng. Tools Prospects Synth. Biol. 428, 837–861 (2016).

37. 37.

Friedman, J. & Gore, J. Ecological systems biology: the dynamics of interacting populations. Curr. Opin. Syst. Biol. 1, 114–121 (2017).

38. 38.

Wysham, D. B. & Hastings, A. Sudden shifts in ecological systems: intermittency and transients in the coupled Ricker population model. Bull. Math. Biol. 70, 1013–1031 (2008).

39. 39.

Nicoloff, H. & Andersson, D. I. Indirect resistance to several classes of antibiotics in cocultures with resistant bacteria expressing antibiotic-modifying or-degrading enzymes. J. Antimicrob. Chemother. 71, 100–110 (2015).

40. 40.

Sykes, R. B. & Matthew, M. The β-lactamases of gram-negative bacteria and their role in resistance to β-lactam antibiotics. J. Antimicrob. Chemother. 2, 115–157 (1976).

41. 41.

Yurtsev, E. A., Chao, H. X., Datta, M. S., Artemova, T. & Gore, J. Bacterial cheating drives the population dynamics of cooperative antibiotic resistance plasmids. Mol. Syst. Biol. 9, 683 (2013).

42. 42.

Karslake, J., Maltas, J., Brumm, P. & Wood, K. B. Population density modulates drug inhibition and gives rise to potential bistability of treatment outcomes for bacterial infections. PLoS Comput. Biol. 12, e1005098 (2016).

43. 43.

Tan, C. et al. The inoculum effect and band‐pass bacterial response to periodic antibiotic treatment. Mol. Syst. Biol. 8, 617 (2012).

44. 44.

Jokipii, L., Brander, P. & Jokipii, A. M. Reverse inoculum effect in bactericidal activity and other variables affecting killing of group B streptococci by penicillin. Antimicrob. Agents Chemother. 27, 948–952 (1985).

45. 45.

Dey, S., Goswami, B. & Joshi, A. Effects of symmetric and asymmetric dispersal on the dynamics of heterogeneous metapopulations: two-patch systems revisited. J. Theor. Biol. 345, 52–60 (2014).

46. 46.

Dey, S., Goswami, B. & Joshi, A. A possible mechanism for the attainment of out-of-phase periodic dynamics in two chaotic subpopulations coupled at low dispersal rate. J. Theor. Biol. 367, 100–110 (2015).

47. 47.

Wolf, A., Swift, J. B., Swinney, H. L. & Vastano, J. A. Determining Lyapunov exponents from a time series. Phys. Nonlinear Phenom. 16, 285–317 (1985).

48. 48.

Lloyd, A. L. The coupled logistic map: a simple model for the effects of spatial heterogeneity on population dynamics. J. Theor. Biol. 173, 217–230 (1995).

49. 49.

Rohani, P., Miramontes, O. & Hassell, M. P. Quasiperiodicity and chaos in population models. Proc. R. Soc. Lond. B 258, 17–22 (1994).

50. 50.

Ruxton, G. D. & Rohani, P. Population floors and the persistence of chaos in ecological models. Theor. Popul. Biol. 53, 175–183 (1998).

51. 51.

Bell, G. & Gonzalez, A. Adaptation and evolutionary rescue in metapopulations experiencing environmental deterioration. Science 332, 1327–1330 (2011).

52. 52.

Fridman, O., Goldberg, A., Ronin, I., Shoresh, N. & Balaban, N. Q. Optimization of lag time underlies antibiotic tolerance in evolved bacterial populations. Nature 513, 418 (2014).

53. 53.

Zhang, Q. et al. Acceleration of emergence of bacterial antibiotic resistance in connected microenvironments. Science 333, 1764–1767 (2011).

54. 54.

Baym, M. et al. Spatiotemporal microbial evolution on antibiotic landscapes. Science 353, 1147–1151 (2016).

55. 55.

Levin-Reisman, I. et al. Antibiotic tolerance facilitates the evolution of resistance. Science 355, 826-830 (2017).

56. 56.

Noble, A. E., Machta, J. & Hastings, A. Emergent long-range synchronization of oscillating ecological populations without external forcing described by Ising universality. Nat. Commun. 6, 6664 (2015).

57. 57.

Holland, M. D. & Hastings, A. Strong effect of dispersal network structure on ecological dynamics. Nature 456, 792 (2008).

58. 58.

Abrams, D. M. & Strogatz, S. H. Chimera states for coupled oscillators. Phys. Rev. Lett. 93, 174102 (2004).

59. 59.

Tinsley, M. R., Nkomo, S. & Showalter, K. Chimera and phase-cluster states in populations of coupled chemical oscillators. Nat. Phys. 8, 662 (2012).

60. 60.

Martens, E. A., Thutupalli, S., Fourrière, A. & Hallatschek, O. Chimera states in mechanical oscillator networks. Proc. Natl Acad. Sci. USA 110, 10563–10567 (2013).

61. 61.

Franco, D. & Ruiz-Herrera, A. To connect or not to connect isolated patches. J. Theor. Biol. 370, 72–80 (2015).

62. 62.

Becks, L. & Arndt, H. Different types of synchrony in chaotic and cyclic communities. Nat. Commun. 4, 1359 (2013).

63. 63.

Sullivan, L. L., Li, B., Miller, T. E., Neubert, M. G. & Shaw, A. K. Density dependence in demography and dispersal generates fluctuating invasion speeds. Proc. Natl Acad. Sci. USA 114, 5053–5058 (2017).

64. 64.

Alldredge, A. L. & Silver, M. W. Characteristics, dynamics and significance of marine snow. Prog. Oceanogr. 20, 41–82 (1988).

65. 65.

Azam, F. & Long, R. A. Sea snow microcosms. Nature 414, 495–498 (2001).

66. 66.

Lee, T. S. et al. BglBrick vectors and datasheets: a synthetic biology platform for gene expression. J. Biol. Eng. 5, 12 (2011).

67. 67.

Yurtsev, E., Friedman, J. & Gore, J. FlowCytometryTools v0.4.5 (Zenodo, 2015).

## Acknowledgements

This work was primarily supported by NIH Grant R01 GM102311-01 and National Science Foundation CAREER Award PHY-1055154. The laboratory acknowledges support from the Pew Scholars in the Biomedical Sciences Program Grant 2010-000224-007, NIH R00 Pathways to Independence Award GM085279-02, Sloan Foundation Fellowship BR2011-066, the Allen Distinguished Investigator Program, and NIH New Innovator Award DP2. S.G. was supported by a Human Frontier Science Program cross-disciplinary postdoctoral fellowship. We also thank members of the Gore Lab for helpful discussions.

## Author information

### Author notes

1. These authors contributed equally: Shreyas Gokhale, Arolyn Conwill.

### Affiliations

1. #### Physics of Living Systems, Department of Physics, Massachusetts Institute of Technology, Cambridge, MA, 02139, USA

• Shreyas Gokhale
• , Arolyn Conwill
•  & Jeff Gore
2. #### John A. Paulson School of Engineering and Applied Sciences, Harvard University, Cambridge, MA, 02138, USA

• Tanvi Ranjan

### Contributions

A.C. and J.G. designed the research; S.G. and T.R. performed the experiments; S.G. and A.C. developed models; S.G. and A.C. analyzed data; and S.G., A.C., and J.G. wrote the paper.

### Competing interests

The authors declare no competing interests.

### Corresponding author

Correspondence to Jeff Gore.