Ancestry in adapting, spatially-extended populations

Selective sweeps affect neutral genetic diversity through hitchhiking. While this effect is limited to the local genomic region of the sweep in panmictic populations, we find that in spatially-extended populations the combined effects of many unlinked sweeps can affect patterns of ancestry (and therefore neutral genetic diversity) across the whole genome. Even low rates of sweeps can be enough to skew the spatial locations of ancestors such that neutral mutations that occur in an individual living outside a small region in the center of the range have virtually no chance of fixing in the population.


Introduction
In large populations even a fairly low rate of selective sweeps is sufficient to reduce diversity across most of the genome via hitchhiking [1,2]. Most modeling of the effects of hitchhiking on diversity has considered well-mixed populations. However, the effects are potentially quite different in spatially-extended populations, because instead of quickly fixing through logistic growth, sweeps must spread out in a spatial wave of advance over the whole range [3]. [4] recently showed that this increase in the time to sweep tends to reduce the size of the genomic region over which diversity is depressed by a sweep.
While the effect of sweeps on genetic diversity at linked loci is therefore reduced by spatial structure, we show here that collective effect of sweeps on the diversity at unlinked loci can be much stronger than in panmictic populations. Surprisingly, this effect is dependent on the geometry of the range -it only appears for realistic range shapes with relatively well-defined central regions, not for the perfectly symmetric idealizations of ring-shaped and toroidal ranges often used in theoretical models. In particular, we find that probability of fixation of an allele can be strongly position-dependent, with alleles near the center of the range orders of magnitude more likely to fix than those at typical locations. This can produce a false signal of a population expansion (in number, not space) even at loci on chromosomes where no adaptation is taking place. The basic mechanism driving this effect is that sweeps tend to arrive at each location from the direction of the center of the range, and so bias the ancestry back towards the center.

Methods
We wish to find the expected number of copies that an allele found in an individual at spatial position x will leave far in the future, i.e., its reproductive value [5], which we denote φ(x). Equivalently, φ(x)ρ(x), where ρ is the population density, is the probability density of a present-day individual's ancestor being at location x at some time in the distant past. [6] showed that in the absence of selection, φ(x) ≡ 1 regardless of the details of the population structure, as long as dispersal does not change expected allele frequencies.
Here we show that this result does not extend to populations undergoing selection. Populations living in perfectly symmetric ranges (circles in one dimension, tori in two) necessarily have φ(x) ≡ 1, but when this symmetry is broken, recurrent sweeps can create a substantial imbalance, making φ much higher in a small region in the center of the range and decreasing it everywhere else.

Model
We consider a population with uniform, constant density ρ distributed over a d-dimensional range with radius L, with uniform local dispersal with diffusion constant D. We assume that selective sweeps with advantage s occur in the population at a rate Λ per generation, originating at points uniformly distributed over time and space. As long as the density is sufficiently high (ρ (s/D) d/2 /s, [7,4]), they will spread roughly deterministically in waves with speed c ≈ 2 √ Ds with characteristic wavefront width l ≈ D/s [3], which we take to be much smaller than the range size, l L. We assume that Λ is low enough compared to the frequency of outcrossing, f , and the average number of crossovers per outcrossing, K, that the waves do not interfere with each other. The definitions of symbols are collected in Table 1.

One and two dimensions
We consider both one-dimensional ranges (lines with length 2L) and two-dimensional ranges. In two dimensions, the shape of the range will have some effect on many of our results; however, as long as the shape is fairly "nice", with a clear center and single characteristic length scale L, this effect will be modest. We will therefore ignore it for simplicity. For our purposes, the main difference between one and two dimensions will be in the density of individuals a distance x from the center, ρ(x). Since we are assuming a uniform spatial density, in one dimension this is just ρ, a constant. In two dimensions, however, we must account for the fact that there is more area at larger x, and thus ρ(x) ≈ 2πxρ. (Obviously, ρ(x > L) = 0 in both one and two dimensions.)

