Local adaptation can cause both peaks and troughs in nucleotide diversity within populations

Local adaptation is expected to cause high FST at sites linked to a causal locus, however this pattern can also be driven by background or positive selection. Within-population nucleotide diversity could provide a means to differentiate these scenarios, as both background and positive selection deplete diversity, whereas some theoretical studies have shown that local adaptation increases it. However, it is unclear whether such theoretical predictions generalize to more complicated models. Here, we explore how local adaptation shapes genome-wide patterns in nucleotide diversity and FST, extending previous work to study the effect of variable degrees of polygenicity and genotypic redundancy in an adaptive trait, and different levels of population structure. We show that local adaptation produces two very different patterns depending on the relative strengths of migration and selection, either markedly decreasing or increasing within-population diversity at linked sites at equilibrium. When migration is low, regions of depleted diversity can extend large distances from the causal locus, with substantially more diversity eroded than expected with background selection. With higher migration, peaks occur over much smaller genomic distances but with much larger magnitude changes in diversity. In spatially extended clinal environments both patterns can be found within a single species, with increases in diversity at the center of the range and decreases towards the periphery. Our results demonstrate that there is no universal diagnostic signature of local adaptation based on nucleotide diversity, however, given that neither background nor positive selection inflate diversity, when peaks are found they strongly suggest local adaptation.


INTRODUCTION
Understanding how evolutionary processes shape genetic variation is crucial for interpreting patterns across the genome.The number of pairwise differences between nucleotide sequences, the nucleotide diversity (π), is widely used to infer effective population size (Wright 1931;Wang et al. 2016), study the signature of selective sweeps (Booker et al. 2017), and test theories about the maintenance of variation (Buffalo 2021).As a measure of within population variation, it is also related to FST, an index used to study patterns of genetic differentiation among populations, Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 as compared with the genetic variation found within populations (Wright 1951).Early genome scan studies identified outlier peaks in FST as putative indicators of locally adapted loci (reviewed in Via 2009;Nosil et al. 2009), because strong selection is expected to drive high differentiation in allele frequency at selected loci (Lewontin and Krakauer 1973) and linked neutral sites (Charlesworth et al. 1997, Feder andNosil 2010).Subsequent reinterpretation of these patterns, however, suggested that outlier peaks in FST could also be generated by reductions in within-population diversity driven by "linked selection" (Noor and Bennett 2009;Cruickshank and Hahn 2014), either as a result of recent selective sweeps (Maynard Smith and Haigh 1974;Kaplan et al. 1989;Stephan et al. 1992;Braverman et al. 1995;Gillespie 1997Gillespie , 2000Gillespie , 2001) ) or background selection (Charlesworth et al. 1993;Charlesworth 1994;Hudson and Kaplan 1995;Gillespie 1997).Furthermore, some studies have demonstrated that genome-wide patterns in FST tend to be inversely correlated with both recombination rate and nucleotide diversity, suggesting that the search for the causal loci driving local adaptation may be obfuscated by the recombination and/or diversity landscapes across the genome (Burri et al. 2015;Vijay et al. 2017;Irwin et al. 2018).
In light of these studies, it is now well-recognized that both hard sweeps and background selection have the potential to reduce genetic variation at linked sites (Booker et al. 2019) high among-population variation as a consequence of incomplete sweeps or recombination during a sweep, which may be sufficient to explain observed genome-wide patterns of FST in many cases (Bierne 2010; Booker et al. 2019).
Regardless of what drives genome-wide patterns of FST, it remains that local adaptation does often occur (Hedrick et al. 1976;Linhart and Grant 1996;Hereford 2009), and as such, some signatures of elevated FST may also be expected in species with local adaptation.Withinpopulation nucleotide diversity (hereafter: πw) is now commonly used to infer the possible activity of background or positive selection at linked sites, and therefore also used to inform whether observed FST values might indeed be driven by local adaptation.However, it is not immediately clear how local adaptation should affect πw and whether the expectation should differ from background or positive selection.It is therefore important to understand how local adaptation affects πw, especially as it pertains to interpreting genome scan results.
For an unlinked neutral locus in an island model, expected πw is 4•Ne• when migration rate is 0 and 4•d•Ne• when m > 0 (where Ne is effective population size,  is the per-locus mutation rate, m is migration rate, and d is the number of demes; Nordborg 1997;Wakeley 2009).When a neutral locus is linked with a locally adapted locus and migration is rare, nucleotide diversity will be depleted at the neutral site (Nordborg 1997).Nordborg (1997) likened the effect of migrationselection balance in this range of parameter space to that of background selection, which also decreases πw at linked sites (also see Aeschbacher and Bürger 2014;Fig. 8).It is less clear, however, what happens to πw as migration rate increases, and the above models make assumptions that limit their applicability to high migration.It is well accepted that strong balancing selection increases total nucleotide diversity at linked sites (Hudson and Kaplan 1988;Barton and Navarro 2002;Charlesworth 2006), and divergent selection with high migration would therefore have similar effects (Nordborg and Innan 2003).It is unclear, however, how such diversity would be partitioned within vs. among populations and how this would change with migration-selection balance.The set of individuals with a given divergently selected haplotype can be considered analogous to a population, and we would expect reduced diversity around a selected site within this set, and increased diversity among sets.However, while selection acts to increase the assortment of locally adapted haplotypes to the population where they are favoured, migration mixes haplotypes and inflates diversity, and as such, increased πw might be expected.Indeed, Charlesworth et al. (1997) showed an increase in πw near the locally adapted locus for a model that also included background selection (their Fig. 7A), and for an analytical model without background selection (their Table 1).More recently, Sakamoto and Innan (2019) analyzed a two-population model and found a small peak in πw around the locally adapted locus, but focused more of their analysis on the decrease in πw around the selected site that occurs during the initial establishment of a locally adapted polymorphism.As most studies on the effect of migration-selection balance on πw at linked sites have used relatively simple genetic architectures and patterns of population structure, further consideration of this question is necessary.
In the present study, we describe how local adaptation over heterogeneous landscapes shapes patterns in nucleotide diversity (both πw and dxy) and FST at the neutral regions flanking a selected locus over a wide range of migration-selection parameter space.We begin by using individual-based simulations of two-patch models with a single selected locus, then explore models with polygenic adaptive traits and varying degrees of genotypic redundancy, and lastly, investigate more complex patterns of population structure by exploring a ten-patch stepping Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 stone model.We show that both troughs and peaks in πw may be expected around a locallyadapted locus, depending on the parameters involved.

