Fluctuating Environments Maintain Genetic Diversity through Neutral Fitness Effects and Balancing Selection

Abstract Genetic variation is the raw material upon which selection acts. The majority of environmental conditions change over time and therefore may result in variable selective effects. How temporally fluctuating environments impact the distribution of fitness effects and in turn population diversity is an unresolved question in evolutionary biology. Here, we employed continuous culturing using chemostats to establish environments that switch periodically between different nutrient limitations and compared the dynamics of selection to static conditions. We used the pooled Saccharomyces cerevisiae haploid gene deletion collection as a synthetic model for populations comprising thousands of unique genotypes. Using barcode sequencing, we find that static environments are uniquely characterized by a small number of high-fitness genotypes that rapidly dominate the population leading to dramatic decreases in genetic diversity. By contrast, fluctuating environments are enriched in genotypes with neutral fitness effects and an absence of extreme fitness genotypes contributing to the maintenance of genetic diversity. We also identified a unique class of genotypes whose frequencies oscillate sinusoidally with a period matching the environmental fluctuation. Oscillatory behavior corresponds to large differences in short-term fitness that are not observed across long timescales pointing to the importance of balancing selection in maintaining genetic diversity in fluctuating environments. Our results are consistent with a high degree of environmental specificity in the distribution of fitness effects and the combined effects of reduced and balancing selection in maintaining genetic diversity in the presence of variable selection.