Results
A sweep at a tightly-linked locus a genetic map distance r s away pulls a lineage a distance that is approximately exponentially distributed with mean c/r, going backwards in time. This is only approximate, because actually there is an upper cutoff at the distance to the origin of the sweep [4]. For sweeps at looselylinked loci with r s, the lineage is only pulled an expected distance c/2r (see Appendix A). However, since the average displacement still only falls off like 1/r, and since there is an upper cutoff on the effect of sweeps as r → 0, the total average displacement for a typical locus can be dominated by the effect of the many unlinked sweeps rather than the few linked ones, assuming that sweeps are uniformly distributed over the genome, and that the genome is long. We will make the approximation that the expected displacement is solely due to unlinked sweeps, with r = f /2; we will consider the additional effects of the rare, tightly-linked sweeps below.
For a lineage a distance x from the center, there is an excess of approximately ∼ Λx/L sweeps per generation pulling it back toward the center, each of which pulls it an expected distance c/f . (Note that the effect of the upper cutoff on the displacement from these sweeps is negligible as long as L c/f .) The expected distance from the center therefore decays exponentially (backwards in time) like This implies that there is a time t con before which individuals' ancestors are unlikely to be found outside the center of the range, with This deterministic move back to the center is opposed by dispersal, and also by the effect of occasional tightly-linked sweeps which pull the lineage a distance ∼ L, effectively randomizing its position. The balances between these forces means that the ancestry of the population is not completely concentrated at the center of the range, but is instead distributed around it in some region of size ∼ x c .

Balance with dispersal
If tightly-linked sweeps are relatively rare, either because the overall rate of sweeps is low or because the focal locus lies in a region of the genome that is not undergoing much adaptation, the main balance will be between the diffusive effect of dispersal and the pull of unlinked sweeps. In this case, the position of the ancestry is an Ornstein-Uhlenbeck process. The stationary distribution is therefore normal and concentrated in the center of the range according to: If x c L, then the reproductive value of an individual at the center of the range can be orders of magnitude higher than than one at a typical distance ∼ L/2 from the center (Fig. 1).
From Eq. (3), we see that the ancestral range will be substantially reduced by selection if the rate of sweeps per sexual generation is greater than the ratio of the cline width to the range size: Λ/f > l/L. It is unclear what ranges these ratios take in natural populations. Λ/(f K) is unlikely to be much more than O (1) [2], but in organisms with many chromosomes (large K), Λ/f may be substantial. Looking at the right-hand side of the inequality, modeling sweeping alleles by waves spreading across the range necessarily requires l/L 1, so even small values of Λ/f may be enough to distort the distribution of ancestry. Surprisingly little is known about typical values of l for the waves of advance of sweeping alleles in nature, but it seems plausible that for many species it should be much smaller than the total species range [3]. For the spread of insecticide resistance in Culex pipiens in southern France, the width of the wave of advance was ∼ 20 km [8], much smaller than the global scale of the species range, but the dynamics were more complex than a simple selective sweep [9]. Much more is known about the width of stable clines and hybrid zones, which are frequently much smaller than species ranges [10]. To the extent that the selection maintaining them is comparable in strength to the selection driving sweeps, these should have roughly the same width as the wavefronts.

Balance with tightly-linked sweeps
Finding the balance between concentrating effect of unlinked sweeps and the randomizing effect of tightlylinked sweeps is slightly trickier. Indeed, finding an exact expression for φ(x) is intractable. However, we can find an approximate expression by using the fact that the mean squared displacement of the ancestral lineage due to linked sweeps is dominated by rare very tightly-linked sweeps rather than the many loosely-linked ones [4]. This suggests that for large x, the probability that an individual's ancestor was farther than x from the center at time t 0 in the distant past is roughly just the probability that a single very tightly-linked sweep pulled it there at some time within ∼ t con generations of t 0 . Since the distance that a sweep at recombination fraction r pulls the lineage goes like 1/r, the rate of sweeps close enough on the genome to pull the ancestry a distance of at least x falls off like 1/x. Therefore, the probability of finding the ancestry at a distance of at least x should also fall off like 1/x; the probability density of being exactly at x, φ(x)ρ(x), should then fall off like 1/x 2 .
In the appendix, we calculate this more formally, and find The factor 1 − (x/L) d (where d = 1 or 2 is the dimension of the habitat) reflects the fact that for very large x, x ∼ L, most sweeps start at distances less than x and cannot pull the lineage that far from the center. For x x c = 2L/K, lineages will tend to experience many sweeps pulling them distances greater than x in time ∼ t con , so the approximation used to derive Eq. (4) breaks down; for these small values of x, the randomizing effects of moderately-linked sweeps smooth out φ(x) and make it roughly constant.
Barton et al. describe the randomizing effect of tightly-linked sweeps by "D eff ," an effective dispersal rate, with D eff ≈ 16LΛ 3lKf D (Eq. (9) of [4]). Comparing Eqs. (3) and (4), however, we see that their effect cannot simply be described as an increase in the dispersal rate, since they create a much longer tail in the spatial distribution of ancestry. Because of this, it is possible that while the bulk of the distribution of ancestry is determined by a balance between unlinked sweeps and dispersal, with linked sweeps too rare to make a difference, linked sweeps make the dominant contribution to the tails of the ancestry distribution (Fig. 3).