MATERIALS AND METHODS
To understand how local adaptation over heterogeneous landscapes shapes patterns in nucleotide diversity we performed simulations using two different landscape models: a twopatch model (with and without genotypic redundancy) and a linear ten-patch model (Table 1; Fig. S1).We performed our simulations with the stochastic, forward -time, individual-based simulation program Nemo, version 2.3.46 (Guillaume and Rougemont 2006).Our simulations followed the Wright-Fisher model with the addition of selection, migration, and mutation.We modeled a single trait under Gaussian stabilizing selection, where the fitness of an individual (W) was defined as Where z was an individual's phenotypic value, an additive function of the allele effect size at each locus (i.e., no epistasis or dominance effects on phenotype);  was the optimal phenotypic value of the local patch; and VS was the strength of selection on the genotype as described by the variance around the fitness function.Unless otherwise stated, a VS of 5 was used.After calculating the base fitness value of each individual within a patch, an individual's fitness was scaled against the mean fitness of the local patch.
Individuals had a single diploid chromosome where each divergently selected locus was symmetrically flanked by 74 neutral loci positioned at distances from 10 -3 to 10 cM away on a log10 scale (Fig. S2 & S3).In the case of multiple adaptive loci on a chromosome, each adaptive Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 locus and its 74 flanking neutral loci was separated from the next closest adaptive locus and associated neutral loci by 50 cM, such that one complement of 75 loci was unlinked from any other complement of 75 loci (Fig. S3).Neutral loci were diallelic and mutation occurred at a rate of 10 -5 per locus per generation.Similarly, unless otherwise stated, mutation occurred at the selected loci at a rate of 10 -5 .Simulations were initialized whereby neutral loci were randomly assigned allele values.We acknowledge that maximizing the initial standing variation in this way is not the most biologically realistic scenario, however, the alternative option afforded by Nemo was to initialize simulations with zero standing variation, no more biologically realistic.We show that our results are qualitatively insensitive to the degree of standing variation the populations were initialized with (Fig. S4).
Forward migration rates were varied between 10 -5 to 10 -½ with four equal increments per order of magnitude, in addition to a migration rate of zero.Unless otherwise stated, each patch was comprised of 1,000 individuals.Each simulation replicate was run for a total of 25•N•d generations, where N was the population size by patch and d was the number of patches in the metapopulation.The within-and between-population nucleotide diversity, total metapopulation nucleotide diversity and FST were then calculated at each locus after 25•N•d generations, except in the case of the single-locus, two-patch model, where they were iteratively calculated every ½•N•d generations.After this amount of time, populations had typically approached a steady state, but we note that at very low migration rates, populations approached true equilibrium very slowly (e.g., Fig. S5), so we refer to this point as quasi-equilibrium.

