The effects of weak selection on neutral diversity at linked sites

Abstract The effects of selection on variability at linked sites have an important influence on levels and patterns of within-population variation across the genome. Most theoretical models of these effects have assumed that selection is sufficiently strong that allele frequency changes at the loci concerned are largely deterministic. These models have led to the conclusion that directional selection for selectively favorable mutations, or against recurrent deleterious mutations, reduces nucleotide site diversity at linked neutral sites. Recent work has shown, however, that fixations of weakly selected mutations, accompanied by significant stochastic changes in allele frequencies, can sometimes cause higher diversity at linked sites when compared with the effects of fixations of neutral mutations. This study extends this work by deriving approximate expressions for the mean conditional times to fixation and loss of mutations subject to selection, and analyzing the conditions under which selection increases rather than reduces these times. Simulations are used to examine the relations between diversity at a neutral site and the fixation and loss times of mutations at a linked site that is subject to selection. It is shown that the long-term level of neutral diversity can be increased over the purely neutral value by recurrent fixations and losses of linked, weakly selected dominant or partially dominant favorable mutations, or linked recessive or partially recessive deleterious mutations. The results are used to examine the conditions under which associative overdominance, as opposed to background selection, is likely to operate.


Introduction
There is now a large body of data showing that the levels of withinpopulation DNA sequence diversity across the genomes of many organisms are significantly affected by the effects of selection on sites linked to those under observation, especially in genomic regions or species where recombination rates are low; for recent reviews, see Cutter and Payseur (2013) and Charlesworth and Jensen (2021). Interpretations of these observations have mainly focused on reductions in variation at linked neutral or nearly neutral sites caused by the spread of selectively favorable variants (selective sweeps), or the elimination of rare, deleterious mutations (background selection [BGS]). The population genetic models used to describe these processes usually assume that selection is sufficiently strong in relation to genetic drift that deterministic equations are sufficient to describe the behavior of the sites under selection, except for the initial and final periods of the fixation of beneficial mutations (reviewed by Charlesworth and Jensen 2021).
Interest has, however, recently been revived in the process known as associative overdominance (AOD) (Sved 1968;Ohta 1971;Latter 1998;Palsson 1998, 1999;Wang and Hill 1999;Frydenberg 1963;Zhao and Charlesworth 2016;Waller 2021), whereby the level of diversity at a neutral locus in a diploid population can be enhanced by the presence of linked deleterious alleles maintained by mutation pressure. Recent theoretical work has shown that this can happen when the deleterious alleles concerned are sufficiently recessive, and selection is sufficiently weak in relation to drift (Zhao and Charlesworth 2016). The latter condition requires the product of the effective size of the population (N e ) and the selection coefficient against homozygotes for a mutation (s) to be the order of 1 or less, consistent with previous results from computer simulations (Latter 1998;Palsson and Pamilo 1999;Wang and Hill 1999). There is evidence for the operation of associative overdominance (AOD) in both small populations (Latter 1998;Bersab e et al. 2016;Zhao and Charlesworth 2016;Schou et al. 2017;Waller 2021), in inbreeding experiments (e.g. Roessler et al. 2019), and in genomic regions with low recombination, where N e is reduced as a result of BGS and selective sweeps (Becher et al. 2020;Gilbert et al. 2020). In contrast, if the effects of drift on the frequencies of deleterious alleles are negligible, BGS operates, causing a reduction in variability at linked sites (Charlesworth et al. 1993;Hudson and Kaplan 1995;Nordborg et al. 1996).
Under conditions where AOD is acting, deleterious variants at sites under selection are likely to become fixed as a result of drift, and reverse mutations that increase fitness can eventually arise and replace them as a result of the joint effects of drift and selection. In the long term, a population that is constant in size will reach a stochastic equilibrium under the joint effects of drift, mutation, and selection, a situation that is similar to that envisaged in the Li-Bulmer model of the evolution of codon usage bias, which assumes a constant flux of fixations of favorable and beneficial mutations at sites under selection (Li 1987;Bulmer 1991;McVean and Charlesworth 1999). To understand the effects of AOD, it is therefore important to have a model of the effects of this flux on variability at linked neutral sites.
A basis for such a model is provided by the results of Mafessoni and Lachmann (2015) on the expected times to fixation and loss of new autosomal mutations in a randomly mating population, and on the effects of fixation events on the patterns of variability at linked neutral loci. They showed that a weakly selected (N e s of order 1), favorable mutation destined for fixation can have a longer mean time to fixation or loss than a neutral mutation, provided that it is dominant or partially dominant. The same applies to weakly selected, partially recessive deleterious mutations. Furthermore, the fixation of a dominant or partially dominant favorable mutation, or of a recessive or partially recessive deleterious mutation, can enhance variability at a linked neutral site compared with the effect of fixation of a neutral variant, although variability is still lower than in an equilibrium population without any selection. These conclusions have been confirmed in the simulations described by Johri et al. (2021); similar situations where fitnesses fluctuate over time have been studied by Kaushik and Jain (2021). As pointed out by Charlesworth and Jensen (2021), these results are relevant to the analysis of AOD by Zhao and Charlesworth (2016), who showed that a neutral locus closely linked to a locus subject to mutation to deleterious alleles can lose variability more slowly than in the absence of selection, provided that the mutations are recessive or partially recessive and selection is sufficiently weak relative to the effects of genetic drift.
The purpose of this study is to obtain approximate analytical expressions for the expected sojourn times of new mutations for the case of weak selection, and to use these to illuminate the results of Mafessoni and Lachmann (2015) on the fixation and loss of weakly selected mutations. Computer simulations are used in conjunction with these results to examine the effects of fixations and losses of weakly selected mutations on variability at linked neutral sites. The results are used to develop a semianalytical model of AOD for the case of stochastic equilibrium between mutation, selection, and drift. They also provide a new way of describing BGS, when applied to situations when selection is so strong in relation to drift that deleterious mutations have a negligible chance of becoming fixed in the population. The focus is on the case when there is no recombination between neutral and selected sites, since this gives the clearest signal and allows the causes of the observed patterns to be analyzed without the complications introduced by recombination.

