## Abstract

Natural environments are seldom static and therefore it is important to ask how a population adapts in a changing environment. We consider a finite, diploid population evolving in a periodically changing environment and study how the fixation probability of a rare mutant depends on its dominance coefficient and the rate of environmental change. We find that, in slowly changing environments, the effect of dominance is the same as in the static environment, that is, if a mutant is beneficial (deleterious) when it appears, it is more (less) likely to fix if it is dominant. But, in fast changing environments, the effect of dominance can be different from that in the static environment and is determined by the mutant’s fitness at the time of appearance as well as that in the time-averaged environment. We find that, in a rapidly varying environment that is neutral on average, an initially beneficial (deleterious) mutant that arises while selection is decreasing (increasing) has a fixation probability lower (higher) than that for a neutral mutant as a result of which the recessive (dominant) mutant is favored. If the environment is beneficial (deleterious) on average but the mutant is deleterious (beneficial) when it appears in the population, the dominant (recessive) mutant is favored in a fast changing environment. We also find that, when recurrent mutations occur, dominance does not have a strong influence on evolutionary dynamics.

NATURAL environments change with time and a population must continually adapt to keep up with the varying environment (Gillespie 1991; Bleuven and Landry 2016; Messer *et al.* 2016). It is therefore important to understand the adaptation dynamics of a finite population subject to both random genetic drift and environmental fluctuations. This is, in general, a hard problem, but some understanding of such dynamics has been obtained in previous investigations. For example, when the environment changes very rapidly, on the time scale of a generation, the dynamics of adaptation are determined simply by the time-averaged environment (Gillespie 1991).

Environments can, of course, vary slowly and recent experiments have shown the impact of rate of change in the environment on the population fitness (Salignon *et al.* 2018; Boyer and Sherlock 2019). The fixation probability, fixation time, and adaptation rate in changing environments have also been studied in a number of theoretical studies (Takahata *et al.* 1975; Gillespie 1993; Assaf *et al.* 2008; Mustonen and Lässig 2008; Uecker and Hermisson 2011; Waxman 2011; Peischl and Kirkpatrick 2012; Cvijović *et al.* 2015; Dean *et al.* 2017), and it has been found that when the environment changes at a finite rate, population dynamics are strongly determined by the environment in which the mutant arose.

In diploid populations, the degree of dominance also affects evolutionary dynamics; in particular, in a static environment, the fixation probability of a dominant beneficial mutant is known to be higher than when it is recessive (Haldane’s sieve) (Haldane 1927), while the opposite trend holds if the mutant is deleterious (Kimura 1957). How these results are affected in changing environments is, however, not completely understood.

To understand the adaptive process in variable environments, Uecker and Hermisson (2011) developed a framework for general time-dependent selection schemes; however, their analysis was limited to very large populations and did not explicitly address how dominance affects the fixation process. In this article, we employ their formalism to study the dynamics of adaptation of a finite, diploid population evolving in an environment that changes periodically due to, for example, seasonal changes or drug cycling, with a particular focus on the impact of dominance. We find that, in time-dependent environments, the magnitude of the fixation probability of a rare mutant differs substantially from the corresponding results in the time-averaged environment. Furthermore, the dependence of the fixation probability on dominance coefficient can differ from that expected in the static environment depending on the rate of environmental change, the time of appearance of the mutant, and its fitness in the time-averaged environment. However, when recurrent mutations occur, our results for the average allele frequency and population fitness suggest that dominance does not have a strong influence on evolutionary dynamics.

## Model