Single-Locus, Two-Patch Model
In the single-locus, two-patch model, the adaptive locus was multiallelic and mutation occurred whereby a new allele effect size was drawn from a normal distribution ( = 0,  2 = 1) Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 and added to the former allele effect size (i.e., continuum of alleles).Two different mutation rates were explored, an unscaled rate independent of population size (10 -5 ) and a scaled rate standardized by population size (10 -2 / N) (i.e., populations had the same number of mutational events per generation regardless of population size).

Multiple Adaptive Loci, Two-Patch Model
In models with polygenic adaptive traits, adaptive loci were diallelic and mutation occurred whereby the original allele would be replaced by the opposite allele (i.e., house of cards).In the genotypically nonredundant model, the allele effect sizes were scaled relative to the number of adaptive loci such that an individual needed to be homozygous for the optimal allele at every locus in order to achieve the optimal phenotype in a given patch.By contrast, in the genotypically redundant model, the allele effect sizes were set to ± 0.25 regardless of the number of loci, such that an individual could reach the phenotypic optimum (± 1 divergent selection; + 1 uniform selection) by being homozygous for the optimal alleles at any two loci.

Single-Locus, Ten-Patch Model
Our ten-patch model (Fig. S1) consisted of demes in a linear conformation and followed the stepping stone migration model (i.e., dispersal was only possible between directly adjacent patches).The phenotypic optimum scaled linearly across the ten patches.The adaptive locus was multiallelic and mutation occurred as in the single-locus, two-patch model, where a new allele effect size was drawn from a normal distribution ( = 0,  2 = 1) and added to the former allele effect size (i.e., continuum of alleles).

Study Metrics
Nucleotide diversity (π) was calculated as Where xi and xj were the respective frequencies of the i th and j th sequences in a population and πij was the number of nucleotide differences between the i th and j th sequences (Nei and Li 1979).
As well, we report the FST per locus returned by Nemo, which was calculated using Weir and Cockerham (1984).We regressed the nucleotide diversity or FST at a neutral locus on its log10transformed distance from an adaptive locus (cM) to quantify the relationship between diversity or FST and distance from an adaptive locus.As an additional way to explore the effect of selection and linkage on diversity, we compared the levels of nucleotide diversity or FST at the neutral loci 0.001 cM away from the adaptive locus to those 10 cM away.
In order to study the effect of selection across the chromosome, we calculated the mean level of nucleotide diversity that persisted under strong selection (VS of 5) at all neutral loci between 9 to 10 cM away from the adaptive locus, and compared this to the genome-wide background levels of diversity across the chromosome under neutral evolution (VS of 10 9 ).For this specific analysis we added additional neutral loci to the ends of the chromosome, such that there were 100 loci positioned from 9 to 10 cM away from the adaptive locus, in even steps, at either end of the chromosome.The additional neutral loci were added in order to reduce the noise in our result and did not affect the overarching patterns seen.
We identified peaks in nucleotide diversity as those with a significant slope of diversity by log10-transformed distance according to a t-test and at least 25% of neutral loci with diversity levels in excess of 1.1 times the genome-wide background level.To quantify the width of a peak in diversity, we regressed the nucleotide diversity of all neutral loci with levels in excess of the Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 genome-wide background on their distance from the adapted locus; the x-intercept of the regression was taken as one half of the width of the peak.
Finally, we estimated pairwise linkage disequilibrium between the adapted locus and each neutral locus across the metapopulation as a whole.Pearson's r 2 was taken as an estimate of linkage disequilibrium.