Introduction
Genetic variation is essential for adaptive evolution as it provides the material upon which selection acts. The level of genetic diversity within a population is the sum of processes that act to increase variation, such as mutation and gene flow, and decrease variation, such as selection and genetic drift. Genetically heterogeneous populations are composed of individuals with varying fitness values and are characterized by a distribution of fitness effects (DFE). How selective environmental conditions interact with a population's gene pool to contribute to evolutionary dynamics is one of the central questions in evolutionary biology (Bell 2008). In the simplest scenario, comprising a single fitness component (i.e., a single selective force) and individual genetic differences between otherwise isogenic genotypes, the DFE can reliably predict the dynamics of adaptive evolution. However, the impact of variable selective conditions, which result from variation in the environment, on the DFE, the dynamics of selection, and the corresponding impact on genetic diversity is poorly understood.
In natural and engineered environments, organisms frequently encounter fluctuating selection in the form of physical or biotic factors (Bell 2010;Nguyen et al. 2020). Environmental fluctuations occur with a range of properties including their frequency and predictability. Diurnal environmental fluctuations occur with regular periods, whereas temperature variations occur aperiodically throughout the day. Periodic environmental fluctuations comprise an enormous range of timescales and patterns ranging from hours, as is the case with the intestinal environment (Schlomann and Parthasarathy 2019), to millenia, as with the timing between glacial periods. The prevalence of periodic fluctuations at different time scales and in diverse environments suggests that our understanding of how evolution has shaped extant organisms and our ability to predict the future outcomes of adaptation requires understanding how organisms respond to periodic environmental change.
Environmental change imposes selection on the phenotype of individuals within a population and can elicit both a physiological response and alterations in the composition of the population gene pool. Physiological adaptation entails metabolic and gene regulatory responses to environmental cues that enable the organism to cope with changes in external conditions. How organisms physiologically adapt to environmental conditions affects their fitness which in turn determines the dynamics of genetic selection. Therefore, to understand the impact of fluctuating environments on the outcomes of evolution, both physiological adaptation and genetic selection must be considered.
The mode of physiological adaptation varies with the characteristics of the fluctuating environment. Environmental fluctuations can differ either in frequency, magnitude, or predictability. Physiological adaptation in response to regularly repeating and predictable fluctuations occurs through anticipatory behavior such as memory-dependent responses in which prior exposure to an environment alters responses during future encounters (Guan et al. 2012;Razinkov et al. 2013;Lambert and Kussell 2014), or programmed oscillatory behavior in which the organism cyclically responds through internal clock mechanisms (Johnson and Golden 2006). Conversely, fluctuations that occur at random intervals may favor strategies that do not rely on forecasting future environmental conditions, such as sense-and-response (Uschner and Klipp 2014) or bet-hedging strategies (Olofsson et al. 2009;Childs et al. 2010;Levy et al. 2012). The frequency of environmental fluctuation with respect to generation time is also a key determinant of mode of physiological adaptation; if the fluctuations are extremely rapid with respect to generation time, an organism may sense a time-averaged condition, whereas extremely slow oscillations with respect to generation time may result in organisms experiencing effectively static conditions (Cvijovi c et al. 2015;Lin and Kussell 2016). These observations highlight the complex relationship between the environment and its effect on individual response and fitness.
The dynamics of genetic selection in fluctuating environments have a variety of theoretical expectations informed by evolutionary biology and ecology. Balancing selection, defined as any type of selection that maintains polymorphism in a population, can explain the maintenance of genetic diversity in temporally varying environments. Fluctuations with periods over multiple generations can select for the coexistence of genotypes specialized to each of the two environments (Bergland et al. 2014;New et al. 2014) an ecological phenomenon known as the "Temporal Storage Effect" (Chesson 1994;Tan et al. 2017;Letten et al. 2018). In the extreme case, antagonistic pleiotropy, in which an allele that is beneficial in one condition is deleterious in another, can manifest between the different phases of a periodically fluctuating environment. By contrast, a neutralist view aims to explain the maintenance of variation in fluctuating environments by a combination of other processes such as mutation and the introduction of variation through migration (Hedrick et al. 1976;Bertram and Masel 2019). Theoretical analyses of fluctuating environments have suggested that the efficiency of selection can be reduced in variable environments (Cvijovi c et al. 2015). It has also been proposed that varying environments themselves can trigger increased mutation rate and thereby increase population diversity (Nelson and Masel 2018), or act as catalysts for evolution through more efficient phenotypic exploration (Kashtan et al. 2007).
Empirical approaches to studying selection in fluctuating environments present several challenges. In natural environments, experimental variables are difficult to control. Experimental evolution in a lab setting provides a potentially powerful approach and as such a number of studies have investigated the effect of fluctuating environments on adaptive evolution using experimental evolution of microbes (Cooper and Lenski 2010). In general, experimental microbial evolution studies in fluctuating environments have focused on genetically homogeneous populations and the effect of de novo mutation. However, a small number of studies have made use of genetically diverse populations to address the effects of environmental fluctuations (Salignon et al. 2018). To the best of our knowledge, all studies of microbial evolution performed under fluctuating conditions reported to date have used batch culture, which requires serial passaging and population bottlenecking, adding additional variables to the study design. The precise control of selection in batch culture is also challenging because nutrient concentration changes continuously with population expansion even when the culture medium is unchanged (Li et al. 2018).
To study the effect of environmental fluctuations on the dynamics of adaptive evolution, we used the chemostat to establish different selective regimes and study their effect on population genetic diversity and the DFE in Saccharomyces cerevisiae. We used synthetic populations consisting of the pooled nonessential haploid gene deletion library ($4,000 unique genotypes) and quantified population composition using barcode sequencing (barseq). We characterized fluctuating environments in the chemostat using both experimental studies and mathematical modeling. We find that switching environments, in which nutrient concentration fluctuates, maintain greater genetic diversity than static environments. Increased genetic diversity in fluctuating environments results from the absence of a small number of highly fit and specialized genotypes that rapidly dominate populations evolving in static conditions and an enrichment in fluctuating environments of genotypes with neutral fitness effects. Many genotypes show nonlinear and nonmonotonic responses (log abundance vs. time) to both static and fluctuating selection, but fluctuating environments uniquely select for a class of genotypes with oscillatory growth behavior. Oscillatory behavior contributes to large short-term fitness effects that are not observed over the long term. Our study highlights the importance of environmental variability in evolutionary dynamics and provides a framework for modeling evolutionary scenarios that better reflect natural environments.

Results
The empirical study of adaptive evolution requires consideration of both the selective conditions and the heritable variation in a population. In this study, we combined continuous culturing using chemostats (Gresham and Dunham 2014;Gresham and Hong 2015) and the S. cerevisiae haploid Fluctuating Environments Maintain Genetic Diversity . doi:10.1093/molbev/msab173 MBE nonessential gene deletion collection to study the effect of temporally fluctuating selection on standing genetic variation.