Simulation methods
To check the accuracy of the diffusion equation results for expected times to fixation or loss (see Theoretical results), a biallelic autosomal locus in a Wright-Fisher population with constant size N was modeled, implying that the effective population size N e is equal to N. For a given simulation run, a single A 2 allele was introduced into the population that was fixed for the alternative allele A 1 . The mutant allele could be either selectively favorable or deleterious. The expected change in the frequency x of A 2 in a given generation for an assigned selection model was calculated using the standard discrete-generation selection formulation (for details of the model of selection, see Approximate expected times to fixation and loss of a new mutation). Binomial sampling was used to obtain the value of x in the next generation, using the frequency of A 2 after selection and 2N as parameters. Large numbers of replicate simulations were run to obtain the mean times to fixation and loss of A 2 , conditioned on its fixation or loss, respectively.
This procedure was modified to calculate the effects of a sweep on pairwise diversity at a neutral locus with an arbitrary degree of linkage to the selected locus. As described in Charlesworth (2020b) and Johri et al. (2021), the algorithm of Tajima (1990) was used to calculate the effects of a sweep on pairwise diversity at a neutral locus, with an arbitrary degree of linkage to a selected locus with two alleles, A 1 and A 2 . Tajima's Equations (27) provide three coupled, forward-in-time recurrence relations for the expected diversities at the neutral locus for pairs of haplotypes carrying either A 1 or A 2 , and the divergence between A 1 and A 2 haplotypes. These are conditioned on a given generation-by-generation trajectory of allele frequencies at the selected locus, assuming the infinite sites model of mutation and drift (Kimura 1971). In this study, there is interest in the effects of both losses and fixations of either deleterious or advantageous A 2 mutations on diversity statistics over the time-course leading to loss or fixation of A 2 , whereas the previous studies only considered the effects of fixations.
For a given simulation run, a single A 2 allele was introduced into the population, with zero expected pairwise diversity at the associated neutral locus. The initial expected pairwise diversity among A 1 alleles and divergence between A 1 and A 2 were set equal to those for an equilibrium population in the absence of selection, h ¼ 4N e m, where m is the neutral mutation rate. Since only diversities relative to h are of interest here, h was set to 0.001 to satisfy the infinite sites assumption. Equations (27) of Tajima (1990) were applied to the previous value of the allele frequency to obtain the state of the neutral locus in the new generation.
The simulation procedure for selection and drift at the selected locus was repeated generation by generation until A 2 was lost or fixed; if the effect of loss on diversity at the neutral locus was of interest, only runs in which A 2 was lost were retained, and the value of the pairwise diversity among A 2 alleles at the time of its loss was determined. Similarly, the effects of fixations were studied by recording the properties of runs in which A 2 was fixed. Large numbers of replicate simulations were used (between 10 4 and 10 6 , depending on the parameter values), because there is a large amount of variation in the values of the population statistics between replicate runs.
Diversity statistics were obtained in each generation for the 3 genotypes at the selected locus. They were measured relative to the equilibrium neutral values, and were thus equivalent to the mean coalescent times on the timescale of 2N e generations. The sums of the pairwise diversity statistics were taken over the whole time course of a loss or fixation, for A 1 vs A 1 , A 1 vs A 2 , and A 2 vs A 2 haplotypes, as well as the mean over all three of these comparisons, weighted by their frequencies in the generation in question. In addition, the neutral diversity of fixed haplotypes at the time of loss or fixation of the mutation was determined.

Numerical integrations
The notation and results described in Ewens (2004, Chapters 4 and 5) are used here, with some slight modifications. The diffusion equation expressions shown in the Appendix yield the sojourn time densities at frequency x of A 2 given an initial frequency q, which are denoted by t*(x, q) and t**(x, q) for fixations and losses conditioned on fixation or loss, respectively [see Equations (A1) and (A6)]. The mean times spent between frequencies x and x þ dx are given by t*(x, q) dx and t**(x, q) dx, respectively, where dx is an arbitrarily small increment in x. The sojourn time densities involve integrals of the function w(y), defined by Equation (A1c). For a given value of x, these integrals can be evaluated for specified upper and lower values of y by using the series expansions in Equations (A3). The simplest way to obtain the corresponding conditional mean times to fixation and loss, t* and t**, for a new mutation with a haploid population size N H (see the next section) is to sum the products t*(x, q)/N H and t**(x, q)/N H over all values of x between q and 1, with q ¼ 1/N H (Ewens 2004, p. 142).