Combining dispersal and tightly-linked sweeps
Combining Eqs. (3) and (4), we see that unlinked sweeps reduce the effective size of the ancestral range by a factor x c /L: For typical numbers of chromosomes K, it would seem that ancestry could be concentrated by about an order of magnitude. However, the result 2/K was derived under the assumption that sweeps are distributed uniformly across the genome. If, on the other hand, adaptation is mostly occurring in just a few genes, the rest of the genome will not experience any tightly-linked sweeps, and ordinary dispersal will be the only force counteracting the concentration, meaning that the effect could potentially be much stronger. This has the surprising implication that selection can have a stronger effect on some features of the spatial distribution of ancestry at far-away loci than at those nearby.

Effect on diversity
While the effect of recurrent sweeps on neutral diversity can be quite large, detecting the effect in data from real populations may be tricky. It might seem to be indistinguishable from a range expansion in the absence of time-series data, but there is a simple way to tell them apart: under recurrent sweeps, there is no serial founder effect reducing diversity away from the center. One way to see this is by looking at isolation by distance. The probability ψ(x) that two individuals separated by a distance x are genetically identical can be written in terms of the neutral mutation rate µ and their coalescence time T as For x large compared to the size of a single deme (i.e., the spatial scale over which individuals interact within a generation) and loci far on the genome from any recent sweeps, there are two simple regimes for Eq. (6). If x x c , then we expect that the pull due to sweeps should be unimportant, and ψ(x) is just given by the neutral value, ψ(x) ∝ x (1−d)/2 e − √ µ/Dx [11], which says that the probability of identity falls off rapidly with distance. On the other hand, larger values of x are quickly collapsed by the pull of sweeps in time ∼ log(x)/t con , so we expect that ψ should be of the form ψ(x) ∝ x −2µtcon . A detailed calculation in Appendix C confirms that this is true for x x c √ 2 + 4µt con . The probability of identity thus has a long tail in distance -individuals at opposite sides of the range (separated by ≈ 2L) are nearly as related as individuals separated by, say, L/2. Notice that ψ does not depend on from where in the range we sampled the pair of individuals. This implies that, while reproductive value is concentrated in the center of the range, genetic diversity is more evenly spread, distinguishing this scenario from a range expansion.
Above, we have ignored loci that are close to recent sweeps. If we are considering large enough loci so that µt con 1, then usually only these recently swept regions will be identical between individuals from different parts of the range. In this case, because each sweep causes coalescence between individuals separated by a large distance x over a region of genome with length r ∝ 1/x [4], ψ should still have a long tail, but with an exponent that is independent of the population parameters, ψ ∝ 1/x (see Appendix C.1). This characteristic exponent is another effect of rare, tightly-linked sweeps that cannot be accounted for by any effective dispersal rate D eff .

Discussion
Because selection and demography are often difficult or impossible to measure directly in natural populations, both are typically inferred from patterns of genetic diversity. This inference can be difficult, because the two processes can produce similar signals. For instance, both purifying selection and population expansion tend to produce site frequency spectra with a relative excess of rare alleles. In order to tease apart the two factors, demography is often first inferred using data from loci that are thought to be neutral, and then the answer is used to infer the pattern of selection at the remaining loci. However, in order for the demography to be inferred correctly, this method requires that the first set of loci be not just neutral, but also unaffected by selection at linked loci. Typically, this is done by using loci that are far from sites where selection is thought to have been important (e.g., [12]). Our results suggest that this may be problematic in spatially-structured populations -even diversity at these loci may be strongly affected by unlinked sweeps.

Geometry, not topology, of range is important
Our results might seem to show that the genetic diversity in a population depends sensitively on the topology of the range and can therefore change drastically as the result of small perturbations to the environment. For example, a circular range (which has no concentration of ancestry since it is perfectly symmetric) can be transformed into a linear one (with very concentrated ancestry) by removing a single point. However, this is a misleading interpretation. In fact, a "circular" range is an annulus with radius large compared to its thickness (Fig. 4a). A small perturbation that slightly reduces the population in one part of the range will only have a correspondingly small effect on the distribution of ancestry (Fig. 4b), and the bias of the ancestry ancestry increases smoothly as the perturbation grows (Fig. 4c), until the annulus is completely pinched off (Fig. 4d). More generally, the common-sense intuition that the pattern of diversity should not depend on the details of the shape of the range is correct. All that matters is the extent to which there is a "central region" that sweeps tend to pass through on their way to dominating the population.