Modeling Nutritional Fluctuations in Chemostats
Chemostats operate through the continuous addition of fresh medium and removal of culture at the same rate ( fig. 1A). We focused on two static conditions, carbon-limitation (low carbon, high nitrogen) using glucose as the sole carbon source and nitrogen-limitation (high carbon, low nitrogen) using ammonium sulfate as the sole nitrogen source. We also constructed a periodically fluctuating condition in which the medium was switched between the two nutrient limiting conditions ( fig. 1B). In this switch condition, the feed media alternate between the carbon-limiting and nitrogen-limiting media every 30 hours and the change in the feed media is instantaneous. We used the standard chemostat model (Monod 1950;Novick and Szilard 1950) to predict changes in nutrient concentration for single-nutrient limitation. We extended this model (Materials and Methods) to incorporate temporal fluctuations in nutrient concentration and constrained cellular growth with a parameter for a second nutrient (Boer et al. 2010) to account for both changes in carbon and nitrogen concentrations.
We first modeled nutrient concentrations in the chemostat in the absence of cells to study the effect of dilution alone. , or media that switched between the two nutrient-limiting conditions every 30 hours (i.e., a period of 60 hours). All selections were maintained for a total of 240 hours. (C) An ordinary differential equation model was used to determine the expected concentrations of glucose (white), the sole carbon source, and ammonium sulfate (black), the sole nitrogen source, in the culture vessels in the absence of cellular consumption. (D) We experimentally measured glucose (white) and ammonium sulfate (black) concentrations in each of the culture vessels to determine the contribution of cellular consumption to environmental nutrient concentrations. Measured values of glucose in C-lim and ammonium sulfate in N-lim are close to (low micromolar range), but not equal to, zero. MBE Whereas a single limiting nutrient results in a constant nutrient concentration, switching the media results in oscillations in nutrient concentration in the growth vessel that follow first-order (exponential) kinetics despite instantaneous switches in the feed media ( fig. 1C). We then inoculated chemostats with a single wild-type genotype and measured ammonium sulfate and glucose concentrations in each of the culture vessels during steady-state cellular growth to determine the effect of cellular consumption on nutrient concentration in the chemostat ( fig. 1D). As expected, in all cases cellular consumption results in reduced nutrient concentrations in the chemostat. In the switch condition, we find that the ammonium sulfate concentration oscillates between maximal and minimal levels that are equivalent to those observed in the two static conditions (t ¼ À0.24367, P ¼ 0.5461). By contrast, the maximal glucose concentration in the switch condition is significantly reduced compared with glucose levels observed in static nitrogen-limitation once the oscillations commence (t ¼ 10.875, P ¼ 0.00835). This suggests that cells that have been previously exposed to growth-limiting levels of glucose exhibit increased glucose consumption in glucose-rich conditions compared with cells that have not previously experienced growth-limiting glucose concentrations. This memory-like response may be due to the sustained expression of high-affinity glucose transporters, induced by exposure to growth-limiting glucose concentrations in the previous phase, during the ammonium sulfate limited phase (Buziol et al. 2008;Rintala et al. 2008).
We also considered an additional type of fluctuating environmental condition that differs in frequency and form. This fluctuation consisted of growth in steady-state ammonium sulfate limiting conditions to which a bolus of 80 lM nitrogen, in the form of either ammonium sulfate or glutamine, was provided every 3 hours. This minor environmental perturbation, which we refer to as a "pulse," has previously been employed in studying transcriptional responses to environmental perturbation (Ronen and Botstein 2006; Airoldi et al. 2016). Prior mathematical modeling of chemostat pulses indicates that they result in a transient perturbation of the environment that rapidly returns to the steady-state condition (Airoldi et al. 2016).

Selection on Heterogeneous Populations in a Chemostat
We sought to quantify the dynamics of thousands of genotypes in static and fluctuating environments using chemostats. Classical chemostat theory holds that through the process of continuous growth and dilution, a chemostat attains a steady state in which both the population size and concentration of the growth rate limiting nutrient are constant (Monod 1950;Novick and Szilard 1950;Kubitschek 1970). At steady state, the population mean exponential growth rate constant (k) is equal to the chemostat dilution rate (b). However, competition for the limiting resource between the thousands of genotypes present in our experiments means that growth rates differ between genotypes. In our experiment, the growth rate of an individual genotype i, k i , is defined as the fitness of genotype i. Fitness differences across genotypes result in corresponding changes in population proportions over time. Intuitively, one might think that the changing proportions of genotypes would preclude the constancy of the population growth rate. How can the constancy of the population growth rate in the chemostat (k ¼ b) be reconciled with the presence of thousands of distinct genotypes with different fitness effects?
To address this question, we modeled the growth of 4,000 genotypes in a nutrient-limited chemostat based on a straightforward extension of the two-genotype model of competitive growth in a chemostat from (Dean 2005) (supplementary methods, Supplementary Material online). As with Dean's two-genotype model, we find that the total population size and concentration of the limiting nutrient do in fact change as selection acts on the different genotypes. However, these changes are negligible following an initial transient period. We find that in the case of a static environmental selection in the chemostat, the genotype proportions change until a steady state is ultimately achieved in which only a single growth rate constant remains in the chemostat. In this new steady-state condition, the population size is slightly increased and the growth-limiting nutrient concentration is slightly decreased relative to the initial conditions (supplementary fig. 1, Supplementary Material online). As the period during which selection takes place is not a true steady state, we refer to the selection during this time period as occurring in quasi steady-state conditions.
We also applied the Price equation in the continuous form (Day et al. 2020) to this scenario and found that the population growth rate cannot be exactly constant until the overall steady-state condition above is achieved (supplementary fig.  1, Supplementary Material online). Examination of the Price equation shows that the evolution of the population growth rate is driven by the variance of the growth rate and the rates of change of genotype fitness (supplementary methods, Supplementary Material online).