Theoretical results
Approximate expected times to fixation and loss of a new mutation A more general model of selection than that used by Mafessoni and Lachmann (2015) is employed here, using the notation of Charlesworth (2020aCharlesworth ( , 2020b. A biallelic locus in a discrete generation, panmictic population is assumed, with frequencies x and 1Àx of alleles A 2 and A 1 , respectively, in a given generation; the population is initially fixed for A 1 . The new mutation, A 2 , is introduced as a single copy. To accommodate a general genetic system, the number of haploid genomes at a locus that are present in the population is denoted by N H , so that the initial frequency of A 2 is q ¼ 1/N H (Charlesworth 2020a). Selection is sufficiently weak that second-order terms in the selection coefficient s for A 2 A 2 homozygotes can be neglected (s is negative if A 2 A 2 individuals are at a selective disadvantage); 1 þ s is the fitness of A 2 A 2 relative to the fitness of A 1 A 1 . The effective population size is N e ; time is measured in units of the coalescent time, 2N e generations. The scaled selection coefficient is defined as c ¼ 2N e s. Under these assumptions, the rate of change in frequency of A 2 can be written as: where the coefficients a and b depend on the genetic system and breeding system, and higher-order terms in s have been neglected (Charlesworth 2020a). In the case of an autosomal locus with random mating, a ¼ h and b ¼ 1-2 h. Here, h is the dominance coefficient, such that the fitness of A 1 A 2 heterozygotes relative to that of A 1 A 1 homozygotes is equal to 1 þ hs. This familiar case will be the focus of this study, but the conclusions can easily be extended to other cases, as described in Table 1 of Charlesworth (2020a). For example, for an autosomal locus and an inbreeding coefficient F, we have a ¼ F þ (1ÀF)h, and b ¼ (1ÀF)(1-2h). The sign of b describes whether A 2 is (partially) dominant or recessive, b being negative with dominance and positive with recessivity; b ¼ 0 for a semi-dominant mutation.
For the present purpose, the main quantities of interest are the sojourn time densities t*(x, q) and t**(x, q) for mutations destined for fixation and loss, respectively, as defined in Numerical integrations. These are expressed in units of the coalescent time 2N e ; the corresponding absolute times can be obtained by multiplying by 2N e . When A 2 is initially present as a single copy, only the situation when q x 1 need be considered; the relevant expressions for t*(x, q) and t**(x, q) are given in the Appendix.
Approximations that use only first-and second-order terms in c are given by Equations (A5) and (A7), for t*(x, 1/N H ) and t**(x, 1/N H ), respectively.
Equations (A5) and (A7) can be integrated over the interval 1/N H x 1, yielding approximate expected conditional times to fixation and loss for a new mutation. We have: For greater accuracy, Euler's constant (0.5772) should be added to the terms inside the brackets on the right-hand side of Equation (3), to correct for the difference between the summation and integration of 1/x (Ewens 2004, p. 23). Kaushik and Jain (2021, Equation 9) have independently derived an approximation similar to Equation (2) for the case of an autosomal locus and random mating. Their H corresponds to h -1 =2; if terms in H 2 are neglected, their equation is the same as Equation (2), except for the fact that their expression for t* differs by a factor of 1 =2, because of their assumption of a continuous time birth-death process rather than a Wright-Fisher model.
The first-order terms in c in these equations show that when b > 0 (h < 0.5 in the case of autosomal inheritance), the mean times to fixation and loss of a favorable mutation (c > 0) are reduced below their neutral value, if c is sufficiently close to 0. These times are increased when b < 0 (h > 0.5 with autosomal inheritance). The converse relations hold for the case of a deleterious mutation (c < 0).
These results correspond to those of Mafessoni and Lachmann (2015), based on numerical evaluations of the relevant general equations. Furthermore, when b ¼ 0 (corresponding to semi-dominance with diploid inheritance), t* and t** are at a maximum with respect to c when c ¼ 0, so that selection on a semidominant autosomal mutation (or a semi-dominant mutation with respect to female fitness with X-linkage) is always associated with a shorter conditional time to fixation or loss than under neutrality. The results are of interest for the main topic of this study, because the flux of mutations between deleterious and favorable alleles at a site is the basis for the analysis of the longterm effects of weak selection on variability (see Relevance to AOD and BGS). An analysis of the effects of the quadratic terms in c on the implications of Equations (2) and (3) is given in the Supplementary File 1, Section 1.
A similar treatment can be given for the means of the sum of the diversity 2x(1Àx) in each generation over the paths to fixation or loss of a new mutation (H* and H**, respectively), which are obtained by integrating the product of 4N e x(1Àx) with t*(x, q) or t**(x, q), respectively, over x between 0 and 1. The relevant integrations give: These expressions show that H* and H** have similar properties to t* and t** with respect to their dependence on b when selection is sufficiently weak that first-order terms in c predominate. Weak selection with cb < 0 can thus result in an increase in these measures of diversity relative to neutral expectation, contrary to what is commonly assumed in discussions of molecular variability. This can happen either when c < 0 and b > 0 (deleterious, partially recessive or recessive mutations) or c < 0 and b > 0 (favorable, partially dominant or dominant mutations).
The sojourn time density functions in Equations (A8) and (A9) can be used to find the corresponding net mean sojourn time between loss or fixation for a new mutation, to an accuracy of order c 2 : Similarly, the expected sum of the diversity values over the sojourn of a mutation in the population before its loss or fixation is approximated by: With respect to terms of the first order in c, there is no dependence on cb of the net mean sojourn time and net diversity, but they are both increasing functions of ca. This is consistent with the classical result for the case of a semi-dominant autosomal mutation with random mating, where H is an increasing function of c (Fisher 1930, Fig. 3;Kimura 1983, p. 44). At first sight, it seems paradoxical that semi-dominant mutations subject to positive selection should yield a higher net diversity than neutral mutations during their sojourn in the population. But this is simply a reflection of the fact that they have a higher chance of establishing themselves in the population, and hence of contributing to diversity.

Numerical results for conditional times to loss and fixation and net diversity
The accuracy of these approximations was checked by comparison with the results of numerical integrations of the relevant diffusion equation formulae, as described in the Material and Methods and the Appendix, and by computer simulations of an autosomal locus in a randomly mating population of size N, with binomial sampling of post-selection gametes. In this case, N e ¼ N and N H ¼ 2N. Figure 1 shows the mean fixation time of a new mutation (conditioned on its fixation) for a range of values of the magnitude of the scaled selection coefficient, jcj ¼ 2N e jsj. Both deleterious mutations (s < 0) with dominance coefficient h ¼ 0.1 and favorable mutations with h ¼ 0.9 (s > 0) were modeled. The values for a neutral mutation, obtained by integration of the sojourn time density function in the absence of selection with respect to x between 1/N H and 1 -1/N H , are indicated by the horizontal lines. The results from the numerical integrations of the sojourn time densities (black curves) are in close agreement with the simulation results (red points) over the whole range of c values used here. The approximate values from Equation (2) (blue curves) are in good agreement with the more exact values for jcj up to 2 or so, but then tend to overestimate the fixation times. Nonetheless, the qualitative pattern of an increase in fixation time above the neutral value as jcj increases to a value near 2, followed by a decrease, is captured by the approximation. The more exact results show that the neutral value of t* is returned to more quickly, at jcj % 3, than is indicated by the approximation. As expected from the results of Maruyama (1972) and Maruyama and Kimura (1974), the curves for favorable and deleterious mutations, with their complementary values of h, are identical. Figure 2 shows similar results for the mean times to loss of new mutations, conditioned on their loss. These are necessarily much smaller than the mean times to fixation, and are also inverse functions of the population size when measured on the coalescent timescale of 2N e generations, as implied by Equation (3). In terms of generations, the loss times are logarithmically increasing functions of N, since N e ¼ N in the cases shown here. There are noticeable differences between the results for deleterious and favorable mutations, with the partially deleterious mutations having longer mean times to loss than the complementary partially dominant favorable mutations (with dominance coefficient equal to 1 À h, where h is the value for the corresponding partially recessive mutations), due to the multiplicands of -c 2 being smaller for the deleterious than the complementary favorable mutations. Similarly, the deleterious mutations return to the neutral value at larger values of jcj than the complementary favorable mutations. The multiplicand of -c b is larger for losses than fixations, so that the condition on jcj for t** to exceed the neutral value is more liberal for losses than for fixations. However, the second-order terms in both cases are always positive, and overcome the first-order terms when jcj is large enough.
Similar patterns of behavior are found for the mean sums of the diversities conditioned on fixations or losses, H* and H**; examples similar to those in Figs. 1 and 2 are shown in Supplementary Figs. 1 and 2, using the integration and approximate results. As might be expected, H* and H** are closely correlated with t* and t**, respectively ( Supplementary Fig. 3). Figure 3 shows the approximate and integration results for the conditional mean times to fixation and loss for the whole range of dominance coefficients, with the magnitude of the scaled selection coefficient jcj equal to 1 or 2. The approximations (solid curves) agree very well with the integration results (dashed curves) for both strengths of selection, and are nearly linear in h. As expected from Equations (2) and (3), the relationships of the fixation and loss times to h for the deleterious and favorable mutations are opposite in direction, with deleterious mutations having fixation and loss times that decrease with h, whereas those for favorable mutations increase with h. Weaker selection is associated with a larger range of h values for which the conditional fixation time is greater than the neutral value.
A critical value of the dominance coefficient for a given c, h cf (c), can be defined, which is the value of h at which the mean fixation time is equal to the neutral value. A similar quantity, h cl (c), can be defined for the mean time to loss. As is discussed in more detail in Relevance to AOD and BGS, these quantities provide a useful link between the present approach and that of Zhao and Charlesworth (2016), who examined the conditions for AOD vs BGS for the case of a large population that is initially in stochastic equilibrium under mutation, drift and selection, and then suffers a permanent reduction in population size. As a measure of the magnitude of genetic drift, they used the asymptotic rate at which variability at a neutral site linked to a site under selection decreases after the reduction in N, and determined whether selection increased or reduced the rate of loss of variability. Approximations for the critical dominance coefficients that correspond to the boundary between an increased and a decreased mean fixation or loss time can be obtained by setting the sum of the terms involving c and c 2 to zero in Equations (2) and (3), and solving the resulting quadratic equations in h. For h cf (c), the further approximation of replacing 59/300 with 1/5 is used.
After some algebra, the following expressions are obtained: As c approaches zero, consideration of the leading terms in c in the radicals in these equations shows that the critical dominance coefficient % 0.5 þ 0.125c in both cases, so that slightly recessive mutations (c < 0) or dominant mutations (c > 0) result in an increase in mean fixation and loss times when selection is very weak. For small c, which is the main region of interest as far as AOD is concerned, the critical dominance coefficients are nearly linear in c (Fig. 4).
The blue curves in Fig. 4 show the critical dominance coefficients for the operation of AOD, given by the solution of the approximate Equation (18) of Zhao and Charlesworth (2016). For favorable mutations, this expression breaks down for c > 1.26, but performs well for deleterious mutations over the entire range displayed. If this equation is approximated by ignoring terms in c 2 , the critical dominance coefficient for the operation of AOD is 0.5 þ 0.125c, the same as for h cf and h cl . This suggests that the two approaches are related to each other, although the three different functions describing h c do not agree precisely.

Effects of weak selection on variability at linked neutral sites
Intuitively, one would expect the longer mean fixation times associated with weak selection and cb < 0 to produce a higher level of mean pairwise diversity (p) at a linked neutral site than when a neutral mutation has become fixed. This was shown to be the case by Mafessoni and Lachmann (2015) and Johri et al. (2021), using computer simulations (similar, but smaller, effects would be expected from losses of new mutations; these were not, however, examined in these papers). Note, however, that the fixation of a neutral mutation produces an approximately 42% reduction in p at completely linked sites (Tajima 1990), so that all these cases are still associated with reduced rather than increased diversity. This is because p is measured at a single point in time (when a new mutation has been fixed), rather than using an estimate of the mean of p over a long time period at a focal neutral site that is subject to a succession of evolutionary events at a linked site-if this site is neutral, the mean p at the focal site cannot be affected by these events. An approximate method for calculating p at the end of a fixation event was used by Johri et al. (2021), based on the selective sweep equations of Charlesworth (2020b); this procedure is, however, unsatisfactory, since the sweep equations are inaccurate at small jcj values.
A first step toward obtaining an estimate of the long term mean value of p is to determine the pattern of variability at a focal neutral site over the course of fixation (or loss) of a linked mutation (A 2 ) introduced into a population initially fixed for the alternative allele (A 1 ). This was done here by applying the simulation procedure of Tajima (1990), as described in the Materials and Methods and in Johri et al. (2021). The left-hand panel in Fig. 5 shows the results for fixations of a favorable mutation with dominance coefficient h ¼ 0.9 and a range of values of the scaled selection coefficient, c, in a population size of 50, and with complete linkage between the neutral and selected sites. All diversity statistics are measured relative to h ¼ 4N e m, the equilibrium value in the absence of selection. It will be seen that the mean relative p over all genotypes taken over a fixation event (p w ) exceeds one for sufficiently small c values, even for the neutral case of c ¼ 0, whereas the relative p at the time of fixation or loss is always <1. The reason for the excess in p w over neutral expectation is that the slowness of the fixation process (whose expected value is of the order of 4N e generations with weak selection) allows A 1 and A 2 haplotypes to diverge in sequence over the course of the fixation of A 2 , because their mean coalescent times in the absence of recombination are much greater than the standard neutral value of 4N e generations (Kimura and Ohta 1969). Comparable results are seen for losses of new mutations, but with much smaller effects due to the shorter expected duration of loss events, which is close to 2 ln(N H ) generations with weak selection (Supplementary Fig. 4).
These results yield the seemingly paradoxical conclusion that fixation and loss events can be associated with a net increase in mean p at linked neutral sites during the course of fixation or loss, even when they involve neutral mutations. The paradox with respect to neutral mutations comes from the fact that one type of conditional event has been replaced by another: we are conditioning on observing a fixation or loss event that is in progress, and the increasing divergence between haplotypes carrying the ancestral and mutant alleles influences the net effect of the fixation or loss event on variability at the neutral site, as discussed in more detail below.
The following approximate approach avoids such conditioning. As was done by Charlesworth (2020b) for the case of sweeps of strongly selected mutations, ergodicity is assumed: the probability of a given value of p resulting from the hitchhiking effects of the selected site is proportional to the amount of time that the process spends at that value of p, analogous to the use of the sojourn time density for determining the frequency spectrum at a single locus (Ewens 2004 p. 24 and 25).
A core assumption is that the rates of fixation and loss events are sufficiently low that the intervals between successive events allow a complete recovery of diversity. Once again, diversities are measured relative to the value in the absence of selection, and the deviation of the relative diversity value from one is denoted by Dp. If the mean value of Dp immediately after a given fixation or loss event is denoted by Dp 0 , and the value of Dp at time t after such an event is Dp t , we have Dp t % Dp 0 exp(-t), where t is in units of 2N e generations (Mal ecot 1969, p. 40;Wiehe and Stephan 1993, Equation 6a). The sum of the values of Dp t over subsequent generations, relative to 2N e , can thus be approximated by: We also need to consider the contribution from the mean diversity over the course of each fixation (loss) event, which is given by the expectation of the product of the duration of an event, T e , and the associated mean value per generation of Dp over the course of the event, Dp w , i.e. by EfT e Dp w g. If T e is measured in units of coalescent time, and we use the sum of the Dp values relative to 2N e over a long period of time (or over many independent pieces of genome that are all subject to the same evolutionary process), the mean sum of the deviation from 1 of the relative diversity between successive fixation (loss) events is given by: To calculate the change in mean relative diversity due to a succession of evolutionary events, we would of course need to know the total length of time involved, requiring a calculation of the expected number of occurrences of fixation (loss) events and the expected times between them (see the next section). Use of Equation (10) avoids having to make a detailed model of these events, and provides an index of the expected magnitude and sign of the effects on neutral diversity of fixations (losses) at a linked site. Dp S can thus be (loosely) referred to as the mean change in diversity associated with a series of fixation or loss events. It should be noted that the assumption of an indefinitely large amount of time for recovery of diversity between fixation or loss events implies that the contribution of Dp 0 relative to EfT e Dp w g is overestimated compared with a realistic evolutionary model, so that any increases in diversity with weak selection when cb < 0 will be underestimated by this approach when Dp 0 < 0 and EfT e Dp w g > 0.
Using Equation (10), Dp S for recurrent fixations is shown in the right-hand panel of Fig. 5, for N ¼ 50 and N ¼ 500. Here, the mean of T e Dp w over many replicate simulations is used as an estimate of the expectation of T e Dp w . It can be seen that fixations of highly dominant, favorable mutations cause an increase in diversity when c is sufficiently small, but diversity is reduced when c is somewhat greater than 2; the value of c at the point of return to a reduction in p is smaller with the larger value of N. As expected from the properties of the mean fixation time described above, a similar pattern (within the limits of statistical error) is observed for fixations of deleterious mutations with h ¼ 0.1 and the same absolute value of c ( Supplementary Fig. 4). Figure 6 and Supplementary Fig. 5 show comparable results for losses of both favorable and deleterious mutations; in this case, the patterns are noticeably different for the two types of mutations, and are much more strongly affected by the population size, as expected from the corresponding effects on mean loss times described in the previous section. Supplementary Tables 1-8 show the detailed statistics for the simulations on which these figures are based, and Supplementary Table 9 shows summary diversity statistics for fixation and loss events for a range of dominance coefficients, and two different strengths of positive and negative selection.
The results allow questions to be asked about the nature of the major determinant of the effect of selection on neutral diversity at a linked site. Intuitively, it would seem likely that the mean conditional times to fixation, t*, and loss, t**, play a major role. However, the answer depends on what aspect of diversity is being explored. A detailed discussion of results relating to this question is given in Supplementary File 1, Section 2. These results show that, for a given value of c, both sojourn times are nearly linearly related to the diversity statistics, but the sign and magnitude of c influence the values of the diversity statistics for the same value of t* or t**. There is a close correspondence between the values of t* and t** that are generated by the simulations with c ¼ 0 and the thresholds at which Dp S ! 0, within the limits of sampling error (Supplementary Figs. 6 and 9).
The results can be interpreted as follows. The mean neutral diversity of haplotypes carrying the selectively favorable A 2 variant increases with the duration of a fixation event, because these haplotypes spend longer in the population before reaching fixation and hence have a longer coalescence time. The divergence between A 1 and A 2 haplotypes also increases with t*, since a longer time is available for them to diverge. The changes in the diversity of A 1 haplotypes are more minor. The net result is that the net mean diversity over the course of the event (Dp w ) increases with t*, as can be seen in Supplementary Fig. 7, so that its product with t*, which appears in the equation for Dp S (Equation 10) also increases with t*. This effect is reinforced by the decline in the reduction of diversity at the time of fixation of A 2 , -Dp 0 , as t* increases ( Supplementary Fig. 8), reflecting a greater coalescence time for A 2 when its sojourn time is longer.
These considerations apply to both positive and negative selection.However, with positive selection, A 2 spends more of its time at high frequencies than at low frequencies before becoming fixed, whereas the reverse is true with negative selection, as can be seen in the plots of the sojourn time densities relative to the neutral values that are shown in Fig. 7 [note that t*(x) is independent of x in the absence of selection]. This means that, for the same jcj value, haplotypes carrying A 1 have a longer coalescence time with negative than with positive selection; because these haplotypes start with the equilibrium neutral diversity value h, they contribute disproportionately to Dp w . This effect is especially clear for the larger values of jcj; for example, with jcj ¼ 5, the mean diversity of A 1 haplotypes is 0.657 6 0.001 for c ¼ -5, and 0.608 6 0.001 for c ¼ 5.
Similar patterns are seen with losses of mutations. This is perhaps less surprising, since t** for a given jcj value is greater for deleterious mutations than for favorable mutations when h for the former is the same as 1Àh for the latter, i.e. the dominance coefficients are complementary (Fig. 3).

Relevance to AOD and BGS
As mentioned in the Introduction, the relevance of these results to AOD arises from the fact that, if selection is sufficiently weak in relation to genetic drift, a biallelic locus subject to selection and reversible mutations will experience a constant flux of mutations from the states of fixation for A 1 to fixation for A 2 and viceversa, as in the Li-Bulmer model of codon usage bias (Li 1987;Bulmer 1991;McVean and Charlesworth 1999). Here, A 1 is now used to denote the selectively favorable allele at a given site, and A 2 its deleterious alternative, rather than ancestral and mutant alleles, respectively.
For the case of an autosomal locus, the relative fitnesses of the three genotypes A 1 A 1 , A 1 A 2 , and A 2 A 2 are 1, 1Àhs and 1Às, respectively (s ! 0); with weak selection, this is equivalent to representing these fitnesses as 1 þ s, 1 þ (1Àh)s and 1. Thus, if the deleterious effects of A 2 are recessive or partially recessive (0 h < 0.5) and c ¼ 2N e s is sufficiently small, the entry of an A 2 mutation into a population temporarily fixed for A 1 will be associated with a longer net sojourn time in the population than that for a neutral mutation. The same applies to the entry of a favorable A 1 mutation into a population temporarily fixed for A 2 .
The results in the previous section strongly suggest that, under these conditions, diversity at closely linked neutral sites will be enhanced when a stationary state with respect to mutation, selection and drift is reached. The effect of the constant flux of Figure 5 The left-hand panel shows the mean pairwise diversities (relative to the purely neutral value h) at a neutral site during the course of fixation of a completely linked beneficial mutation with dominance coefficient h ¼ 0.9, for haplotypes carrying the ancestral allele (A 1 ) and the new mutation (A 2 ), as well as the divergence between A 1 and A 2 haplotypes (A 1 vs A 2 ). The final diversity at the time of fixation of A 2, and the mean diversity over all three haplotypes over the course of the fixation process, are also shown. Autosomal inheritance with Wright-Fisher model of genetic drift with population size N ¼ 50 was simulated by the method of Tajima (1990). The right-hand panel displays the mean values and standard errors of the net change in relative diversity over repeated fixation events for 2 different N values, estimated from the simulations by the method described in the text. mutations at a selected site on the expected level of neutral diversity (p) at the linked neutral site can be determined with the use of the ergodic assumption. This allows the application of the results of the simulations described above that used this approach, employing the infinite sites assumption that mutations are sufficiently infrequent that new mutations occur only at sites that are fixed for either A 1 or A 2 , which was applied to the theory of codon usage by Bulmer (1991) and McVean and Charlesworth (1999). Table 1 shows the variables that are used in this procedure. As in the previous section, diversity is measured relative to the purely neutral equilibrium value h ¼ 4N e m, and its deviation from one at given point in time is denoted by Dp.
Consider a site that has just become fixed for A 1 . Under the above assumptions, the distribution of times until an A 2 mutation arises and becomes fixed is exponential, with parameter k 11 . If a time t is drawn from this distribution, the expected number of A 2 mutations that arise and become lost during an interval of length t is k 10 t, where k 10 ) k 11 from the formulae in Table 1. Integrating over the distribution of t, the expected number of losses of A 2 mutations before A 2 becomes fixed is found to be approximately equal to k 10 /k 11 ¼ P 10 /P 11 . If the times between each successive event are ) 1, diversity completely recovers between loss events, and between the initial fixation and first loss event (it is shown below that this assumption can be relaxed). Applying Equation (10) from the previous section, and using the notation in Table 1, the expected sum (relative to 2N e ) of Dp values at the neutral site over the interval between the successive fixation events A 2 to A 1 and A 1 to A 2 is given by: A similar argument applies to the interval succeeding the fixation of the A 2 mutation and another fixation of an A 1 mutation, substituting 2 for 1 in the first subscripts for the Ps and ks in Table 1 (k 20 ) k 21 is assumed), giving: The expectation of the sum of Dp values over an entire cycle between successive fixations of A 1 mutations is simply Figure 6 The mean values and standard errors of the net changes in relative diversity over repeated loss events with 2 different N values, for deleterious mutations with h ¼ 0.1 and favorable mutations with h ¼ 0.9, using the same model and methods as in the right-hand panel of Fig. 5. Value of Dp at the neutral site, when an allele of type A i has just become lost from the linked selected site.

