Introduction

The source of adaptive genetic variation remains an important question in evolutionary biology\cite{Hedrick2013AdaptiveVariation}. In the canonical view of evolution, natural selection causes a change in the frequency of a mutation that was either present before the introduction of selection, so-called standing variation, or a new mutation that arose after the selective pressure began\cite{Hermisson2005SoftVariation}. A third potential source of novel genetic variation on which natural selection can act is via gene-flow resulting from an inter or intra species admixture event. Examples of such adaptive introgression include the exchange of mimicry adaptations amongst Heliconius butterfly species\cite{Consortium2012ButterflySpecies}, the transfer of insecticide resistance genes between sibling Anopheles mosquito species\cite{Clarkson2014AdaptiveIsolation}, and the spread of pesticide resistance across populations of house mice\cite{Staubach2012GenomeMusculus}.
In the human lineage, recent genomic studies have shown that our demographic history is complex, involving population merges as well as splits\cite{Green2010AGenome,Patterson2012AncientHistory,Prufer2014TheMountains,Hellenthal2014AHistory,Fu2015AnAncestor}. These merges, also known as admixture or introgression events, open the door to the transfer of adventageous alleles. The trysts between archaic Homo sapiens and Neanderthals over fifty thousand years ago (kya) transfered beneficial alleles from Neanderthals into the human lineage \cite{Green2010AGenome,Patterson2012AncientHistory,Prufer2014TheMountains,Fu2015AnAncestor,Abi-Rached2011TheHumans,Gittelman2016ArchaicEnvironments}. While genomic regions with elevated archaic ancestry have been observed, it has also been possible to identify regions that are devoid of archaic ancestry and where it is thought that archaic alleles at these loci have been at a disadvantage\cite{Sankararaman2014TheHumans,Racimo2015EvidenceHumans}.
Despite the prevalence of more recent admixture events over the past 50 kya of human history, relatively few instances of adaptation from recent merges have been found. Notable known examples include the exchange of high altitude adaptations between the ancestors of Sherpa and Tibetans\cite{Jeong2014AdmixtureTibet} and the spread of the Plasmodium vivax malaria-proecting Duffy null mutation in Madagascar as result of gene-flow from mainland African Bantu-speakers\cite{Hodgson2014NaturalMadagascar}.
Within Africa, multiple studies using different techniques have shown admixture to be a common theme in the recent history of the continent\cite{Pagani2012EthiopianPool,Schlebusch2012GenomicHistory,Pickrell2012TheAfrica,Pickrell2014AncientAfrica,Pickrell2014TowardDNA,Busby2016AdmixtureAfrica,Patin2017DispersalsAmerica}. As a result, the genomes of individuals from these populations contain segments which derive from multiple ancestries. Inferring whether gene-flow has assisted adaptation requires inferring how these ancestries change locally along the genome. Although a number of strategies exist for local ancestry inference\cite{Price2009SensitivePopulations,Baran2012FastPopulations,Brisbin2012PCAdmix:Populations,Maples2013RFMix:Inference}, most are designed to distinguish at best continental-level ancestry from a small number of reference populations. To identify whether haplotypes of specific ancestry have potentially moved within, as well as from outside of, Africa, the approach we develop here involves sampling from a Hidden Markov Model to identify the likely donor haplotype from a large set of reference genomes. We use this chromosome painting approach to assign a donor ancestry label (which can be at individual, population, region, or continental level) at each locus in the genome to all recipient individuals. Iterating this process incorporates ancestry assignment uncertainty and we infer the ancestry proportions from different donor groups across the genome.
{comment}
However introgression is not the only population genetic process that can lead to signals of sequence similarity between different taxa. If the population that was ancestral to modern day human groups was not homogeneously mixed and structured, then two groups might appear more closely related to each other at certain parts of the genome as a result of this ancestral population structure\cite{Racimo2015EvidenceHumans}. One way to distinguish potentially adaptive introgression from ancestral population structure (and other coancestry signals like convergent evolution or balancing selection) is to use a haplotype-based approach, which allows one to identify the putative origin of a sequence of DNA in other taxa\cite{Hedrick2013AdaptiveVariation}. Another way it to assess the lengths of introgressed haplotypes\cite{Racimo2015EvidenceHumans}. Segments shared through ancestral population structure will have had time to have been broken up by recombination, whereas those from more recent introgression will be longer.
Individuals from two populations will share some DNA if they descend from a common ancestor and have inherited the same segment of DNA from the ancestral population, a phenomenon known as incomplete lineage sorting\cite{Racimo2015EvidenceHumans} (ILS).
Whilst introgression results in tracts of shared ancestry across a population with lengths and distributions proportional to the time of introgression\cite{Baird2006FishersAdmixture} (a key property that some admixture inference procedures exploit\cite{Hellenthal2014AHistory,Patterson2012AncientHistory}), ILS manifests itself as a signal of shared ancestry between two individuals. Thus, introgression will have a similar expected influence on the structure of genome-wide genetic diversity across individuals within a population whereas ILS manifests itself as shared ancestry between individuals. Moreover, ILS will differ across individuals within a population and its signal can be mitigated by averaging ancestry across a population. Conversely, natural selection exerts its strongest effects locally in the genome across the whole of a population.
Here we use ChromoPainter \cite{Lawson2012InferenceData} to infer ancestry across the genomes of 3,283 individuals from a set of 60 donor groups, and use this analysis to ask a simple question: across individuals in these admixed populations, are there regions of the genome where ancestry is significantly deviated away from genome-wide expectations? We construct a statistical model to test for significant deviations. We interpret deviations in local ancestry as possibly resulting from natural selection acting to either increase the frequency of the introgressed haplotype (positive selection) or prevent it from replacing an established haplotype (negative selection). We highlight specific examples where ancestry deviations align with known targets of selection, describe patterns of selection across the data, and discuss the challenges in using approaches of this kind for detecting adaptive admixture.
{comment}
Our study suggests a role for recent gene-flow in spreading adaptive mutations around Africa.