Fluctuating Environments Maintain Greater Genetic Diversity
The DFE quantitatively describes the proportion of variants in a population that are advantageous, neutral, or deleterious, compared with the arithmetic mean fitness of the population. The shape of the DFE is influenced by several factors including the type of species, population size, and genome size (Eyre-Walker and Keightley 2007). Whereas both theoretical (Connallon and Clark 2015) and experimental (Cooper and Lenski 2010;Hietpas et al. 2013;Blundell et al. 2019) studies have investigated the effect of a variety of environments on the DFE, the effect of temporal environmental variation on the DFE remains largely unknown. Moreover, the consequences of variable selection on the maintenance of genetic diversity are poorly understood.
To address the effect of variable selection on the DFE and genetic diversity, we used an isogenic single-gene deletion library to compare selection in static and fluctuating environments. The presence of unique molecular barcodes enables the identification of $4,000 genotypes using quantitative DNA barseq (Delneri 2010). We used the haploid gene   (Drake et al. 1998), we would expect 0.108 mutations/genome over 40 generations. Consistent with this expectation, after filtering sequencing libraries (supplementary fig. 2A  To test the effect of environmental variability on population diversity, we estimated the normalized abundance of each genotype at each time point in each condition (supplementary methods, Supplementary Material online). We quantified the temporal change per unit time (in hours) rather than per generation to enable direct comparison between conditions as population growth rates in fluctuating chemostats are not necessarily determined by the dilution rate as they are in static conditions. We quantified population diversity using Shannon's diversity index, which takes into consideration the richness of genotypes and the evenness of their abundances. We find that the static carbon-limiting and nitrogen-limiting conditions display rapid declines in diversity in comparison to the switch condition ( fig. 2B). To test the generality of this effect, we applied the same analysis to the two pulse conditions. In the presence of pulsed perturbations, populations also maintained greater genetic diversity across time suggesting that this feature may be generalizable to different frequencies and forms of environmental fluctuation (supplementary fig. 3, Supplementary Material online). We found that diversity estimates are not significantly affected by barcode library size (Pearson's r ¼ 0.106, P value ¼ 0.218) (supplementary fig. 4, Supplementary Material online) excluding confounding effects of library size on diversity metrics. In addition, population richness does not appear to undergo large changes over time in any selection regime suggesting that differences in diversity are largely driven by changes in evenness (supplementary fig. 5, Supplementary Material online). All selections resulted in some degree of genotype extinction, defined by the absence of a genotype in one or more terminal time points. However, we did not identify a common set of extinct genotypes across all conditions (supplementary fig. 6, Supplementary Material online).
To test if differences in the rate of change in genetic diversity are associated with differences in fitness effects, we computed the DFE for each condition. To quantify fitness over a given time interval (t1, t2), we use the temporal mean growth rate per cell minus the arithmetic mean over all genotypes. This is given by the difference between the log of normalized abundance at the two time points divided by the time difference (supplementary methods, Supplementary Material online). By using the chemostat, the population exponential growth rate constant is set at 0.12 hr À1 , which is equal to the population mean growth rate over all genotypes to the extent that the total number of cells in the chemostat remains constant (supplementary methods, Supplementary Material online). We calculated average genotype fitness using the first (t ¼ 0 hours) and last (t ¼ 240 hours) time point. The DFEs in each condition have similar distributions characterized by a unimodal distribution centered around neutral relative fitness ( fig. 2C). The DFE in all three conditions comprises primarily neutral genotypes with tails reflecting deleterious and beneficial genotypes relative to the mean population fitness. This property also holds for pulse fluctuations ( The presence of a single particularly high-fitness genotype results in a contrasting population compositions following 240 hours of selection. In both static selection conditions, a single highly fit genotype comprises over 50% of the population at the terminal timepoint ( fig. 2D). By contrast, the maximal frequency of the highest fitness genotype is only 3% in the switch condition (supplementary table 2, Supplementary Material online). In pulse fluctuations, the increased frequency of a small number of genotypes in the populations is apparent; however, this effect is reduced compared with static conditions (supplementary fig. 7 and table 2, Supplementary Material online). These results point to a clear causal relationship between the presence of a single highfitness genotype and a rapid reduction in genetic diversity in static environments in which a single dominant selective pressure acts.
To test the generality of our observations, we analyzed the data set of Salignon et al. (2018) who studied the single-gene deletion library in two types of fluctuating environments using serial batch cultures and bottlenecking. In one of the fluctuating conditions (temporal variation in methionine concentration), we observed the same trend as our study. However, in the case of environments that fluctuate in salt concentration, we find the opposite trend (supplementary fig.  8, Supplementary Material online). In this case, it is possible that specific gene deletions (e.g., CIN5D/D, YOR029WD/D, SRFI1D/D) are uniquely able to respond to the fluctuation in salt concentration. Alternatively, the distinct nature of the environmental change in our study, which changes gradually in the case of the switch or transiently in the case of the pulse, compared with the instantaneous change of Salignon et al.'s experimental design may be an important factor. This is consistent with prior work suggesting that gradually changing environments result in greater clonal interference than instantaneously changing environments in which mutations of large beneficial effect are more likely to fix early (Morley and Turner 2017).

Genotypes Exhibit Distinct Frequency Dynamics
Whereas it has been widely demonstrated that cells exhibit rapid transcriptional (Gasch et al. 2000;Ronen and Botstein 2006;Airoldi et al. 2016;Spies et al. 2019) and physiological responses to changes in the environment (Bresson et al. 2020), the sensitivity of growth rate to environmental changes is less well studied. We sought to quantitatively describe the high-resolution changes in genotype frequency across time for each genotype in each condition. The temporal dynamics of a genotype in a population is a result of both the externally imposed environmental selective pressure and the response to selection by all genotypes in the population. To characterize the dynamics of each genotype, we performed hierarchical model fitting for each genotype using a model in which the log of the normalized barcode count from all ten time points is a polynomial function of time (supplementary methods, Supplementary Material online). We explored the suitability of four distinct models of log normalized abundance versus time-linear, quadratic, cubic, and periodic. We quantified their applicability by starting with the most complex model and performing iterative model simplification using the log ratio of maximum likelihood test (supplementary methods, Supplementary Material online).
We observed a variety of distinct genotype dynamics. We find that between 10% and 30% of genotypes ( fig. 3F) do not show a significant change in normalized abundance ( fig. 3A) over the duration of the experiment. For these genotypes, the growth rates are not significantly different from the arithmetic mean over all genotypes. The prevalence of these genotypes is consistent with the greatest density of genotypes having a relative fitness of zero ( Our frequent sampling regime enables the detection of genotype growth rate dynamics with high resolution. To that end, we tested whether genotypes show oscillatory behavior across the experiment (supplementary methods, Supplementary Material online). We detect evidence for strong enrichment of periodically oscillating changes in genotype growth rate per cell ( fig. 3E) that is unique to the switch condition ( fig. 3F and supplementary fig. 9A, Supplementary Material online). For these genotypes, the growth rate oscillates with a period that matches the period of environmental change imposed by switching the feed media to the chemostat. These genotypes include both positive and negative phases (i.e., with 180-degree difference). This behavior suggests a class of genotype that is acutely sensitive to variation in the environmental condition. To the best of our knowledge, there are few cases in which such oscillations in genotype frequencies have been observed. One notable case is the oscillatory behavior of genotypes that have been observed over seasonal fluctuations in Drosophila populations (Bergland et al. 2014;New et al. 2014;Machado et al. 2021). In addition, high-resolution sequencing of the "Lenski lines" identified genotype oscillations in evolving Escherichia coli populations; however, this behavior eluded explanation (Good et al. 2017). Our finding suggests that such oscillations are potentially diagnostic of periodic variation in the environment. The 700 genotypes that comprise this class of behavior in our study do not show significant enrichment for specific functions.
Nonmonotonic behavior of genotypes may be the result of biological phenomena (e.g., environmental variation, genotype interactions, and density-dependent selection) or a consequence of data analysis methods. To test whether the highest frequency genotypes impact the apparent dynamics of other genotypes in the population, we computationally removed their barcodes from sequencing data and repeated our complete analysis. We find that excluding the top-performing genotype has a minimal effect on the identified nonmonotonic growth behavior of the remaining genotypes (supplementary fig. 9B, Supplementary Material online). As expected, the same manipulation has drastic effects on diversity metrics in static conditions, but only a minimal effect on the results observed for fluctuating conditions (supplementary fig. 3, Supplementary Material online).
Fluctuating environments are enriched for genotypes that do not show a significant change in growth rate in comparison to static conditions ( fig. 3F and supplementary fig. 9A, Supplementary Material online). This observation along with the unique oscillating genotypes point to two ways in which greater diversity is maintained in fluctuating conditions: 1) a larger fraction of genotypes have neutral fitness effects and 2) large fitness effects over short time spans undergo reversals in the direction of selection before they have a chance to dominate the population or go extinct.