Comparison with Previous Analytic Predictions
We compared our simulation results for the πw at a tightly linked locus (10 -3 cM) to the analytical predictions for the expected within-population heterozygosity from Sakamoto and Innan (2019) equation 25.Where we model Gaussian fitness acting on the phenotype (to facilitate comparison among single-and multi-locus traits), Sakamoto and Innan (2019) used selection coefficients acting on an individual locus in each patch (si).To compare models, we set each of the s terms in eq. 25 to match the reduction in fitness for a locally optimal individual moving to the non-optimal patch (and ignored the effect of dominance), which requires asymmetrical coefficients (s1  |s2|).We also report the comparison between models under symmetrical selection coefficients.
We note that it can be difficult to match simulation results with analytical predictions when very rare events contribute to average behaviour.For example, under a model of pure neutrality, the result that mean πw is invariant with migration in a finite island model (Nordborg 1997;Wakeley 2009) occurs because when migration is very low, most replicates have very low nucleotide diversity (near 4Ne), but in rare cases a recent migrant introduces large amounts of variation (due to high divergence among lineages), such that on average πw = 4dNe.As results from simulations take the average across a given set of replicates, the mean πw estimated in Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 simulations can tend towards 4Ne for neutral loci when migration rates are very low, if the sampled replicates don't happen to include a recent migrant (Fig. S5).Thus, simulation results can appear at odds with analytical predictions about mean πw, but are representative of the median behaviour of πw, which is likely more biologically realistic than the arithmetic mean (given that when migration is very low, few if any individual replicates actually have πw = 4dNe; Fig. S5).This illustrates a discordance that is also encountered in our simulations of selection with linked neutral loci: at low migration rates, taking the average across a large but finite number of replicates may fail to capture the influence of very rare migrants on arithmetic mean πw, but do still represent the average behaviour of most replicates (which is arguably biologically more realistic).

Migration-Selection Balance
To explore the effect of selection on πw at linked sites, we calculated the slope of the regression of mean πw on the distance from the selected locus, which we will refer to as the diversity-distance-slope (dd-slope).When this slope was positive, πw tended to be substantially depressed near the selected site (as occurs with a selective sweep or background selection), whereas a peak in πw around the selected site was present when the slope was negative (see Fig. 1 for examples).In the single-locus, two-patch model we observed a non-monotonic relationship between migration rate and the dd-slope, with slopes of zero when migration rate was zero, positive slopes at very low migration rates, and negative slopes at intermediate-high migration Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 rates, with a transition between these opposite patterns at low-intermediate migration rates (Fig. 2a).These patterns can also be seen by contrasting the πw at the neutral loci nearest the adapted locus compared to those furthest away (Fig. 2b).When the dd -slope was positive we found that the πw was substantially depressed across the entire length of the chromosome (10 cM on either side of the selected locus) relative to genome-wide background levels (Fig. S6a), whereas when the dd-slope was negative we observed a more restricted effect across the chromosome, with peaks in πw of 0.14 -1.18 cM in width beyond background levels (Fig. S6b).
In cases where migration was too high to permit the maintenance of local adaptation (e.g., m > 10 -1.25 at VS = 5; Fig. S7), the dd-slope tended to return to 0 (Fig. 2a) and the per locus πw at tightly linked neutral loci declined to approximate the drift expectation, as indicated by the case with Vs = 10 9 (grey line, Fig. 2b).Increasing the strength of selection shifted the above-described patterns so that the peaks and transitions occurred at higher rates of migration, and also increased the maximum magnitudes of both the peak positive and peak negative dd -slopes (Fig. 2a-b).
Additionally, we used the same approach to examine patterns in total metapopulation nucleotide diversity, dxy and FST.As might be expected from previous theoretical work (Charlesworth et al. 1997;Sakamoto and Innan 2019), the between-population dd-slope (Fig. S8) and the slope of FST by distance (Fig. 2c) were always negative and reached a maximum magnitude at intermediate migration rates, as these conditions maximized the difference between the dxy or FST at the selected locus and the same metric at unlinked neutral loci.
We found high qualitative concordance between our results for the πw at a tightly linked locus (10 -3 cM) and Sakamoto and Innan's (2019) analytical prediction for the expected heterozygosity with both asymmetrical (Fig. 2b) and symmetrical nonzero selection coefficients (Fig. S9).In our simulation results, however, we did find a strong effect of the strength of selection on the Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 maximum magnitude of the peaks in diversity observed over high migration rates.Conversely, the magnitude of the peaks in expected heterozygosity predicted from Sakamoto and Innan (2019) appear relatively insensitive to the strength of selection.