Dp if
Value of Dp at the neutral site, when an allele of type A i has just become fixed at the linked selected site.

Dp i0S
Sum of Dp values at the neutral site over the course of the loss of a type i mutation from the linked selected site.

Dp i1S
Sum of Dp values at the neutral site over the course of the fixation of a type i mutation at the linked selected site.
Dp T ¼ Dp 1 þ Dp 2 . We can thus estimate the expected value of Dp T per generation, Dp e , by dividing Dp T by the expected time between successive fixations of A 1 (in units of 2N e generations), : It is useful to note that the expression for T s is consistent with the existence of a stationary state for the proportion of sites fixed for A 1 vs A 2 , using the infinite sites assumption. If these proportions are denoted by X and 1 À X, respectively, stationarity exists if k 11 X ¼ k 21 (1ÀX), i.e. X ¼ k 21 /(k 11 þ k 21 ) (Bulmer 1991;McVean and Charlesworth 1999). At stationarity, the proportion of sites that are fixed for A 1 is proportional to the expected time a site spend in that state, so that X ¼ k 11 À1 /(k 11 À1 þ k 21 À1 ) ¼ k 21 /(k 11 þ k 21 ). All the quantities needed for determining the value of Dp e in Equation (11c), other than the mutational parameters at the selected site, h s and j, can be obtained from the integral formulae for the fixation probabilities, together with the simulation methods described in the previous section. The mutational parameters serve only to determine the magnitude of Dp e , and have no influence on its sign, provided that the assumptions concerning the times to recovery after fixation and loss events and the relative values of k i0 and k i1 are met. The general equations above are valid regardless of the frequency of recombination; the values of the Dp variables that appear in these expressions will, of course, be affected by recombination. Figure 8 shows an example of estimates of Dp e for the case of a neutral locus that is completely linked to a selected locus with equal mutation rates in each direction between deleterious and favorable alleles (j ¼ 1), as a function of the scaled selection coefficient, c. The deleterious allele (A 2 ) has dominance coefficient h ¼ 0.1, such that the relative fitnesses of heterozygotes and homozygotes for this allele are 1 -0.1s and 1 À s, respectively. As expected from the previous results, the enhancement of diversity is maximal (approximately 0.0008 with N ¼ 500) when c ¼ 1.5. The fact that Dp e is significantly negative for c ¼ 0 suggests that, as noted above, the assumption of a long recovery period between successive losses or fixations at the selected locus results in an underestimation of Dp e for small c.
In the example in the figure, the scaled mutation rate at the selected locus was 0.01 for both population sizes, corresponding Figure 7 The upper two panels show the approximate (full curves) and exact (dashed curves) sojourn time densities for mutations that become lost, relative to the corresponding neutral values. The lower two panels are the sojourn time densities for mutations that become fixed. The left-hand panels are for jcj ¼ 1 and the right-hand panels are for jcj ¼ 2. Deleterious mutations with h ¼ 0.1 are the red curves and beneficial mutations with h ¼ 0.9 are the black curves. The exact results were obtained by numerical integrations of the relevant equations described in the Appendix; the approximate results were obtained from Equations (A5) and (A7).
to an absolute mutation rate of 5 Â 10 À5 with N ¼ 50 and 5 Â 10 À6 with N ¼ 500; the results are not very sensitive to the absolute value of N for the same set of scaled parameters, so that the approximate values for an arbitrary h s can be obtained by multiplying the results in the figure by 100h s . In a population of size 10,000, the mutation rate would be 1.25 Â 10 À7 , corresponding to a nonrecombining region with 25 basepairs under selection with mutation rate 0.5 Â 10 À8 per basepair, which is approximately the same as the estimate for Drosophila melanogaster (Assaf et al. 2017).
A check on the validity of this approach is provided by the case when c is so large that the rate of fixation of deleterious mutations is negligible. This means that only the state when the population is fixed for the favorable allele A 1 needs to be considered. There is then a constant input of new mutations to A 2 alleles, which are successively lost from the population with a probability close to 1. This situation corresponds to the standard model of BGS, under which stochastic effects at the loci under selection are assumed to be negligible (Charlesworth et al. 1993). In this case, however, the assumption of a complete recovery of diversity at the neutral locus after each loss event is likely to be violated, as the large population size means that there is a high rate of input of new deleterious mutations that are then rapidly lost from the population, especially if we are dealing with a nonrecombining region with numerous genes subject to purifying selection.
This problem is examined in the second part of the Appendix, where it is shown that the results obtained with the assumption of complete recovery should still provide a good approximation in this case. The deviation of mean relative diversity from one can be predicted from the sum of the Dp values over the period covering the loss of an A 2 allele and the appearance of a new mutation to A 2 , as given by Equation (10), divided by the expected time between successive losses of deleterious mutations (equivalent to multiplication by k 10 ), as can be seen from Equation (A12). This prediction can be compared to the standard BGS formula for autosomal loci in a randomly mating population, which assumes that allele frequencies subject to selection are unaffected by drift, i.e. c ) 1. In this case, the reduction in diversity relative to neutral expectation at a neutral site completely linked to a selected locus or group of loci is approximately equal to u/hs provided that u/hs ( 1, where u is the net rate of mutation to deleterious alleles (Charlesworth et al. 1993). This can be equated to Dp e for the same values of u, h, and s when applying Equation (11c) to the simulations used here. To model large c values while retaining the assumption of small s, it is necessary to use simulations with a large population size (N ¼ 500). To generate these numbers, the scaled rate of mutation to deleterious mutations, h s , was arbitrarily set to 1; the values for an arbitrary deleterious mutation rate of u can be found by multiplying these values by 4Nu. Some examples are shown in Table 2; it can be seen that the predictions from the present approach converge on the values from the large population size formula as hc increases.

Figure 8
The expected deviation of relative diversity for a completely linked neutral site from its value in the absence of selection (Dp e ), at the stationary state under genetic drift, mutation and selection. The dominance coefficients for deleterious and favorable mutations are h ¼ 0.1 and h ¼ 0.9, respectively. Equal frequencies of mutations in each direction at the selected site were assumed, with a scaled mutation rate h s ¼ 0.01. The means and standard errors over replicate simulations are shown for population sizes of 50 (red points) and 500 (black points). Stochastic fluctuations in the frequencies of alleles at selected loci are known to reduce the effect of BGS on diversity (Charlesworth et al. 1993). Table 1 of Charlesworth et al. (1993) gives simulation results for a range of c values for the case of a nonrecombining region with a deleterious mutation rate of u ¼ 0.005, s ¼ 0.1, and h ¼ 0.2, so that u/hs ¼ 0.25 The ratio of the negative of the natural logarithm of a simulated p/h value to 0.25 provides a measure of the extent of the deviation from the deterministic prediction. These measures (with their standard errors) were as follows: 0.696 6 0.024 (c ¼ 20), 0.892 6 0.035 (c ¼ 40), 0.828 6 0.054 (c ¼ 80), and 1.056 6 0.049 (c ¼ 180). The corresponding ratios from the present method for these parameter sets were 0.510 6 0.015, 0.858 6 0.020, 0.992 6 0.020, and 1.124 6 0.016, respectively. In view of the approximations needed to obtain these results, there is reasonably good agreement with the exact simulation results.
The argument concerning the effect of the times between events presented in the Appendix can be extended to the case when there is a continual flux between A 1 and A 2 alleles, as in the case of the model of AOD discussed above. Here, the probabilities of fixation of both variants are of the order of 1/N H , whereas the probabilities of loss are of the order of one. The expected numbers of loss events between successive fixations are thus of order N H for both types of event. Provided that N H is not too small, the argument leading to Equation (A12) implies that the net effect on diversity is similar to the value when there is a complete recovery between loss events, so that Equation (11c) should provide a good approximation to the effects of successive losses, but there will still be an inaccuracy associated with the recovery period following a fixation event.

Discussion
The analytical and simulation results described here shed light on the effects of the fixations and losses of weakly selected or neutral mutations on levels of genetic diversity at linked neutral sites, first studied by Tajima (1990), and which have recently received renewed attention in the population genetics literature (Mafessoni and Lachmann 2015;Johri et al. 2021;Kaushik and Jain 2021;Moinet et al. 2021). As described in the previous two sections, these effects can largely be understood in terms of the effects of the selection parameters on the times to fixation or loss, conditioned on fixation or loss, with some slight complications.

Conditional fixation and loss times with weak selection
One might expect selection on favorable mutations to reduce their mean time to fixation relative to neutrality, and selection against deleterious mutations to have the opposite effect, with the converse applying to losses of mutations. As described above, this is not necessarily the case. Mafessoni and Lachmann (2015) used numerical integration of the relevant diffusion equation formulae for autosomal mutations with random mating to show that the mean fixation times (conditioned on fixation) of weakly selected dominant or partially dominant (h > 1 =2) mutations, as well as of weakly selected, recessive or partially recessive (h < 1 =2) deleterious mutations, can be larger than the corresponding neutral values. They also showed that, under similar conditions, the mean conditional times to loss of new mutations are larger than the neutral values. For sufficiently large values of the magnitude of the scaled selection coefficient, jcj ¼ 2N e jsj, however, fixation and loss times are always lower than the neutral values when there is directional selection (0 h 1). The approximations derived here (Equations 2 and 3), which are accurate with respect to second-order terms in c, confirm these findings (see also Kaushik and Jain 2021, Equation 9). They provide a reasonably good fit to the numerical integration and simulation results for jcj values of the order of 2 or less, provided that the population size is sufficiently large (Figs. 1 and 2).
Effects of weak selection on neutral diversity at linked sites Mafessoni and Lachmann (2015) also showed that fixations of partially recessive favorable or partially dominant deleterious mutations can increase the mean level of diversity (p) at a linked neutral site, compared with the corresponding value for fixations of neutral mutations, if this is measured at the time of fixation. The conditions for such an increase are similar to those for an increased time to fixation (see also Johri et al. 2021;Kaushik and Jain 2021). The simulation results described here confirm this finding, and give similar results for losses of deleterious mutations ( Fig. 5 and Supplementary Fig. 5). However, the diversity levels at the times of fixation or loss are always lower than the mean equilibrium neutral diversity, h ¼ 4N e m, even if these events involve purely neutral mutations, as was first described by Tajima (1990). As was explained in Effects of weak selection on variability at linked neutral sites, this effect is a consequence of conditioning on an unusually short coalescent time at the neutral site linked to the site under observation, and would not be expected to occur if we observe the mean diversity at this site over a long time period that includes multiple fixation or loss events. The question of whether diversity can be increased above h by weak selection under appropriate conditions is thus not fully answered by these results.
A simple approximate method for evaluating the effects of successive fixations or losses at a site linked to focal neutral site was described above (Equation 10). This combines the sum of the diversities at the focal site over the generations while a fixation or loss event is in progress with the sum of the diversities over the generations that intervene until the next such event, during which diversity recovers toward the neutral equilibrium value. As shown in Figs. 5 and 6 and Supplementary Figs. 4 and 5, the mean diversity taken over all generations during a fixation or loss event can be increased over the neutral value when jcj is sufficiently small, and h < 1 =2 for deleterious mutations or > 1 =2 for favorable ones, partly due to mutational divergence between the haplotypes carrying the two different alleles at the site under selection. Under suitable conditions (a sufficiently long duration of the fixation or loss event), this effect can outweigh the reduction in diversity at the end of the fixation or loss event, resulting in a net increase in mean neutral diversity when taken over the entire period.
These considerations yield the seemingly paradoxical result that neutral diversity can be enhanced by fixations or losses of weakly selected favorable or deleterious mutations, in contrast to the usual assumption that diversity is reduced by fixations of favorable mutations (selective sweeps) or losses of deleterious mutations (BGS). It has, however, long been known that neutral diversity can in principle be increased by selection against deleterious recessive or partially recessive mutations at closely linked sites-the process of AOD (Ohta 1971;Latter 1998;Pamilo and Palsson 1998;Palsson and Pamilo 1999;Wang and Hill 1999;Frydenberg 2009;Becher et al. 2020;Gilbert et al. 2020;Waller 2021). A correct analytical treatment of this process for the simplest case of a single selected locus and a linked neutral locus has, however, only recently been provided (Zhao and Charlesworth 2016). As shown in Fig. 4, the critical dominance coefficient for the operation of AOD vs BGS as a function of |c| has similar, but not identical, properties to the conditions for increases over the neutral value of the mean conditional fixation and loss times of new deleterious or favorable mutations.
The Relevance to AOD and BGS describes how to relate the simulation results for the effects of selection on the diversity statistics at a linked neutral locus, when there is a continual flux of mutations between sites fixed for deleterious and favorable mutations. Under this scenario, the net mean deviation from one of p/h is given by Dp e in Equation (11c). Fixations and losses contribute approximately equal amounts to Dp e ; although the effects on diversity of losses are much smaller than those of fixations, this is offset by the much higher frequencies of loss events.
The results described here provide a new perspective on the relation between AOD and BGS. If one imagines a locus subject to reversible mutation between a wild-type allele (A 1 ) and a deleterious allele (A 2 ), the standard model of BGS corresponds to the situation when selection against A 2 is so strong (jcj ) 1) that there is effectively no possibility of fixations of reverse mutations to A 1 , and the system can be treated as though it is at equilibrium under mutation and selection, as in the standard formulae used to describe the effect of BGS on neutral diversity (Charlesworth et al. 1993;Hudson and Kaplan 1995;Nordborg et al. 1996). In reality, the population size is finite, so mutations from A 1 to A 2 are constantly occurring and being quickly lost from the population, with a probability close to one when jcj ) 1. As shown in Table 2, the application of the approach described here to this situation closely approximates the properties of BGS when finite population size is modeled by exact simulations.
If jcj is sufficiently small, however, the effects of genetic drift and reversible mutation between A 1 and A 2 need to be considered jointly, as in the Li-Bulmer model of selection on codon usage (Li 1987;Bulmer 1991;McVean and Charlesworth 1999). With jcj j 2 or so and h for deleterious mutations less than 1 =2, the results enshrined in Equations (11) show that diversity at linked neutral sites can be increased over neutral expectation when the population is at statistical equilibrium under drift, mutation, and selection for sites under selection. These findings complement the results of the analysis of AOD by Zhao and Charlesworth (2016), who examined the rate of loss of neutral variability in a population that was initially at statistical equilibrium, and then placed into an environment with a relatively small N e . As noted already, the conditions on the dominance coefficient as a function of jcj that allow an enhancement of variability are similar for the two approaches. The framework described here is more appropriate than that of Zhao and Charlesworth (2016) for populations maintained for a long time at low effective population sizes, as is the case in some laboratory experiments that have yielded evidence for AOD (Latter 1998), and for low recombining genomic regions in large populations, where recent work has also suggested the operation of AOD (Becher et al. 2020;Gilbert et al. 2020).
Interpreting the effects of selection on the conditional sojourn times, t* and t** Here, intuitive interpretations are presented of the conditions for increases in the mean conditional times to fixation (t*) and loss (t**) over their neutral expectation. A more rigorous approach to this question is given in Supplementary File 1, Section 3. One important point to note is that Equations (2) and (3) show that the first-order terms in ca in the expressions for t* and t** are zero when b ¼ 0 (h ¼ 1 =2 for autosomal mutations), so that the conditional sojourn times are then approximately the same as with neutrality when selection is very weak. This finding suggests that the first-order effects of selection that depend on the term in ca in Equation (1) are absorbed into the probabilities of fixation and loss, so that the conditional sojourn times are controlled by cb alone when selection is very weak. Another relevant point is that the relative effectiveness of selection vs drift can be quantified by dividing Equation (1) by x(1 À x), which gives the ratio of the selective change in allele frequency per generation to the sampling variance under drift, x(1 À x)/2N e . This ratio is denoted here by f(x) ¼ c (a þ bx). If cb < 0, the relative effectiveness of selection in causing a movement of x away from zero, as measured by f(x), is reduced, compared with the quasi-neutral case with cb ¼ 0, and decreases as x increases.
The condition for weak selection to cause an increase in t* over neutrality is then relatively easy to interpret (see Mafessoni and Lachmann 2015 for a different viewpoint). If c > 0 and b < 0 (h > 1 =2 for an autosomal mutation), f(x) tends to be decreased by selection compared with quasi-neutrality, especially at larger values of x, so that the net time to reach fixation is increased by selection, and the times spent at larger values of x are increased relative to the neutral case. If c < 0 and b > 0 (h < 1 =2 for an autosomal mutation), there is a stronger tendency for x to move toward zero than under quasi-neutrality; because we are conditioning on fixation of A 2 , this causes the sojourn time to be increased over neutrality. The pull toward lower values of x is weaker for small x, so that the time spent at low values of x is increased relative to the neutral case. These effects on the sojourn time densities at different frequencies are illustrated in the lower panels of Fig. 7.
It is less easy to interpret the properties of t**, because the argument used for t* would at first sight suggest a reduction rather than an increase in t** when cb < 0. The most plausible interpretation is that losses of new mutations are largely caused by drift, and take place rapidly as long as x remains close to 0. However, the time for an A 2 mutation to reach a relatively high frequency is increased by weak selection when cb < 0. It is then relatively immune to loss, and hence spends longer segregating in the population. This interpretation is consistent with the fact that the sojourn time densities relative to the neutral values are increasing functions of x for both favorable and deleterious mutations, as is shown in the upper panels of Fig. 7.