Environmental Fluctuations Select for Specific Mutant Classes
To identify the biological pathways and processes that contribute to increased fitness in each condition, we performed gene set enrichment analysis (Subramanian et al. 2005) using the ranked fitness measurements for each condition. We find that constant carbon-limitation selection results in the positive selection of gene deletion mutants with functions in carbon metabolism (supplementary fig. 10, Supplementary Material online). The highest fitness genotype is deletion of MTH1, which has previously been reported as a target of selection in experimental evolution in glucose-limited chemostats (Kvitek and Sherlock 2011). In static nitrogenlimited chemostats, we find enrichment for genotypes with functions in nitrogen metabolism (supplementary fig. 10, Supplementary Material online). The highest fitness genotype is deletion of GAT1, which we have previously identified as Abdul-Rahman et al. . doi:10.1093/molbev/msab173 MBE conferring a fitness advantage in ammonium-limited chemostats (Hong and Gresham 2014;Hong et al. 2018). Interestingly, in our previous studies, we identified GAT1 hypomorphs as beneficial, but de novo null mutations in GAT1 were not identified.
We identified enrichment for distinct gene functions that are unique to the switch condition. Specifically, deletions in genes that encode components of the endoplasmic reticulum-associated degradation (ERAD) pathway including HRD1, HRD3, USA1, and DER1 exhibit uniquely high fitness in the switch condition (supplementary fig. 11, Supplementary Material online). The ERAD complex is responsible for degrading misfolded proteins in the endoplasmic reticulum. Loss of ERAD function may be uniquely beneficial in fluctuating conditions as decreased rates of protein degradation may facilitate the persistence of proteins across conditions thereby serving as a type of "memory" response.
The periodic addition of excess nutrients in the pulse conditions results in the enrichment of both unique functions and functions that are enriched in the static conditions (supplementary fig. 10, Supplementary Material online). This suggests that transient environmental perturbations serve to both reduce the strength of selection and select for a unique class of genotypes.