Extensions
We have focused on a very simple population model. Here we consider several possible modifications. First, we have assumed that the density ρ is constant in time. If density fluctuations typically occur on timescales longer than t con , this approximation should be accurate, and if they are rapid compared to the sweep time L/c they should average out, but it is unclear how fluctuations on moderate timescales should interact with dynamics discussed here.
We have also neglected the possibility of rare long-range dispersal. Tightly-linked sweeps already effectively produce occasional long-range jumps in the ancestry of neutral sites, so adding long-range dispersal might not have a large direct effect, but it is likely to have dramatic effects on how sweeps spread [13], and therefore a large indirect effect on the hitchhiking dynamics. It is not at all clear what this effect should be -on the one hand, the sweeps will spread faster, increasing their pull, but on the other hand, the direction of that pull may be less reliably towards the center.
We have also neglected the possibility that many sweeps may be "soft", starting from multiple alleles [14]. If these alleles typically descend from a recent single ancestor, i.e, are concentrated in a small region at the time when they begin to sweep, then the results should be essentially unchanged, with the possible exception of the coalescent effects of tightly-linked sweeps (Appendix C.1). The same should be true if sweeps are "firm", i.e., multiple mutant lineages contribute to each sweep, but the most successful one typically colonizes most of the population. But sweeps in which many widely-spread mutations contribute equally would likely not consistently concentrate ancestry in space.
We have focused on the effect of sweeps on neutral variation, but they will of course also affect selected alleles. Most obviously, if recombination is limited they will interfere with each other [15]. They will interfere even more strongly with weakly-selected variants. We are currently preparing a manuscript addressing these issues. It is also important to consider how the concentration of reproductive value interacts with spatiallyvarying selection. It seems plausible that it would reduce the potential for local adaptation and thereby limit population ranges.      3)), but the (small) probability that the ancestor is found outside the center of the range is dominated by the probability that there has recently been a tightly-linked sweep (Eq. (4)). Parameters are as in Fig. 2. Figure 4: The distribution of ancestry depends smoothly on the shape of the range as it deforms from a perfectly symmetric circle (a) to a curve with endpoints (d). Shading represents the reproductive value of each location, from high (dark) to low (light). In (a), the ancestry is necessarily evenly distributed. Slight asymmetries in the shape of the range introduce slight differences in the distribution of ancestry (b). When the range has a well-defined middle (d), the ancestry is concentrated there; including a weak connection between the end of the range (c) does not change this much.

A Calculating the "pull" of an loosely-linked sweep
We would like to find the expected spatial displacement of a lineage caused by an loosely-linked sweep, tracing backwards in time. To do so, suppose that we sample an allele in a present-day individual in the middle of a very large one-dimensional range, and that a long time ago a selective sweep occurred at a locus a recombination fraction r away from the focal allele, starting a very long distance away from our sample. We wish to find the expected location of the ancestor of the sampled allele before the sweep began. Let p(x, τ ) be the probability density for finding the ancestor at location x τ generations in the past, with x = 0 corresponding to the present location. We want to find To find ∂ τ p, first define p i (x, τ ) as the probability density that the ancestor was at location x and in genetic background i, where i = 0 is the ancestral genetic background, and i = 1 is the background with the allele that swept. (Note p = p 0 + p 1 .) If we define u(x, τ ) ≡ u 1 (x, τ ) and u 0 (x, τ ) to be the frequencies of the sweeping allele and the background allele, respectively, with u 1 + u 0 = 1, p i satisfies the partial differential equation Technically, in models with discrete generations, Eq. (8) only applies when the recombination rate per generation is small, but we will use it for unlinked loci anyway. The equivalent of linkage disequilibrium in this system is ∆ ≡ u 0 p 1 − u 1 p 0 ; we expect it to be small for large r. Using ∆ to change variables back to p, Eq. (8) becomes Plugging Eq. (9) into Eq. (7), we have where we have used integration by parts and the fact that p(±∞, τ ) = 0. It now remains to find an expression for ∆. Eq. (10) is quite complicated, but for large r we will have ∆ p and the dominant balance will be between the first and third terms on the right-hand side, giving where p neut is the value of p ignoring the perturbation caused by the sweep, i.e., p neut = 1 √ 4πDτ exp − x 2 4Dτ . We can simplify this further by noting that u solves the differential equation ∂ τ u + D∂ 2 x u = −su(1 − u). (Recall that τ is backwards time.) Using this relation and substituting Eq. (12) into Eq. (11), we have Recall that we are interested in the effect of a long-past sweep. Let τ 0 be the time at which the wave of advance passed the point where we sampled the allele; we will take τ 0 to be extremely large. At time τ 0 , p neut has width ∼ √ Dτ 0 , so the wave crosses the region where the ancestor might have lived in a time ∼ √ Dτ 0 /c τ 0 , and the integral in Eq. (13) is dominated by times τ in the approximate range |τ −τ 0 | √ Dτ 0 /c. Since τ does not vary by much (proportionately) in this interval, p neut (x, τ ) ≈ p neut (x, τ 0 ) is approximately constant in τ . Using this approximation in Eq. (13) yields Note that this result did not depend on the form of p neut , only that it was approximately constant in time; in particular, it also holds if the ancestry settles down to a stationary distribution, as in Eq. (3).