Effects of Population Size
We investigated how altering the population size of each patch affected the patterns in πw and FST described above.Broadly speaking, increasing the population size increased the value of both the dd-slopes and the slopes of FST by genetic distance over all migration rates below the critical rate (Fig. 3a,c).Over intermediate-high migration rates, increasing the patch size to 10,000 eliminated the negative dd-slope trend (Fig. 3a) and any peaks in πw beyond the neutral expectation (Fig. 3b) seen with smaller population sizes.Across these intermediate-high migration rates, the linkage disequilibrium between neutral loci and the locally adapted locus decayed much more rapidly with larger population sizes (Fig. S10).Finally, there was little noticeable effect of scaling the mutation rate by population size (Fig. 3a,c).

Patterns through Time
To explore how patterns in πw and FST might change with time, we examined the slopes at 1000-generation intervals.Both the dd-slopes and the slopes of FST by distance consistently decreased with time until reaching their respective quasi-equilibrium values (Fig. S11a,c).
Additionally, the per locus πw steadily decreased with time until equilibrating, where the loci closest to the locally adapted locus reached quasi-equilibrium earlier and the loci furthest away later (Fig. S11b).

Effects of Multiple Adaptive Loci and Genotypic Redundancy
When there was no genotypic redundancy (i.e., when mutations at all loci were needed to yield a locally optimal phenotype), an increase in the number of adaptive loci corresponded to a decrease in the net effect of selection on each individual locus, as each locus had a smaller allele effect size.Thus, the effect of increasing the number of loci (Fig. 4) closely resembled the effect of reducing the strength of selection observed in the single-locus model (Fig. 2).In contrast, when there was genotypic redundancy in the trait (i.e., more loci than the number of mutations needed to reach the local optimum) and each adaptive locus had the same effect size regardless of the total number of loci involved, increasing the number of loci did not shift the patterns of dd-slope with migration through the parameter space (Fig. 5).
Across low migration rates where we found reduced πw around the focal site, we observed an interaction between the number of adaptive loci contributing to a trait and whether or not there was genotypic redundancy (Fig. 4 & 5).In the case with no redundancy, the relationship between dd-slope and migration attenuated with an increasing number of loci, with the transition point between positive and negative slopes occurring at progressively lower migration rates with increasing number of loci (Fig. 4).By contrast, in the case with redundancy, there was an attenuation in the increase in πw found at high migration rates with an increasing number of loci, but little change in the decrease in πw found at low migration rates (Fig. 5) This attenuation effect was driven by similar patterns across all loci, rather than as a result of taking the arithmetic mean across few loci with strong patterns and many loci with weak patterns (Fig. S12).For genotypically redundant traits, we found that roughly 50% of the adaptive loci were highly differentiated between patches when migration was low (i.e., allele frequency differences of 95% In certain regions of migration-selection parameter space (e.g., m = 10 -1.75 , VS = 5) it was possible to find both strong peak and strong trough signatures in a single population, so we further investigated the dynamics at the adaptive locus here to better understand how adaptation over environmental heterogeneity occurs.Adaptation in these regions of parameter space involved the interplay of a number of different adaptive alleles segregating in each patch at once (Fig. S17), where patches on the interior of the landscape had a larger number of different alleles relative to those on the periphery (Fig. S18).Very generally, populations evolved phenotypic values that approached their local optima through different combinations of two large effect size alleles (~ +/-0.4) and an intermediate allele (~0): populations on the periphery approached their local optima by being homozygous for a single allele of large effect (i.e., one of ~ +/-0.4),whereas populations in the interior tended to be homozygous for an intermediate allele (~0) or had two alleles of large effect of opposite signs (Fig. S17).

Local adaptation can cause peaks or troughs in nucleotide diversity
To study how local adaptation in heterogeneous environments shapes patterns in nucleotide diversity within populations, we assessed πw at neutral sites linked to a causal locus driving a trait under spatially divergent selection over a wide range of parameter space.Broadly, we demonstrate that no single signature for πw is characteristic of local adaptation.As most previous work has focused primarily on studying among-population diversity (i.e., FST, dxy) as the primary signature of local adaptation, this helps contextualize the contrasting results about πw found in the literature (Petry 1983;Nordborg 1997;Charlesworth et al. 1997;Sakamoto and Innan 2019).Given that local adaptation can generate such contrasting patterns in πw, we do not advocate for identifying putative genetic signatures of local adaptation solely using patterns in πw at the expense of patterns in among-population diversity, rather, we suggest a more holistic approach, using patterns in πw to help contextualize patterns in among-population diversity.We now summarize how evolutionary processes interact to yield these contrasting patterns in πw.
When migration is sufficiently low that migrant haplotypes don't persist for long and are rapidly selected out of the population, local adaptation produces a pattern resembling background selection (Fig. 2a, positive region, as per Nordborg 1997).In the two-patch model here, this results in πw ~1.5x lower than at the unlinked locus (Fig. 2b), which experiences an effective population size more congruent with that of the metapopulation as a whole (Whitlock and Barton 1997).The widths of the regions of depleted πw observed here are similar to the expectations for background selection (as per Nordborg 1997), where diversity is predicted to be depleted on the order of 10's of cM away from the causal locus under similar conditions (Hudson and Kaplan 1995).By contrast, with selective sweeps, diversity is predicted to be depleted more deeply, but over a narrower region, on the order of centiMorgans away from a focal locus (Barton 2000).While the width of the region observed here is similar to the expected width under background selection (Fig. S6a), the magnitude of depletion is substantially greater with local adaptation (Fig. 2a).The effect of background selection can be seen when m = 0, as both populations evolve towards their respective equilibria and further mutations are deleterious and are selected against.
It is interesting that our simulations show that as migration rate decreases, πw at tightly-linked sites tends towards the purely neutral expectation for a single deme without migration (4Ne), approaching this across higher migration rates than observed for loosely-linked sites (Fig. 2b).At Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 first glance, these results can appear to conflict with the classic prediction from a purely neutral island model, where mean πw = 4dNe, which is insensitive to migration (Maruyama 1971;Nei and Feldman 1972): if there is no net effect of selection on a weakly-linked neutral locus, then shouldn't πw also be insensitive to migration?One factor that differs between these approaches is time: the analytical models provide equilibrium solutions, whereas our simulations report patterns after 25Nd generations (see Fig. S11 for temporal change).The time to approach equilibrium in such models can exceed millions of generations at low migration rates (Fig. S5), so considering both the equilibrium conditions and patterns during approach provides some insight.However, there is also a more fundamental problem to contend with in theoretical studies: is using the arithmetic mean as a summary statistic actually biologically representative?
The classic (and surprising) result that πw = 4dNe is insensitive to migration occurs because the arithmetic mean is taken across two types of evolutionary behaviour: replicates that have recently undergone a migration event (and have elevated πw), and those that have not (Nordborg 1997;Wakeley 2009).As migration rate decreases, FST increases and each migrant causes a greater inflation in πw, but the proportion of replicates with a recent migrant tends towards zero, becoming essentially undetectable by simulations studies that are computationally constrained to a finite number of replicates (e.g., Fig. S5).Thus, in simulations with a modest number of replicates, the arithmetic mean across replicates does not yield the classic analytical result, and is instead "biased" towards the expectation for replicates without a recent migrant (which tend to be the only ones present when a modest number of replicates have been run).
But is the classic analytical result of πw = 4dNe actually representative of biology?In simulations of the purely neutral model at low migration rates (Fig. S5) almost all individual replicates have πw either much higher than 4dNe, or much closer to 4Ne, and almost no Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 replicate has πw = 4dNe.Similarly, while our simulation results with selection and linkage may fail to capture the impact of the rare replicate with a rare recent migrant on observed mean πw at low migration rates, the average observed πw across simulation replicates more realistically captures the expectation for a typical metapopulation (indeed, a more accurate way to portray results would be to show the distribution of πw across replicates).The decrease in πw at tightlylinked sites that we observe at low migration rates and strong selection can therefore be interpreted as the most likely evolutionary outcome, such that πw tends towards the expectation for a single deme.Of course, appropriate considerations must also be made for the temporal change in such patterns as populations approach equilibrium, or are perturbed away from it.
Given the myriad ways that different evolutionary scenarios can generate peaks or troughs in diversity, and the considerable heterogeneity observed around the expectation for a given parameter set (Fig. S5), it is difficult to make any clear inference for any given point observation of a peak or trough in empirical data.
Based on these results, we would predict that particularly extreme reductions in πw at linked sites might be seen in small peripheral populations experiencing weak migration and strong selection.In this case, neutral regions of the genome would have levels of πw similar to those expected for the effective size of the metapopulation, whereas loci linked to the selected locus would have levels of πw similar to those expected for the effective size of the small peripheral population, which could be much more discordant than found with the symmetrical population sizes simulated here.In such regions of parameter space where we find an erosion of πw at the neutral loci flanking locally adapted loci, we also find an increase in FST at the same sites (Fig. 2c).Thus, this pattern which has been interpreted as a result of background selection or uniform positive selection (Noor and Bennett 2009;Cruickshank and Hahn 2014), can also be driven by  (e.g. Petry 1983;Bengtsson 1985;Barton and Bengtsson 1986;Nordborg 1997).Our results do not discount the effects positive selection or purifying selection may have on producing signatures resembling the classic "genomic islands of differentiation" (e.g.Via 2009;Nosil 2009), but do show that local adaptation could also generate similar patterns in nucleotide diversity and FST.
Conversely, when migration is higher but not so strong as to collapse the locally adapted polymorphism, we find peaks in both πw (Fig. 2a, negative region) and FST (Fig. 2c) at the neutral loci flanking locally adapted loci, although this effect is attenuated with larger population size (Fig. 3).Selection generates linkage disequilibrium between neutral loci and the locally adapted locus proportional to the recombination distance between them; when the locally adapted haplotype migrates into its maladapted patch, πw is transiently increased at the flanking neutral loci.When locally adapted haplotypes migrate into the maladapted patch at a greater rate than selection can effectively purge them, sharp peaks are generated in both πw and FST.These peaks attenuate with larger population sizes, as the maintenance of linkage disequilibrium is increased over a greater range of recombination with smaller populations (as per Ohta and Kimura 1971).While a limited effect of increased diversity was noted by Sakamoto and Innan (2019), this was not discussed as a potentially important signature of local adaptation.Here, we show that considerable increases in πw can be found, especially when selection is strong, migration rate high, and effective population sizes are small, as is the case in many empirical examples of local adaptation.Concurrent peaks in πw and FST may therefore constitute an important signature of local adaptation that can be readily distinguished from background and Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 periphery present with depleted πw across a substantially larger region of migration-selection parameter space and the sharp peaks in πw seen in our two-patch results do not appear (Fig. 6).
Across a spatially extended environmental gradient, the interior populations receive an influx of maladapted alleles at a relatively high rate (here, ≳2x compared to the peripheral populations), which increases the πw at flanking loci in these populations.While migration is introducing differently adapted alleles into the interior populations, however, selection is purging them.The purging of maladapted alleles across the interior populations, coupled with the stepping stone nature of our model, ultimately results in the decreased influx of maladapted alleles into the peripheral populations (i.e., few haplotypes with an allele optimally adapted to one end of the landscape migrate to the other end).As such, the degree of polymorphism that is maintained around the locally adapted locus in the peripheral populations is not sufficient enough to produce the peaks in πw seen in our two-patch results.Consequently, when species adapt over spatially extended environmental gradients, it may be very possible to find both peaks and troughs in πw at a single locus within a single species.

CONCLUSION
We demonstrate that there is no universal nucleotide-scale signature of local adaptation, even with the simplest possible model of spatially divergent selection.Nucleotide diversity within populations can be substantially decreased or increased depending on the relative strengths of migration and selection.Additionally, local adaptation can result in regions of depleted withinpopulation diversity over chromosomal distances similar to that of background selection, with a substantially greater magnitude of diversity eroded than with background selection.Our results demonstrate that local adaptation must also be considered, in addition to background selection and selective sweeps, when making inferences based on genomic regions of reduced withinpopulation diversity.While reductions in diversity may not be particularly diagnostic, peaks in within-nucleotide diversity are only expected under local adaptation or other models of balancing selection, and as such, can distinguish local adaptation vs. uniform positive/purifying selection (as per Booker et al. 2019).Finally, our results from models with increased realism further highlight that there is little reason to expect a consistent pattern in within-population nucleotide diversity across heterogeneous environments, as patterns of decreased or increased diversity can be expected depending upon polygenicity, redundancy, geography, migration, and selection.(unscaled) or 10 -2 / N (scaled), the mutation rate at neutral loci was 10 -5 per locus, and V S = 5.Panels A and C are as described in Fig. 2 , and they are now commonly invoked to explain signatures where a relative local reduction in nucleotide diversity is found in some areas of the genome along with elevated FST.Complicating the picture somewhat, recent theoretical work has suggested that background selection likely only very minimally affects FST and that any detected peaks are therefore unlikely to be generated solely as a function of reduced diversity due to background selection (Matthey-Doret and Whitlock 2019).Still other studies have shown that uniform positive selection can generate Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 Downloaded from https://academic.oup.com/g3journal/advance-article/doi/10.1093/g3journal/jkae225/7759903 by guest on 21 September 2024 migration-selection balance, as could be predicted from previous migration-selection studies

Figure 1 :
Figure 1: Patterns of πw along the chromosome at neutral loci linked to a single divergently selected locus in two-patch model.Mean diversity is shown for migration rates m = 10 -3.5 (A) and m = 10 -1.5 (B)after 50,000 generations.The magnitude of each diversity-distance slope (π w versus log 10 cM) is shown in red.Each patch was comprised of N = 1,000 individuals, mutation rate = 10 -5 per locus, and V S = 5.

Figure 2 :
Figure 2: Effect of migration-selection balance on genetic variation at neutral sites linked to a single divergently selected locus in two-patch model.The slope of π w versus distance (log 10 cM) (A), the π w at the loci closest (10 -3 cM) and furthest (10 cM) from the locally adapted locus (B), and the slope of F ST versus distance (log 10 cM) (C) are shown against the log 10 migration rate after 50,000 generations.Each patch was comprised of N = 1,000 individuals and the per-locus mutation rate = 10 -5 .Simulation results are shown in dashed lines, analytical predictions from Sakamoto and Innan (2019) equation 25 using asymmetrical selection coefficients are shown in solid lines.

Figure 3 :
Figure 3: Effect of migration-selection balance and population size on genetic variation at neutral sites linked to a single divergently selected locus.The mutation rate at the selected locus was 10 -5 ; panel B shows the π w scaled by the neutral expectation at m > 0(4•d•N•μ).

Figure 4 :
Figure 4: Effect of migration-selection balance on genetic variation at linked neutral sites for a quantitative trait with different numbers of loci and no genotypic redundancy.Allele effect sizes were scaled by the number of adaptive loci, such that an individual could only reach the optimum in agiven patch by being homozygous for the optimal allele at each locus.Each patch was comprised of N = 1,000 individuals, mutation rate = 10 -5 per locus, and V S = 5.Panels are as described in Fig.2.

Figure 5 :
Figure 5: Effect of migration-selection balance on genetic variation at linked neutral sites for a quantitative trait with different numbers of loci and variable levels of genotypic redundancy.Allele effect sizes were  0.25, such that an individual could reach the optimum in a patch ( 1) by being homozygous for the optimal allele at 2 loci.Each patch was comprised of N = 1,000 individuals, mutation rate = 10 -5 per locus, and V S = 5.Panels are as described in Fig. 2.

Figure 6 :
Figure 6: Effect of migration-selection balance on genetic variation at neutral sites linked to a single divergently selected locus in ten-patch model.Each patch was comprised of N = 1,000 individuals, mutation rate = 10 -5 per locus, and V S = 5.Panels are as described in Fig. 2.