Fitness Relationships between Conditions
The fitness of a given genotype varies as a function of selection. We asked whether genotype behavior under static selective conditions is predictive of fitness in a fluctuating environment. We find that the correlation between relative fitness in the two static conditions is low (fig. 4A). The correlation between relative fitness in the carbon-limited and switch condition ( fig. 4B) and between the nitrogen-limited and switch condition are somewhat higher ( fig. 4C). We tested the simple model that fitness in a fluctuating environment is the mean of fitness in the two corresponding static conditions. We found that the correlation between the relative fitness in the switch condition and the mean of relative fitness in nitrogen-limited and carbon-limited conditions was only slightly increased compared with the correlation between each static condition and the switch condition fitness estimates ( fig. 4D).

Switching Conditions Harbor the Highest Short-Term Growth Rates
To further understand how genotype behavior is affected in fluctuating conditions, we compared short-term fitness effects with long-term fitness effects. Because we identified nonmonotonic growth behavior, we calculated the piecewise fitness, defined as the mean relative fitness values between consecutive time points, in the static and switch conditions. We find that whereas the temporal average relative fitness across the full-time course shows minimal differences in DFE between conditions ( fig. 2C), the piecewise DFE is highly distinct between time points and conditions ( fig. 5A). Whereas static conditions select for genotypes with the highest average growth rate across the full-time course, the switching environment results in the largest short-term fitness values. We computed the variance in fitness at each time point and found that static conditions have a unique U-shaped variance pattern in contrast with the switch condition, which showed oscillating piecewise fitness variance ( fig. 5B). The large differences in variance in fluctuating conditions are explained by the behavior of the periodically oscillating genotypes, which have the highest piecewise fitness values across all growth behaviors ( fig. 5C). Periodically oscillating genotypes are not a uniform group as we identified four clusters of genotype behaviors. Three of the four clusters have unique overrepresented GO-terms suggesting functional coherence among these genotypes ( fig. 5D).