A.1 Other kinds of loosely-linked sweep
Above, we have assumed that the sweeping allele spread according to the FKPP equation, ∂ τ u + D∂ 2 x u = −su(1 − u), which describes an allele with a constant selective advantage s. However, the allele may have a varying selective advantage if, for instance, dominance or frequency-dependent effects are important, or if there is environmental variation. More generally, the changing allele frequency is described by for some function f . Otherwise, the derivation of the expected displacement is the same as above, and we have Assuming that f is such that u(x, τ ) is still a traveling wave moving at some speed c, we can change variables in the second integral to obtain:

B Effect of tightly-linked sweeps
We wish to calculate φ(x) for large x, including the effect of occasional tightly-linked sweeps. It is easiest to consider L x dy ρ(y)φ(y), which we can think of as the probability that at some time t 0 in the distant past, the ancestor of a present-day individual was at a distance greater than x from the center. For large x, we expect that this is dominated by the probability that it was pulled there by a 'recent' tightly-linked sweep t generations 'before' t 0 (i.e., t generations closer to the present), with t not too large. This sweep must have pulled the lineage out to a distance of at least xe t/tcon for it still to be at a distance of at least x t generations 'later', and therefore the sweep must have originated a distance z > xe t/tcon from the center. Given that it did, the probability that it pulled the lineage out far enough is exp − r c xe t/tcon . Putting this all together, and using that the density of sweeps per generation per unit map length per distance (or area in two dimensions) at distance z from the center and genetic map distance r from the focal locus is 2Λ/(f KL) (or 4Λz/(f KL 2 ) in two dimensions), the expected number of sweeps that would have left the lineage more than x from the center at time t 0 is time for two lineages inside the wavefront of the sweep [4]. We can therefore account for the effect of sweeps uniformly distributed over the genome by changing the coalescence kernel in Eq. (20) from δ(x)/ρ to For x cΥ, Eq. (21) then becomes For large x, there are two possible tail behaviors for the solution. If 2µt con < 1, then the pull of unlinked sweeps is strong enough that it is likely to bring lineages close together before they mutate, and ψ ∝ x −2µtcon as above. For 2µt con > 1, only recently-swept loci share recent enough ancestry to be likely to be identical in distant individuals, and ψ ∝ x −1 .

D Simulation methods
Forward-time simulations (purple histogram in Fig. 1) were conducted using the algorithm from [2] (which draws on that of [18]), modified so that population was subdivided into a line of L demes of ρ individuals each, with random dispersal between adjacent demes. Because these simulations were extremely computationally demanding, we also conducted approximate backwards-time simulations to get better statistics and investigate rare events (blue histogram in Fig. 1, and Figs. 2 and 3). These simulations followed a single lineage back in time at one neutral locus as it diffused through a continuous one-dimensional space. Sweeps were treated as instantaneous events arising uniformly at random in space and time and across the genome. Sweeps occurring at a recombination fraction r from the focal locus pulled the lineage an exponentiallydistributed distance with mean c/r or c/(2r) (for r < s and r > s, respectively), truncated at the origin of the sweep. For both sets of simulations, the focal locus was at the center of a linear genome with map length K Morgans.