Conclusions and future prospects
The work described here illuminates the conditions under which weak directional selection can interact with genetic drift to cause an increase rather than a decrease in genetic diversity at linked neutral sites. It also sheds light on the conditions under which AOD rather than BGS operates. The results are, however, limited in several important respects. First, only the pairwise diversity measure p has been studied, so that the properties of the site frequency spectra at neutral sites linked to the target of selection have not been examined; the results of Mafessoni and Lachmann (2015) and Johri et al. (2021) suggest that an increase in variability at a neutral locus caused by fixations of linked weakly selected mutations is accompanied by a reduction in the frequencies of rare variants relative to the standard neutral expectation. Further work is needed to investigate the magnitude and direction of distortions of the site frequency spectrum in the context of recurrent fixations and losses of weakly selected mutations.
As described above, these events can cause AOD, which is expected to cause a skew toward intermediate frequency variants (Becher et al. 2020;Gilbert et al. 2020).
Second, the extent to which multiple weakly selected loci will mutually affect each other has largely been unexplored; a recent review of relevant data suggests that such effects of multiple loci may be important for explaining the unexpectedly high levels of inbreeding depression and variation in quantitative traits in small populations (Waller 2021). Previous simulation work has shown that, with low rates of recombination and many tightly linked highly recessive or deleterious mutations, the population can "crystallize" into two haplotypes carrying complementary sets of mutations that exhibit pseudo-overdominance (Charlesworth and Charlesworth 1997;Palsson 2001;Gilbert et al. 2020); there is evidence for less severe effects, causing a retardation of loss of variability, when multiple loci are subject to deleterious mutations in small populations (Latter 1998;Bersab e et al. 2016). Further investigation of this topic is desirable. It would also be of interest to investigate the properties of subdivided populations, where stochastic effects on loci under selection can be significant when deme sizes are sufficiently small (Roze and Rousset 2004;Roze 2015;Charlesworth 2018).
Finally, the properties of fixation times in varying environments can be significantly different from those for a constant environment that are used here, with a breakdown in the symmetry between h and 1Àh for favorable and deleterious mutations as far as t* is concerned (Kaushik and Jain 2021). It is likely that this will also apply to times to loss. The relations of these quantities with AOD in small laboratory populations will probably not be affected by this effect, but the behavior of natural populations could be significantly changed.

Data availability
No new data or reagents were generated by this research. The codes for the computer programs used to produce the results described in the study are available on figshare: https://doi.org/10. 25386/genetics.19126679.
Supplemental material is available at GENETICS online.