Discussion
In this study, we investigated the effect of nutritionally fluctuating environments on genetic diversity and the DFE. We use the S. cerevisiae haploid gene deletion library to study evolutionary dynamics in populations with a high genetic diversity. We find that genetic diversity is greatly reduced in static environments compared with fluctuating environments. Our results support the idea that static environments impose stronger selection whereas fluctuating environments reduce the efficiency of selection (West and Mobilia 2020). By testing two distinct classes of periodic environmental fluctuation, we demonstrate that this result holds for 1) an environment that switches between selective conditions and 2) an environment that is transiently perturbed. This suggests that increased genetic diversity may be a feature of fluctuating selection. We find that the maintenance of genetic diversity in fluctuating environments is a result of a combination of factors. First, genotypes with neutral fitness effects are enriched in fluctuating environments. Second, fluctuating environments contain a unique class of genotypes that oscillate in frequency with the same period as the environmental change. Although this class includes genotypes with the highest and lowest short-term fitness effects, the periodic reversal in the direction of selection ensures their maintenance at intermediate frequencies in the population, consistent with balancing selection. Third, the absence of genotypes with extreme long-term fitness effects in fluctuating environments is in striking contrast to static environments that are characterized by a single genotype with a large positive fitness effect that rapidly increases in frequency in the population. There has been considerable debate whether genetic diversity is primarily maintained through neutral fitness effects or through balancing selection (Hedrick et al. 1976). Our findings show that both balancing selection and neutral fitness effects contribute to the maintenance of genetic diversity in fluctuating environments.
It is remarkable that in both static conditions that we studied a single genotype underwent a selective sweep in the population. Further studies that experimentally test the effect of excluding these high-fitness genotypes from evolving populations would provide insight into whether these dynamics are unique to the GAT1D0 genotype, in ammonium sulfate-limitation and MTH1D0 genotype, in glucoselimitation. We sought to minimize the contribution of de novo mutations to the dynamics of selection by limiting the duration of experiments to 40 generations; however, it remains possible that additional genetic variation contributes to the observed dynamics. Nonetheless, we believe that de novo variants are unlikely to confound our findings as our experimental design included three biological replicates and removal of replicate data that showed low correlation with other replicates (supplementary fig. 2, Supplementary Material online).
We also identified a class of mutants that had uniquely high fitness in the switch condition. Six unique genotypes, in which a different gene encoding a component of the endoplasmic-reticulum-associated protein degradation pathway was deleted, had increased fitness in the switch condition compared with the static C-lim and N-lim conditions. Decreased protein degradation may facilitate a form of molecular memory illustrating that genetic adaptation can act to enhance physiological adaptation in fluctuating environments. Identification of a coherent set of genotypes that provides possible insight into the molecular basis of adaptation in fluctuating environments underscores the value of using a complex library comprising thousands of genotypes.
Our study has focused on a single mutation type and it remains possible that our results are specific to single-gene Abdul-Rahman et al. . doi:10.1093/molbev/msab173 MBE deletions. However, several lines of evidence make this unlikely. First, previous studies of selection in chemostats have made use of different classes of mutations in S. cerevisiae, including strains with low-copy and high-copy plasmids as well as single-gene deletions and observed variation in the DFE depending on the selective conditions (Payen et al. 2016;Lauer et al. 2018). Second, the dominance of a single genotype in static selective conditions in the chemostat is consistent with the highly reproducible role of de novo copy number variants of nutrient transporter genes in experimental evolution (Payen et al. 2016;Lauer et al. 2018). Third, the similarities between our observations and those in natural populations of Drosophila melanogaster (Rudman et al. 2021) that exhibit seasonal fluctuations in allele frequencies support the generality of our findings.
Finally, we show that average fitness over long time spans can conceal a large variety of genotype behaviors in a population. Typically, fitness is estimated assuming monotonic behavior (Wiser and Lenski 2015) although a few studies have recently identified curvilinear dynamics (Schlecht et al. 2017). Our results suggest that the assumption of monotonic behavior is incorrect especially when considering population dynamics encompassing hundreds of unique genotypes, which is more representative of dynamics in natural populations (Wiser and Lenski 2015;Landis et al. 2021). This is the case even in static selective conditions. More complex selective regimes that result from environmental fluctuations can result in more complex genotype dynamics as illustrated by the unique class of oscillating genotypes identified in our study.

MBE
The approach that we have introduced in this study can readily be extended to address related questions. For example, the chemostat allows systematic variation in the strength of selection by varying the steady-state nutrient concentrations through control of the dilution rate. In addition, exploration of the effect of increased and decreased periods of fluctuations would enable direct assessment of how the oscillatory period impacts genetic diversity.