We consider a finite, randomly mating diploid population of size *N* with a single biallelic locus under selection. The (Wrightian) fitness of the three genotypes denoted by *aa*, *aA*, *AA* is 1 + *s*, 1 + *hs*, 1, respectively, where the dominance coefficient 0 < *h* ≤ 1. The population evolves in a periodically changing environment that is modeled by a time-dependent selection coefficient where is the selection coefficient averaged over a period 2*π*/*ω*; in the following, we assume that is arbitrary but *σ* > 0. We ignore random fluctuations in the environment so that selection changes in a predictable fashion. Although dominance can evolve with time (Mayo and Bürger 1997), for simplicity, here we assume the dominance coefficient to be constant in time. We also allow mutations to occur with a constant, symmetric probability *μ* between the two alleles.

The population dynamics are described by a continuous time birth-death model. Although, in a finite population with overlapping generations, Hardy-Weinberg equilibrium (HWE) does not strictly hold, it is a good approximation when selection and mutation are weak and population size is large (Nagylaki 1992). In the following, we therefore work in these parameter regimes and assume that the population is in HWE immediately after mating (see also Supporting Information, Section S1). If the birth rate of an individual is given by its genotypic fitness and the death rate by one, the number of allele *a* (*A*) increases by one if it is chosen to give birth at rate equal to its marginal fitness, *w _{a}* (

*w*) and an allele

_{A}*A*(

*a*) is chosen to die. Taking the effect of mutations on these birth and death processes into account, we find that the rate

*r*and

_{b}*r*at which the number

_{d}*i*of allele

*a*increases or decreases, respectively, by one are given by(1)(2)where , is the population-averaged fitness and is the frequency of allele

*a*.

We study the model described above analytically using an appropriate perturbation theory and numerically through stochastic simulations in which the time interval Δ between successive generations, *t* and *t* + Δ is treated as a random variable. We first choose Δ from an exponential distribution with rate (the latter approximation is justified for small cycling frequencies as the correction to it is of order *ω*). Then the number of allele *a* and *A* is changed with a probability proportional to the rate of the respective event given above (Desai and Fisher 2007; Uecker and Hermisson 2011).

Below we first consider the weak mutation regime in which once a mutant has appeared in a clonal population, further mutations may be ignored until the mutant is fixed or lost; here, we are interested in understanding how the fixation probability of a rare mutant depends on various environmental and population factors such as the cycling frequency and dominance parameter. We also briefly explore the strong mutation regime in which recurrent mutations occur; our objective is to understand the effect of mutations and environmental fluctuations on population fitness and the dynamics of allele frequency.

## Fixation Probability of a Rare Mutant

In a static environment, the fixation probability of a mutant allele in a large population under weak selection and weak mutation with finite 2*Ns*, 2*Nμ* can be described by a backward Kolmogorov equation (Ewens 2004). For the model described in the last section, the probability *P*_{fix} that mutant allele *a* present in frequency *x* at time *t* fixes eventually is given by (Uecker and Hermisson 2011)(3)where dot denotes a derivative with respect to time and . On the right-hand side (RHS) of the above equation, the first term describes the deterministic rate of change in the allele frequency (Ewens 2004) and the second term captures the stochastic fluctuations due to finite population size. Since the left-hand side (LHS) of (3) is nonzero, it is *inhomogeneous* in time; that is, the eventual fixation probability depends on the time of appearance *t _{a}* (or phase ) of the mutant (Uecker and Hermisson 2011; Waxman 2011).

Equation 3 does not appear to be exactly solvable, and approximate methods such as perturbation theory require an exact solution of the unperturbed problem (σ = 0), which is not known in a closed form for nonzero (Kimura 1957; Jain and Devi 2020). Therefore to obtain an analytical insight, we study the fixation probability using a branching process for positive and analyze the above diffusion equation for using a time-dependent perturbation theory. Some numerical results for negative are also given. Before proceeding to a quantitative analysis, we first give a qualitative picture of the process in the following section.

### Qualitative features

In a static environment, a dominant beneficial (deleterious) mutant has a higher (lower) chance of fixation (Kimura 1957). In a changing environment, we expect that this result continues to hold when the mutant is beneficial or deleterious at all times [that is, when for the periodically changing *s*(*t*); see section S2]. But it is not obvious how dominance influences the fixation probability when the mutant is transiently beneficial or deleterious. Our results for the fixation probability in such situations are shown in Figures 1, 2 and 3 when the mutant arises in an environment that is beneficial, neutral, and deleterious on average, respectively.

In all these cases, in a slowly changing environment, the effect of dominance is found to be the same as in the static environment [that is, a dominant mutant that starts out as a beneficial (deleterious) one has a higher (lower) chance of fixation]. This is because when the environment changes infinitesimally slowly , as Figure 4A illustrates for on average neutral mutation, fixation occurs rapidly compared to the fluctuations in selection so that the sign of selection remains the same from origination to fixation of the mutant.

However, in rapidly changing environments , as Figures 1, 2, and 3 demonstrate, the impact of dominance on the fixation probability can be different from that in a static environment. For large cycling frequencies, although the fixation times are much longer than the time period of environmental change (see Figure 4B), the time of appearance still plays an important role in determining the chance of fixation as the mutant must escape the stochastic loss at short times (in fact, Figure 4B shows that the effect of random genetic drift is strongest in the first seasonal cycle). Then, a mutant that arises in an, on average, neutral environment while selection is positive but the selection strength is decreasing, will soon encounter an environment with negative fitness effects that affect a dominant mutant more adversely than the recessive one, leading to a lower chance of fixation of the dominant mutant. In an environment that is beneficial on average, if a mutant arises while selection is negative, it will spend relatively less time in the negative cycle, and therefore will effectively behave like a beneficial mutant, resulting in the behavior of the fixation probability different from that in the static environment; a similar argument holds when .

### On average beneficial mutant in a large population

When the mutant is beneficial on average and the population is large enough , one can use a branching approximation to find the fixation probability of a rare mutant. The basic idea is that a beneficial mutant will get fixed once it is present in finite frequency in the population, but it must survive the loss due to random genetic drift when it is initially present in small number compared to the population size. Then, the probability that number of *a* alleles are present at time *t* is governed by along with boundary condition where and are, respectively, per capita birth rate and death rate of the mutant in a large population. The probability of eventual fixation, is given by (Kendall 1948)(4)From (1) and (2), we obtain ; using these in (4), we find that(5)which reduces to (29) of Uecker and Hermisson (2011) for *ξ* = 1 when and (note that their expression contains a typographical error). Numerical studies of (5) have shown that the fixation probability is, in general, a nonmonotonic function of cycling frequency *ω* and strongly depends on the phase, (Uecker and Hermisson 2011; Peischl and Kirkpatrick 2012).

Equation 5 is analyzed in Appendix A for , and we find thatwhere . Since the fixation probability of a beneficial mutant with constant selection coefficient *s*_{0} is given by *hs*_{0} (Haldane 1927), the above expressions show that, for slowly changing environments, the fixation probability is determined by the selection coefficient of the mutant at the instant it arose, while for rapidly changing environments, it depends on the time-averaged selection coefficient (Gillespie 1993; Mustonen and Lässig 2008).

For , the mutant is beneficial at all times; in this case, the effect of a slowly changing environment is captured by the deviation from *hs*(*t _{a}*) in (6a), which changes linearly with the cycling frequency and is

*independent*of the dominance parameter. In contrast, for rapidly changing environments, the fixation probability (6c) is sensitive to dominance as the deviation from the asymptotic result depends on

*h*(also, see Supplemental Material, Figure S1). The inset in Figure S1 [also (6a) and (6c)] show that the dominant mutant has higher fixation probability than the recessive one at all cycling frequencies. In other words, Haldane’s sieve (Haldane 1927), which favors the establishment of beneficial dominant mutations in static environments, continues to operate in changing environments in which the mutant is beneficial at all times. Equation 6a and Equation 6c also emphasize the important role of the time of appearance of the mutant. If the beneficial mutant arises while the selection coefficient is increasing (decreasing) with time, the fixation probability at small cycling frequencies increases (decreases) with

*ω*and approaches the asymptotic value from above (below) at high cycling frequencies.

As explained in Appendix A, on equating the expressions (6a) and (6c), the fixation probability is found to have an extremum at a *resonance frequency*,(7)The above expression shows that a minimum or a maximum in the fixation probability occurs when the environment changes at a rate proportional to the average growth rate (Malthusian fitness), of the population. As already mentioned above, this extremum is a minimum if the mutant appears while selection is decreasing and a maximum otherwise. For the two special values, and , the fixation probability decreases and increases monotonically, respectively, with *ω*.

For the mutant is not beneficial at all times; in this case, the expression (6a) for small cycling frequencies holds if (see Appendix A). Otherwise, as the mutant is initially deleterious and arises in an infinitely large population, the fixation probability is essentially zero. As shown in Figure 1, the dominant mutant has a higher fixation probability than the recessive one at large cycling frequencies, irrespective of the time at which the mutant appeared [see also (6c)]. But at small cycling frequencies, the effect of dominance depends on whether the mutant is beneficial or deleterious when it originated: for positive (negative) *s*(*t _{a}*), the dominant (recessive) mutant is favored. For an initially beneficial mutant, as discussed above, the fixation probability changes nonmonotonically with cycling frequency, and the resonance frequency is given by (7). But it can exhibit an extremum for an initially deleterious mutant also (see Figure 1 for ). Note that the fixation probability curves intersect for different dominance curves, which can be estimated for large cycling frequencies as discussed in Appendix A.

To summarize, in an environment that is beneficial on average, the impact of dominance on fixation probability is different in slowly and rapidly varying environments if the mutant is deleterious when it appears in the population.

### On average neutral mutant in a finite population

We now calculate the fixation probability of an on average neutral mutant using the backward diffusion equation (3).

#### Small population:

We first consider a small population of size and analyze the and regimes in Appendix B and Appendix C, respectively. On using (B.8) and (C.2), we find that the fixation probability of allele *a* present in a single copy at time is given bywhere . The expression (8b) holds for any but for , it simplifies to(9)which monotonically approaches the fixation probability of a neutral mutant in a static environment. The above results show that the change in the fixation probability depends weakly on the dominance parameter when the environment changes slowly, but has a strong dependence on *h* in rapidly changing environments. The top panel of Figure 5 shows that the expressions (8a) and (8b) are in very good agreement with the simulation results, and suggests that the resonance frequency where the fixation probability has an extremum does not depend on the dominance coefficient. As detailed in Appendix C, we find that(10)and depends weakly on the dominance coefficient.

#### Large population:

We now consider large populations with size . For , as discussed in Appendix B, we find that in slowly varying environments,The above equations show that the fixation probability increases linearly with cycling frequency if the mutant arises while selection is increasing, but decreases otherwise. For positive , the magnitude of the slope is independent of *h* and *σ*, but varies with these parameters for *s*(*t _{a}*) ≤ 0. For large cycling frequencies , the fixation probability is given by (9) for any

*s*(

*t*), and approaches the asymptotic neutral behavior from above (below) when is positive (negative), with the fixation probability increasing (decreasing) with increasing

_{a}*h*. Thus, as shown in Figure 2, in an, on average, neutral environment, the impact of dominance depends on both

*s*(

*t*) and Figure 5 shows a comparison between our analytical and numerical results when the mutant appears at

_{a}*θ*= 0 (for other values of

_{a}*θ*, see Figure S2), and we find a good agreement.

_{a}Our perturbation expansions in Appendix B and Appendix C are not valid for intermediate cycling frequencies However, our numerical simulations suggest that, as for small populations, the resonance frequency scales as *N*^{−1} here also.

### On average deleterious mutant in a finite population

When a mutant is deleterious at all times its fixation probability is lower than that of a neutral mutant in both static and time-dependent environments, and the dominant mutant has a lower chance of fixation than the recessive one. But, when and , the mutant can be beneficial for some time in a periodically changing environment and its fixation probability can exceed the neutral value depending on the time of appearance. In the left panel of Figure 3, the selection coefficient *s*(*t _{a}*) <0, and, therefore, the recessive mutant, is favored at small cycling frequencies, while, in the right panel of Figure 3, since

*s*(

*t*) >0, the dominant mutant has a higher chance of fixation in slowly changing environments. In either case, at high cycling frequencies, the fixation probability of a recessive mutant is higher than that for a dominant mutant since the time-averaged selection coefficient is negative. Thus, when , the effect of dominance is different in slowly and rapidly changing environments when

_{a}*s*(

*t*) >0. We also note that in Figure 3A, there is a regime where the dominant mutant’s fixation probability exceeds that of the recessive mutant; however, the difference is quite small and a more detailed investigation is needed to evaluate the importance of this effect.

_{a}## Average Allele Frequency and Population Fitness

We now turn to the strong mutation regime where and briefly study the dynamics of the allele frequency in changing environments. For , the frequency distribution Φ(*x,t*) of allele *a* under changing selection, mutation, and random genetic drift obeys the following forward Kolmogorov equation (Ewens 2004),(12)where the mutation term and, as before, The above equation is analyzed in Appendix D for small selection amplitude σ, and, at large times, the allele frequency distribution Φ(x,t) is given by (D.5).

To get an insight into how the allele frequency changes in changing environments, we find the population-averaged allele frequency,(13)(14)where The above equation shows that oscillates around one half with the same cycling frequency as *s*(*t*) but a different phase. As depicted in Figure 6, the phase difference *φ* decreases with increasing mutation rate so that the allele frequency changes almost in-phase with the environment for but lags behind by a phase π/2 for . The latter behavior for rare mutations is already illustrated in Figure 4, where the mutant’s allele frequency keeps increasing as long as the selection is positive and decreases when *s*(*t*) becomes negative. In contrast, for , the population keeps up with the environment as mutations occur faster than the time scale of environmental change.

Equation 14 also shows that the allele frequency amplitude remains close to the time-averaged amplitude when the environment changes rapidly. But it is significantly different from one half in slowly changing environments and varies nonmonotonically with the mutation rate with a maximum at the scaled mutation rate We also find that although the distribution Φ(*x*, *t*) depends on the dominance coefficient (see Appendix D), the average allele frequency (for small *σ*) is independent of *h*.

The above described behavior of allele frequency has implications for the average fitness of the population. When the mutant allele is present in frequency *x* at time *t*, the population fitness where (see MODEL section). The population-averaged log fitness oscillates around a constant which is obtained on averaging over a period of the oscillation and is given by(15)(16)We thus find that, although the selection is zero on average, the population fitness is nonzero.

Equation 16 shows that, for a given mutation rate, the average log fitness decreases toward zero with increasing cycling frequency; this behavior is expected as the time-averaged environment governs the dynamics in a rapidly changing environment. However, it is a nonmonotonic function of the scaled mutation rate *U*: for , the average log fitness is close to zero because the phase difference *φ* between the allele frequency and selection is large [see (14)]. But for high mutation rate , although the phase lag is small, the allele frequency does not deviate substantially from one half, resulting in low fitness. From (16), we find that the average fitness has a peak at an optimal mutation rate,which increases with the rate of environmental change. Finally, (16) also shows that the fitness is a symmetric function of dominance coefficient but the *h*-dependence is quite weak (see Figure 6), and is apparent only at small mutation rates and for fast environmental changes; we thus conclude that dominance does not have an appreciable effect when recurrent mutations occur.

## Data availability

The authors state that all data necessary for confirming the conclusions presented in the article are represented fully within the article. Supplemental material available at figshare: https://doi.org/10.25386/genetics.12727991.

## Discussion

In this article, we studied the evolutionary dynamics of a finite, diploid population in a varying environment for both weak and strong mutations. The fixation probability of a mutant has been studied in infinitely large populations when selection changes gradually in both magnitude and direction (Uecker and Hermisson 2011; Peischl and Kirkpatrick 2012) and in finite populations that are subjected to abrupt changes in the direction of selection (Takahata *et al.* 1975; Mustonen and Lässig 2008; Cvijović *et al.* 2015; Dean *et al.* 2017). Here, we modeled a situation in which the mutant allele is beneficial during a part of the seasonal cycle and deleterious in another, and hence its selection coefficient *s*(*t*) varies periodically with time. In contrast to previous work, here we focused on the impact of dominance on evolutionary dynamics in changing environments, and obtained simple analytical expressions for the fixation probability in both infinite and finite populations.

### Rate of environmental change and time of appearance

In a slowly changing environment, the fixation probability of a mutant is expected to depend on the time it appears in the population. But it is perhaps not obvious if the dependence on the initial condition remains in fast changing environments as the fixation probability in an infinitely fast changing environment is given by the corresponding result in a static environment with the time-averaged selection coefficient . However, as shown in Figure 4, a mutant must escape the stochastic loss at short times in order to fix in the population, and, therefore, the eventual fate of the rare mutant depends on its time of appearance at any finite rate of environmental change.

Using branching process and diffusion theory (Uecker and Hermisson 2011; Waxman 2011), here we have obtained simple expressions for the fixation probability when the frequency of the environmental change is smaller or larger than the resonance frequency *ω _{r}* of the population, which is given by the average growth rate of the population when the time-averaged selection strength and inverse population size for . The fixation probability exhibits an extremum when the environment changes at a rate equal to the resonance frequency; whether this extremum is a minimum or a maximum also depends on the time of appearance,

*t*, of the mutant.

_{a}As an illustration of the above discussion, for arbitrary , consider a beneficial mutant that arises when its selection strength is decreasing with time. In a slowly changing environment, as , its fixation probability is expected to be smaller than that in the static environment; for the same reason, it approaches the corresponding result in the time-averaged environment from below, thus resulting in a minimum at the resonance frequency. It then follows that, in a periodically varying environment with zero or negative time-averaged selection coefficient, if the environment changes at a rate faster than the resonance frequency, a mutant that is beneficial in a static environment will have a fixation probability lower than (2*N*)^{−1}. Similarly, a deleterious mutant that arises while selection strength is increasing can have enhanced chance of fixation compared to (2*N*)^{−1} in changing environments that are neutral or beneficial on average.

The above discussion assumes that the mutations are rare. When recurrent mutations occur, we find that, in the on average neutral environment, the population can gain fitness which is, however, appreciable when the mutation rate is as high as the rate of environmental change.

### Role of dominance in slowly changing environments

In a static environment, a dominant beneficial mutant enjoys a higher chance of fixation than a recessive one because the (marginal) fitness of the mutant allele (relative to the wild-type allele) is higher in the former case (Haldane 1927). This behavior is reversed for deleterious mutants where the fixation of recessives is favored (Kimura 1957). In a slowly changing environment , if the mutant starts out as a beneficial mutant [that is, its selection coefficient at time of appearance ], Haldane’s sieve operates. Similarly, if the mutant is deleterious to begin with, its chances of fixation are reduced if it is dominant. This result is attested by Figure 1 and Figure S1 for , Figure 2 for and Figure 3 for .

Equation 6a and Equation 11b for the fixation probability of a mutant in an environment that is, respectively, beneficial and neutral on average, suggest that the change in fixation probability due to a slow change in the environment is simply equal to the change in the mutant’s initial fitness relative to its initial fitness, that is, which is *independent* of the dominance coefficient. This can be argued as follows: when the selection coefficient changes very slowly , it is reasonable to assume that the fixation probability has the same functional form as that in the static environment. Then, for an initially beneficial mutant, where is the time at which the mutant escapes stochastic loss, as estimated from a deterministic argument.

### Role of dominance in fast changing environments

As already mentioned above, an initially beneficial mutant arising when the selection is declining can behave effectively as a deleterious mutant in a rapidly changing environment that is neutral or deleterious on average. This has the immediate consequence that the dominant mutant is less likely to fix than the recessive one, as supported by Figure 2 for and Figure 3 for . This result can be relevant to understanding adaptation in environments that change fast and for a short period of time. In section S4, we construct such examples, and find that the fixation probability of an initially beneficial mutant in transiently changing environments exhibits the same dependence on dominance coefficient as discussed above for periodically changing environments.

Equation 6c and Equation 9 show that, in fast changing environments, the fixation probability is proportional to and (2*N*)^{−1}, respectively, which are the results for the fixation probability of a single mutant in an infinitely fast changing environment. If genetic drift is ignored, the dynamics of the mutant frequency are described by so that, at large times, the average number of mutants, for large *ω*, and, therefore, the fixation probability in rapidly changing environments can be interpreted as simply that of *n* mutants in infinitely fast changing environments (also, see section S4).

### Limitations and open questions

Our analytical results, which provide an understanding of conditions under which the effect of dominance on the fixation probability is different in static and changing environments, are applicable to cycling frequencies that are much smaller or larger than the resonance frequency. As our analysis is not valid for intermediate cycling frequencies, we cannot rule out whether such differences occur at cycling frequencies around resonance frequency (see, Figure 1 for and Figure 3A).

Here, we have focused mainly on the fixation probability and did not discuss how substitution rate and adaptation rate behave in changing environments. However, our preliminary simulations show that the substitution rate varies nonmonotonically with cycling frequency (also see Mustonen and Lässig 2007). A detailed understanding of these quantities requires the knowledge of fixation time which shows interesting dependence on dominance coefficient in static environments (Mafessoni and Lachmann 2015); extending such results to temporally varying environments is desirable and will be discussed elsewhere.

When adaptation occurs due to standing genetic variation, the fixation probability of a beneficial mutant is known to be independent of dominance in static environments (Orr and Betancourt 2000); here, we have studied the fixation probability of a *de novo* mutation and a detailed understanding of how standing variation affects the results obtained here is a problem for the future.

## Acknowledgments

We thank two anonymous reviewers for many constructive comments that helped us to improve the manuscript. K.J. acknowledges funding from the Department of Biotechnology-Jawaharlal Nehru Centre for Advanced Scientific Research (DBT-JNCASR) grant “Life science research, education and training at JNCASR” (BT/INF/22/SP27679/2018), Government of India.

## Appendix A: Branching process approximation

The fixation probability of a mutant that arises in a large wild-type population, and is beneficial on average, is given by (5). For , the fixation probability is given by while, for , it is equal to for *s*(*t _{a}*) > 0, and zero otherwise.

Away from these extreme limits, the integral appearing in (5) can be analyzed for small as follows. For small cycling frequencies by first expanding the integrand in powers of *ω* and then carrying out the resulting integrals, we obtain

provided *s*(*t _{a}*) > 0, and zero otherwise. Similarly, for large cycling frequencies, the fixation probability can be found by first expanding the integrand in powers of for this finally results in(A.2)Note that the first order corrections in (A.1) and (A.2) vanish for and

As discussed in the main text, an extremum in the fixation probability occurs at the resonance frequency *ω _{r}*. Ignoring terms of order

*ω*

^{2}and in (A.1) and (A.2), respectively, and equating the resulting expressions, we arrive at a quadratic equation for

*ω*whose positive root is given by (7). Furthermore, in Figure 1, for the fixation probability curves for dominance coefficient

_{r}*h*and coincide at a cycling frequency higher than

*ω*, which can be estimated using (A.2), and found to be

_{r}## Appendix B: Diffusion approximation for small cycling frequencies

Here, we study (3) for and small cycling frequencies within a perturbation theory by writing It is useful to rewrite (3) as

where

In a static environment, if the mutant arises at time and has fraction *x* in the population, its fixation probability is given by where(B.2)and (Kimura 1957). For a strongly beneficial mutation the fixation probability *P*^{0} increases with dominance coefficient and given by *hs*(*t _{a}*), while, for a deleterious mutation, it decreases with

*h*. The chance of fixation also decreases with population size for but the variation with

*N*is nonmonotonic for

The effect of a slowly changing environment on the fixation probability is captured by *P*^{1} that, by virtue of (B.1), obeys the following ordinary differential equation,(B.3)Equation (B.3) subject to boundary conditions has the solution(B.4)which, for small initial frequency can be approximated by(B.5)The following cases need to be considered separately:

for small

*Nσ*and arbitrary*θ*, we first expand_{a}*I*(*x,τ*) to linear order in*Nσ*and carry out the integrals in the expression for*P*_{0}given above to obtain(B.6)(B.7)

Using these approximations in (B.5), to leading order in *Nσ*, we get(B.8)For (that is, *θ _{a}* = 0 or

*π*, arbitrary

*Nσ*), it can be easily seen that the function and the derivative is given by (B.7) thus leading to (B.8).

: For large , using the asymptotic expansion of the error function erf (

*x*) (Abramowitz and Stegun 1964), the fixation probability can be approximated as(B.9)

(more precisely, the above expression holds for ). For large, positive *Ns*(*t _{a}*), the denominator in (B.9) can be approximated by one leading to(B.10)Using the above expression in (B.5), and performing the integrals for , we finally obtain the following simple result,(B.11)

: Taking the derivative of

*P*_{0}in (B.9) with respect to*τ*and keeping factors proportional to only, we obtain(B.12)

Noting that the dominant contribution to the inner integral in the numerator of (B.5) comes from , we finally get

(B.13)(B.14)## Appendix C: Diffusion approximation for large cycling frequencies

Here, we calculate the fixation probability of a neutral mutant when the cycling frequency is larger than the amplitude of selection (*ω* > σ). On writing in (B.1) and collecting terms to zeroth and first order in we find that *P*_{0} = *x*, as expected. The correction *P*_{1} obeys an inhomogeneous partial differential equation,

with boundary conditions

The homogeneous equation can be solved using standard eigenfunction expansion method (Kimura 1955; Ewens 2004), and we find that with the eigenvalue and eigenfunction where is the Jacobi polynomial (Abramowitz and Stegun 1964). However, as this homogeneous solution is not periodic in *τ*, it does not contribute to the full solution. But since the eigenfunctions *X _{n}* (

*x*) form a complete set of basis, we can write and where

*b*are obtained using the orthogonality property of

_{n}*X*(

_{n}*x*). Using these in (C.1), we obtain(C.2)When a single mutant with frequency appears at time

*t*, the above expression reduces to (8b) in the main text and can be used to find the resonance frequency at which the probability of fixation has an extremum. For

_{a}*h*= 1/2, we find that(C.3)For arbitrary

*h*, we are unable to find a simple closed expression for

*ω*as it is a solution of a sixth-order algebraic equation. But, a numerical study of this equation shows that

_{r}*ω*depends weakly on dominance coefficient. We find for respectively; the corresponding values for are given by 1.73,2.41,3.84.

_{r}## Appendix D: Allele frequency distribution for strong mutation

The forward time dynamics of the population under mutation and selection are described by (12) for the allele frequency distribution Φ(*x,t*). The distribution Φ_{0} for the population subject to mutation and random genetic drift is given by with eigenvalues and eigenfunctions where is the Jacobi polynomial (Crow and Kimura 1956). These eigenfunctions are orthogonal with respect to the weight function

For weak selection (σ < *μ*), we can expand Φ(*x,t*) as a power series in to write Using this in (12), we find that Φ_{1} obeys the following differential equation,

To find the distribution Φ_{1}(*x,t*), we expand it and the RHS of above equation as a linear combination of *X _{n}*(

*x*). Writing in (D.1), we find that at large times,(D.2)where(D.3)As , from (D.2), we obtain(D.4)where We thus have

## Footnotes

Supplemental material available at figshare: https://doi.org/10.25386/genetics.12727991.

*Communicating editor: L. Wahl*

- Received February 24, 2020.
- Accepted July 27, 2020.

- Copyright © 2020 by the Genetics Society of America