Frequency of AbaR islands in fluctuating environments favoring adaptation by allelic transfer. Results of simulations of the competition between the three types of AbaR islands, which differ in their insertion strategy. Environmental fluctuations have two components: the bacterial population is exposed to stochastic stress 1 (to which resistance is conferred by AbaR) and another environmental change 2 (to which advantage is conferred by a SNP acquired by allelic transfer). The gray boxes show the dynamics of environmental change 2. In panels (A–C), environmental change 2 corresponds to stochastic exposure to a new stress (stress 2) which from Top to Bottom are (A) rare and short (mean peak duration d = 40, mean peak frequency f = 2.5E-4), (B) frequent and long (mean peak duration d = 320, mean peak frequency f = 1E-3), and (C) frequent and long (mean peak duration d = 320, mean peak frequency f = 1E-3) over a short period (20,000 to 30,000 time units). Last, (D) environmental change 2 is not a stress but a change in resource availability occurring between 20,000 and 30,000 time units. The ratio of bacterial genotypes carrying AbaR was assessed as a function of stress 1 frequency and duration (panel A–D). The cost on fitness of the SNP conferring resistance to stress 2 was set at 0.1 (see SI Appendix, Fig. S4 for similar result with a fitness cost of 0.01). For each simulation (initial number of cells: AbaR-free = 1E6, initial number of each eDNA type = 1E7), we calculate the mean frequency of genotypes between times 30,000 and 50,000, and then calculate the mean of these frequencies from 50 independent simulations. Model parameters are listed in SI Appendix, Table S2.