Media
For all experiments, media consisted of defined minimal media supplemented with salts, metals, minerals, and vitamins (Saldanha et al. 2004;Brauer et al. 2008;Airoldi et al. 2016). For carbon-limited (C-lim) media, we added 0.08% glucose and 37 mM ammonium sulfate. For nitrogen-limited (N-lim) media, we added 2% glucose and 400 lM ammonium sulfate. Static conditions used a single media source throughout the experiment. For the switch condition, we used a tube connecting the two feed media to a culture and alternated between the two media sources every 30 hours by manually clamping one inlet and opening the other. For pulse experiments, we used the automated Sixfors chemostat system to deliver a bolus of either 40 lM L-glutamine (Pulse-Gln) or 40 lM ammonium sulfate (Pulse-AS) every 3 hours throughout the experiment.

Experimental Measurements of Model Parameters
Measurements were taken at time points 2.5 prior to switch, then at 17, 35, 44, 59.5, and 75.5 hours relative to the end of the first N-lim phase. This sampling scheme was chosen to capture the dynamics right after the first switch. Glucose was measured using the r-Biopharm Glucose kit. Ammonia was measured using the QuantiFluo Ammonia/Ammonium Assay Kit. Cell density and cell size were measured using a Coulter Counter.  Population growth rate and the rate of change in the limiting nutrients glucose, and ammonium sulfate were modeled using the following system of ordinary differential equations.
@S as @t ¼ ÀS as Á D þ R as Á D À X Y as Á u max Á 1 1 þ K as S as þ K g S g (1) With the following parameters: D, the dilution rate of the culture (culture volumes/hr); X is the cell density (cells/ml), Y is the yield (cells/ml/mole of the limiting nutrient), l max is the maximal growth rate constant (hr À1 ), R is the concentration (lM) of the limiting nutrient in the medium, and S (lM) is the growth-limiting nutrient concentration in the chemostat. Equation (1) describes the changes in ammonium sulfate concentration over time. Equation (2) describes the change in glucose concentration over time. Equation (3) describes the change in cell density over time. To study the effect of our experimental design for switching environments, we performed numerical calculations with cell number (X) set to zero.

Culturing Conditions
Library construction was performed as described in Sun et al. (2020). An aliquot (1.7 Â 10 9 cells/ml of the pooled prototrophic gene deletion collection (VanderSluis et al. 2014) was thawed and 118 ll were inoculated into triplicate chemostats with 200 ml media for each condition. We estimate that this results in inoculation of the culture with 1 Â 10 4 cells of each of the 4 Â 10 3 genotypes. Cultures grew in batch mode overnight at 30 C to allow cells to reach high density (3 Â 10 7 cells/ml). The first sample was collected and then the media feed pumps were turned on and tuned to a dilution rate of 0.12 hr À1 to switch cultures to continuous growth. Samples were collected every 24 hours by passive sampling from the chemostat outlet for a total of 240 hours. Cell pellets were stored in À80 C in a cell storage solution (0.9 M sorbitol, 0.1 M EDTA, 0.1 M Tris). DNA extractions were performed using the Hoffman Winston DNA prep (Hoffman and Winston 1987). PCR amplification of barcodes of each sample was performed by using a universal primer and an indexed primer (Robinson et al. 2014). The P5 illumina adapter was incorporated to all samples. Barseq libraries were sequenced on a 1 Â 75 bp run on an Illumina NextSeq500.

Analysis of Barseq Data
Barseq analysis was performed as previously described (Robinson et al. 2014). Briefly, barseq reads were matched to their corresponding genotypes using Barnone. Reads with base-pair mismatches greater than 0 were excluded from the analysis. Libraries with less than 100,000 total read counts were removed (supplementary fig. 1A, Supplementary Material online). Uptags and downtags for each genotype were summed and genotypes with aggregate counts across all conditions with less than 1,000 were also removed (supplementary fig. 1B, Supplementary Material online). DEseq2 was used to normalize libraries (Love et al. 2014).

Mathematical Modeling of Genotype Behavior
A detailed description of methods used for both data analysis and theoretical studies is provided in the supplemental methods. Throughout, we define the following terms: • Growth rate: the change in population size between two time points, divided by time. • Instantaneous growth rate: the derivative dn/dt. • Per capita (per cell) rate of change: growth rate normalized by population size and accounted for by both cell divisions and cell death. • Per capita (per cell) growth rate: same as per capita (per cell) rate of change where cell death is negligible. • Piecewise growth rate: the growth rates between all consecutive time points based on the predicted values.

Supplementary Material
Supplementary data are available at Molecular Biology and Evolution online.