<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.1 20151215//EN"  "JATS-archivearticle1.dtd"><article article-type="research-article" dtd-version="1.1" xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"><front><journal-meta><journal-id journal-id-type="nlm-ta">elife</journal-id><journal-id journal-id-type="publisher-id">eLife</journal-id><journal-title-group><journal-title>eLife</journal-title></journal-title-group><issn pub-type="epub" publication-format="electronic">2050-084X</issn><publisher><publisher-name>eLife Sciences Publications, Ltd</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">54507</article-id><article-id pub-id-type="doi">10.7554/eLife.54507</article-id><article-categories><subj-group subj-group-type="display-channel"><subject>Tools and Resources</subject></subj-group><subj-group subj-group-type="heading"><subject>Evolutionary Biology</subject></subj-group><subj-group subj-group-type="heading"><subject>Genetics and Genomics</subject></subj-group></article-categories><title-group><article-title>Predicting geographic location from genetic variation with deep neural networks</article-title></title-group><contrib-group><contrib contrib-type="author" corresp="yes" id="author-153162"><name><surname>Battey</surname><given-names>CJ</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0002-9958-4282</contrib-id><email>cjbattey@gmail.com</email><xref ref-type="aff" rid="aff1"/><xref ref-type="other" rid="fund1"/><xref ref-type="fn" rid="con1"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author" id="author-169869"><name><surname>Ralph</surname><given-names>Peter L</given-names></name><xref ref-type="aff" rid="aff1"/><xref ref-type="other" rid="fund2"/><xref ref-type="fn" rid="con2"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author" id="author-124313"><name><surname>Kern</surname><given-names>Andrew D</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">http://orcid.org/0000-0003-4381-4680</contrib-id><xref ref-type="aff" rid="aff1"/><xref ref-type="other" rid="fund1"/><xref ref-type="fn" rid="con3"/><xref ref-type="fn" rid="conf1"/></contrib><aff id="aff1"><institution>University of Oregon, Institute of Ecology and Evolution</institution><addr-line><named-content content-type="city">Eugene</named-content></addr-line><country>United States</country></aff></contrib-group><contrib-group content-type="section"><contrib contrib-type="senior_editor"><name><surname>Wittkopp</surname><given-names>Patricia J</given-names></name><role>Senior Editor</role><aff><institution>University of Michigan</institution><country>United States</country></aff></contrib><contrib contrib-type="editor"><name><surname>Nordborg</surname><given-names>Magnus</given-names></name><role>Reviewing Editor</role><aff><institution>Austrian Academy of Sciences</institution><country>Austria</country></aff></contrib></contrib-group><pub-date date-type="publication" publication-format="electronic"><day>08</day><month>06</month><year>2020</year></pub-date><pub-date pub-type="collection"><year>2020</year></pub-date><volume>9</volume><elocation-id>e54507</elocation-id><history><date date-type="received" iso-8601-date="2019-12-17"><day>17</day><month>12</month><year>2019</year></date><date date-type="accepted" iso-8601-date="2020-06-03"><day>03</day><month>06</month><year>2020</year></date></history><permissions><copyright-statement>© 2020, Battey et al</copyright-statement><copyright-year>2020</copyright-year><copyright-holder>Battey et al</copyright-holder><ali:free_to_read/><license xlink:href="http://creativecommons.org/licenses/by/4.0/"><ali:license_ref>http://creativecommons.org/licenses/by/4.0/</ali:license_ref><license-p>This article is distributed under the terms of the <ext-link ext-link-type="uri" xlink:href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution License</ext-link>, which permits unrestricted use and redistribution provided that the original author and source are credited.</license-p></license></permissions><self-uri content-type="pdf" xlink:href="elife-54507-v2.pdf"/><abstract><p>Most organisms are more closely related to nearby than distant members of their species, creating spatial autocorrelations in genetic data. This allows us to predict the location of origin of a genetic sample by comparing it to a set of samples of known geographic origin. Here, we describe a deep learning method, which we call Locator, to accomplish this task faster and more accurately than existing approaches. In simulations, Locator infers sample location to within 4.1 generations of dispersal and runs at least an order of magnitude faster than a recent model-based approach. We leverage Locator’s computational efficiency to predict locations separately in windows across the genome, which allows us to both quantify uncertainty and describe the mosaic ancestry and patterns of geographic mixing that characterize many populations. Applied to whole-genome sequence data from <italic>Plasmodium</italic> parasites, <italic>Anopheles</italic> mosquitoes, and global human populations, this approach yields median test errors of 16.9km, 5.7km, and 85km, respectively.</p></abstract><kwd-group kwd-group-type="author-keywords"><kwd><italic>Plasmodium</italic></kwd><kwd>human</kwd><kwd>Anopheles</kwd></kwd-group><kwd-group kwd-group-type="research-organism"><title>Research organism</title><kwd>Other</kwd></kwd-group><funding-group><award-group id="fund1"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100000002</institution-id><institution>National Institutes of Health</institution></institution-wrap></funding-source><award-id>R01GM117241</award-id><principal-award-recipient><name><surname>Battey</surname><given-names>CJ</given-names></name><name><surname>Kern</surname><given-names>Andrew D</given-names></name></principal-award-recipient></award-group><award-group id="fund2"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100011348</institution-id><institution>University of Oregon</institution></institution-wrap></funding-source><award-id>I3 award</award-id><principal-award-recipient><name><surname>Ralph</surname><given-names>Peter L</given-names></name></principal-award-recipient></award-group><funding-statement>The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication.</funding-statement></funding-group><custom-meta-group><custom-meta specific-use="meta-only"><meta-name>Author impact statement</meta-name><meta-value>Neural networks allow fast and accurate prediction of individual spatial locations from genotypes or sequencing data.</meta-value></custom-meta></custom-meta-group></article-meta></front><body><sec id="s1" sec-type="intro"><title>Introduction</title><p>In natural populations, local mate selection and dispersal create correlations between geographic location and genetic variation – each individual’s genome is a mosaic of material inherited from recent ancestors that are usually geographically nearby. Given a set of genotyped individuals of known geographic provenance, it is therefore possible to predict the location of new samples from genetic information alone (<xref ref-type="bibr" rid="bib24">Guillot et al., 2016</xref>; <xref ref-type="bibr" rid="bib62">Yang et al., 2012</xref>; <xref ref-type="bibr" rid="bib58">Wasser et al., 2004</xref>; <xref ref-type="bibr" rid="bib45">Rañola et al., 2014</xref>; <xref ref-type="bibr" rid="bib9">Bhaskar et al., 2016</xref>; <xref ref-type="bibr" rid="bib5">Baran et al., 2013</xref>). This task has forensic applications – for example, estimating the location of trafficked elephant ivory as in <xref ref-type="bibr" rid="bib58">Wasser et al., 2004</xref> – and also offers a way to analyze variation in geographic ancestry without assuming the existence of discrete ancestral populations.</p><p>The most common approaches to estimating sample locations are based on unsupervised genotype clustering or dimensionality reduction techniques. Genetic data from samples of both known and unknown origin are jointly analyzed, and unknown samples are assigned to the location of known individuals with which they share a genotype cluster or region of PC space (<xref ref-type="bibr" rid="bib11">Breidenbach, 2019</xref>; <xref ref-type="bibr" rid="bib6">Battey et al., 2018</xref>; <xref ref-type="bibr" rid="bib17">Cong et al., 2019</xref>). However, these methods require an additional mapping from genotype clusters or PC space to geography and can produce nonsensical results if unknown samples are hybrids or do not originate from any of the sampled reference populations.</p><p>Existing methods for estimating sample location that explicitly model continuous landscapes use a two-step procedure. A smoothed map describing variation in allele frequencies over space is first estimated for each allele based on the genotypes of individuals with known locations, and locations of new samples are then predicted by maximizing the likelihood of observing a given combination of alleles at the predicted location. In methods like <monospace>SPASIBA</monospace> (<xref ref-type="bibr" rid="bib24">Guillot et al., 2016</xref>) and SCAT (<xref ref-type="bibr" rid="bib58">Wasser et al., 2004</xref>), allele frequency surfaces are estimated by fitting parameters of a Gaussian function of set form (but see <xref ref-type="bibr" rid="bib45">Rañola et al., 2014</xref> for an alternate approach based on smoothing techniques from image analysis).</p><p>Since all such methods use relatedness to other contemporary samples, any information about the location of a new sample necessarily comes from ancestors shared with the reference set. As illustrated in <xref ref-type="fig" rid="fig1">Figure 1</xref>, we expect a priori, that the genealogical relationships among a set of samples (and therefore the spatial location of ancestors) will vary along the genome. This means that a complete look at geographic ancestry would include not just a point estimate of spatial location, but an estimate of uncertainty that accounts for the partially correlated genealogies of recombining chromosomes.</p><fig id="fig1" position="float"><label>Figure 1.</label><caption><title>Conceptual schematic of our approach.</title><p>Regions of the genome reflect correlated sets of genealogical relationships (<bold>A</bold>), each of which represents a set of ancestors with varying spatial positions back in time. We extract genotypes from windows across the genome (<bold>B</bold>), and train a deep neural network to approximate the relationship between genotypes and locations using Euclidean distance as the loss function (<bold>C</bold>). We can then use the trained network to predict the location of new genotypes held out from the training routine (<bold>D</bold>).</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig1-v2.tif"/></fig><p>In the past few years, there has been a explosion in the use of supervised machine learning for population genetics for a number of tasks, including detecting selection (<xref ref-type="bibr" rid="bib48">Schrider and Kern, 2016</xref>; <xref ref-type="bibr" rid="bib39">Mughal and DeGiorgio, 2019</xref>; <xref ref-type="bibr" rid="bib52">Sugden et al., 2018</xref>), inferring admixture (<xref ref-type="bibr" rid="bib47">Schrider et al., 2018</xref>; <xref ref-type="bibr" rid="bib19">Durvasula and Sankararaman, 2019</xref>), and performing demographic model selection (<xref ref-type="bibr" rid="bib42">Pudlo et al., 2016</xref>; <xref ref-type="bibr" rid="bib56">Villanea and Schraiber, 2019</xref>). Applications to population genetics increasingly make use of the latest generation of machine learning tools: deep neural networks (a.k.a. ‘deep learning’) (<xref ref-type="bibr" rid="bib49">Sheehan and Song, 2016</xref>; <xref ref-type="bibr" rid="bib33">Kern and Schrider, 2018</xref>; <xref ref-type="bibr" rid="bib14">Chan et al., 2018</xref>; <xref ref-type="bibr" rid="bib21">Flagel et al., 2019</xref>; <xref ref-type="bibr" rid="bib2">Adrion et al., 2020</xref>). A significant feature of neural networks is that they allow the input of raw genotype information, as we perform below, without initial compression into summary statistics.</p><p>In this paper, we introduce Locator, a highly efficient deep learning method for the prediction of geographic origin of individuals from unphased genotype data. Locator uses deep neural networks to perform prediction directly from genotypes, but without assuming any explicit model of how genotypes vary over the landscape. Moreover, unlike many modern supervised machine learning methods in population genetics, (e.g. <xref ref-type="bibr" rid="bib33">Kern and Schrider, 2018</xref>) our training set need not be obtained via simulation. We assume only that there is some function relating geographic locations to the probability of observing a given combination of alleles, and use a deep, fully connected neural network to approximate this mapping for a set of genotyped individuals with known locations. The trained network is then evaluated against a set of known individuals held out from the training routine and used to predict the geographic location of new samples based on their genotypes. Applied separately to windows across the genome, Locator also estimates uncertainty in individual-level predictions and can reveal portions of an individual’s genome enriched for ancestry from specific geographic areas.</p><p>For the empirical population genomic data we analyze here, Locator achieves state-of-the-art accuracy an order of magnitude faster than competing methods. Here, we describe the implementation, test on simulated data, and demonstrate its use in empirical data by estimating sampling locations for <italic>Anopheles</italic> mosquitoes in Africa from the AG1000G project (<xref ref-type="bibr" rid="bib54">The Anopheles gambiae 1000 Genomes Consortium, 2015</xref>), <italic>P. falciparum</italic> parasites from Asia, Africa, and the Americas from the <italic>P. falciparum</italic> community project (<xref ref-type="bibr" rid="bib40">Pearson et al., 2019</xref>), and global human populations from the Human Genome Diversity Project (HGDP; <xref ref-type="bibr" rid="bib8">Bergström et al., 2020</xref>).</p></sec><sec id="s2" sec-type="results"><title>Results</title><sec id="s2-1"><title>Locator is fast and accurate</title><p>We first evaluated Locator’s performance in simulations of populations evolving in continuous space with varying rates of dispersal – an idealized setting in which all alleles should vary smoothly over the map. In <xref ref-type="fig" rid="fig2">Figure 2</xref> we show that validation error increases along with the dispersal rate of the population. Interestingly, error is roughly constant when measured in terms of the mean per-generation dispersal rate, ranging from 3.16 to 4.09 generations of dispersal given our largest training dataset (450 samples, 100,000 SNPs; <xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref>; <xref ref-type="supplementary-material" rid="supp1">Supplementary file 1</xref>). This suggests that error primarily reflects the underlying biological processes of dispersal and mate selection rather than simple noise from model fitting.</p><fig-group><fig id="fig2" position="float"><label>Figure 2.</label><caption><title>Validation error for Locator runs on simulations with varying dispersal rates.</title><p>Simulations were on a 50 × 50 landscape and error is expressed in map units. (<bold>A</bold>) True and predicted locations by population mean dispersal rate and number of SNPs. 450 randomly-sampled individuals were used for training. (<bold>B</bold>) Error for runs with 100,000 SNPs and varying numbers of training samples. (<bold>C</bold>) Error for runs with 450 training samples and varying number of SNPs. Plots with error in terms of generations of expected dispersal are shown in <xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref>.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig2-v2.tif"/></fig><fig id="fig2s1" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 1.</label><caption><title>Validation error for Locator runs on simulations with varying dispersal distance, expressed in generations of mean dispersal (test error divided by mean dispersal distance per generation).</title><p>(<bold>A</bold>) Error for runs with 100,000 SNPs and varying numbers of training samples. (<bold>B</bold>) Error for runs with 450 training samples and varying number of SNPs.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig2-figsupp1-v2.tif"/></fig><fig id="fig2s2" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 2.</label><caption><title>Example training and validation loss histories.</title><p>The first three epochs (with very high loss) were excluded from the plot to improve axis scaling.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig2-figsupp2-v2.tif"/></fig></fig-group><p>Increasing the number of training samples or the number of SNPs improves accuracy for all simulations (<xref ref-type="fig" rid="fig2">Figure 2B</xref>). However, we observed diminishing returns when using over 10,000 SNPs or over 200 training samples. Median error for all simulations was also below 10 generations of dispersal for all but the least-dispersive simulation using just 25 training samples; suggesting that even relatively small training datasets can allow inference of broad-scale spatial locations. We discuss theoretical limits on the accuracy of genetic location estimation in Appendix 1.</p><p>We were interested to compare the performance of Locator to that of <monospace>SPASIBA</monospace> (<xref ref-type="bibr" rid="bib24">Guillot et al., 2016</xref>), the current state-of-the-art method for geographic prediction of genotype data (<xref ref-type="fig" rid="fig3">Figure 3</xref>; <xref ref-type="supplementary-material" rid="supp2">Supplementary file 2</xref>). However, we were unable to succesfully run <monospace>SPASIBA</monospace> with 100,000 or more SNPs from a simulated dataset or on simulations with dispersal rates of 0.63 or 1.29 map units/generation, due to out-of-memory errors on a 64-bit system with 400 Gb of RAM. We could, however, compare at smaller numbers of SNPs and reduced dispersal. At a mean dispersal distance of 0.45 map units <monospace>SPASIBA’s</monospace> median test error was slightly lower when run on 1000 SNPs (Wilcoxon test, p=0.009) but results were similar at 100 or 10,000 SNPs. (Wilcoxon test, <inline-formula><mml:math id="inf1"><mml:mrow><mml:mi mathsize="90%">p</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0.184</mml:mn></mml:mrow></mml:math></inline-formula> and 0.936). However, <monospace>Locator</monospace> is much faster – training on 10,000 SNPs in less than two minutes while <monospace>SPASIBA</monospace> requires around six and a half hours (<xref ref-type="fig" rid="fig2">Figure 2</xref>). These long run times are caused in part by the large number of training localities in our simulated data, because <monospace>SPASIBA’s</monospace> run time scales with the product of the number of genetic variants and the number of training localities (<xref ref-type="bibr" rid="bib24">Guillot et al., 2016</xref>).</p><fig-group><fig id="fig3" position="float"><label>Figure 3.</label><caption><title>Test error and run times for <monospace>Locator</monospace> and <monospace>SPASIBA</monospace> on simulated data with dispersal distance equal to 0.45 map units/generation (top; 450 randomly sampled training samples) and empirical data from the ag1000g phase one dataset (bottom; 612 training samples from 14 sampling localities).</title></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig3-v2.tif"/></fig><fig id="fig3s1" position="float" specific-use="child-fig"><label>Figure 3—figure supplement 1.</label><caption><title>Predicted (colored points) and true (black circles) locations for Locator and SPASIBA on the ag1000g dataset.</title><p>Number of SNPs per run is shown on the right. Both methods were run on randomly selected SNPs with minor allele count &gt;2 from the first five million base pairs of chromosome 2L.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig3-figsupp1-v2.tif"/></fig></fig-group><p>While the simulations conform well to modeling assumptions of most methods, we can also compare performance on empirical data. By way of example, we applied Locator and <monospace>SPASIBA</monospace> to subsets of SNPs from the first five million base pairs of chromosome 2L from the Ag1000G dataset (<xref ref-type="bibr" rid="bib37">Miles and Harding, 2017</xref>; <xref ref-type="fig" rid="fig3">Figure 3</xref>). Locator achieves much lower mean error on all runs with more than 100 SNPs, and runs from 3.1x to 532x faster, depending on the number of SNPs. Two factors likely explain this improved accuracy: Locator can handle abrupt changes in allele frequencies across the landscape better than <monospace>SPASIBA’s</monospace> geostatistical model, and the limited number of sampling localities in the AG1000G dataset may act as a prior encouraging Locator to assign samples to specific sampling sites. Maps of predictions from both methods are shown in <xref ref-type="fig" rid="fig3s1">Figure 3—figure supplement 1</xref>. Extrapolating from these run times, running a windowed whole-genome analysis of <italic>Anopheles</italic> in <monospace>SPASIBA</monospace> would require roughly 70 days of computation on an 80-CPU system for model training alone, versus 3.2 hr on one <monospace>GPU</monospace> for <monospace>Locator</monospace>.</p></sec><sec id="s2-2"><title>Uncertainty and variation along the genome</title><p>By running Locator in windows across the genome we aim to integrate over error associated with the model training procedure while also representing the inherent uncertainty caused by spatial drift of ancestral lineages backwards in time (<xref ref-type="bibr" rid="bib32">Kelleher et al., 2016</xref>). This produces a cloud of predicted locations distributed around the true sample location (<xref ref-type="fig" rid="fig4">Figure 4</xref>). For individuals near the center of the landscape, these clouds are roughly symmetrical, as expected from our model. Predictions for individuals close to the edge of the landscape appear slightly asymmetrical and are bounded by the true landscape edges, suggesting that our networks have learned the rough shape of the sampled range. The true location was within the 50% contour of a 2d-kernel density surface estimated from the set of per-window predictions for all test samples, demonstrating that this distribution is indeed centered on the true location. We also tested the alternate approach of bootstrapping over a single set of SNPs, which could be useful for smaller datasets or those lacking a reference alignment. Results for this method are discussed in <xref ref-type="fig" rid="fig4s1">Figure 4—figure supplement 1</xref>.</p><fig-group><fig id="fig4" position="float"><label>Figure 4.</label><caption><title>Predicted and true locations for eight individuals simulated in a population with mean per-generation dispersal 0.45 (roughly 1% of the landscape width).</title><p>Black points are predictions from 2Mbp windows, blue points are training sample locations, and the red point is the true location for each individual. Contours show the 95%, 50%, and 10% quantiles of a two-dimensional kernel density across all windows.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig4-v2.tif"/></fig><fig id="fig4s1" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 1.</label><caption><title>Predicted and true locations for eight individuals simulated in a population with an expected dispersal rate of 0.63 map units/generation, using a set of 10,000 randomly sampled SNPs.</title><p>Here, we generate predictions (black points) from bootstrap samples of the complete genotype matrix (in contrast to using separate sets of SNPs extracted from windows as used for figures in the main text). This could be useful for low-density genotyping data from approaches like ddRADseq, or when users lack a reference genome for windowing. In this setting, we see that the distribution of predictions is much smaller than fitting individual windows.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig4-figsupp1-v2.tif"/></fig></fig-group><p>Windowed analyses for the three empirical systems we studied are shown in the bottom panels of <xref ref-type="fig" rid="fig5">Figures 5</xref>, <xref ref-type="fig" rid="fig6">6</xref>, <xref ref-type="fig" rid="fig7">7</xref>. We discuss the implications of these predictions for each species in the following sections, but in general we find that the windowed analysis provides a good depiction of uncertainty in a sample’s location – either surrounding a single location for samples with low error, or distributed across a wide region including multiple training localities for samples with high error. In several cases, predicted locations also project in the direction of known historic migrations (as in human data), or are split among localities shown in previous analyses to experience high gene flow (as in <italic>Anopheles</italic>).</p><fig-group><fig id="fig5" position="float"><label>Figure 5.</label><caption><title>Top – Predicted locations for 153 <italic>Anopheles gambiae/coluzzii</italic> genomes from the AG1000G panel, using 612 training samples and a 2Mbp window size.</title><p>The geographic centroid of per-window predictions for each individual is shown in black points, and lines connect predicted to true locations. Sample localities are colored by the mean test error with size scaled to the number of training samples. Bottom – Uncertainty from predictions in 2Mbp windows. Contours show the 95%, 50%, and 10% quantiles of a two-dimensional kernel density across windows.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig5-v2.tif"/></fig><fig id="fig5s1" position="float" specific-use="child-fig"><label>Figure 5—figure supplement 1.</label><caption><title>Comparison of cross-validation performance on the ag1000g dataset using SNPs from chromosome 3R, under varying network architectures and numbers of SNPs.</title><p>Boxplots show the distribution of Euclidean distance between the true and predicted locations of validation samples across 10 replicate training runs. Network shapes are described on the horizontal axis as 'layers × width’. Although two-layer networks are typically the least accurate, no single architecture provides consistently better performance across datasets of different sizes. Missing networks required over 12 GB GPU RAM.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig5-figsupp1-v2.tif"/></fig><fig id="fig5s2" position="float" specific-use="child-fig"><label>Figure 5—figure supplement 2.</label><caption><title>Performance on 10,000 SNPs from chromosome 2L in the ag1000g phase one dataset when all samples from localities in the true country are dropped from the training set.</title></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig5-figsupp2-v2.tif"/></fig><fig id="fig5s3" position="float" specific-use="child-fig"><label>Figure 5—figure supplement 3.</label><caption><title>Performance on 10,000 SNPs from chromosome 2L in the ag1000g phase one dataset when all samples from the true locality are dropped from the training set.</title></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig5-figsupp3-v2.tif"/></fig></fig-group><fig-group><fig id="fig6" position="float"><label>Figure 6.</label><caption><title>Top – Predicted locations for 881 <italic>Plasmodium falciparum</italic> from the <italic>Plasmodium falciparum</italic> Community Project (<xref ref-type="bibr" rid="bib40">Pearson et al., 2019</xref>) (5% of samples for each collecting locality), using 5084 training samples and a 500Kbp window size.</title><p>The geographic centroid of per-window predictions for each individual is shown in black points, and lines connect predicted to true locations. Sample localities are colored by the mean test error with size scaled to the number of training samples. Bottom – Uncertainty from predictions in 500Kbp windows. Contours show the 95%, 50%, and 10% quantiles of a two-dimensional kernel density across windows.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig6-v2.tif"/></fig><fig id="fig6s1" position="float" specific-use="child-fig"><label>Figure 6—figure supplement 1.</label><caption><title>Centroid prediction error as a function of within-host diversity (<inline-formula><mml:math id="inf2"><mml:msub><mml:mi>F</mml:mi><mml:mrow><mml:mi>W</mml:mi><mml:mo>⁢</mml:mo><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>) for the <italic>Plasmodium falciparum</italic> dataset.</title><p><inline-formula><mml:math id="inf3"><mml:msub><mml:mi>F</mml:mi><mml:mrow><mml:mi>W</mml:mi><mml:mo>⁢</mml:mo><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> scales from 0 (maximum complexity) to 1 (minimum complexity). The blue line shows a linear regression (<inline-formula><mml:math id="inf4"><mml:mrow><mml:mrow><mml:mi>p</mml:mi><mml:mo>&lt;</mml:mo><mml:mrow><mml:mrow><mml:mn>2.2</mml:mn><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi></mml:mrow><mml:mo>-</mml:mo><mml:mn>16</mml:mn></mml:mrow></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mrow><mml:msup><mml:mi>R</mml:mi><mml:mn>2</mml:mn></mml:msup><mml:mo>=</mml:mo><mml:mn>0.006</mml:mn></mml:mrow><mml:mo>,</mml:mo><mml:mrow><mml:mrow><mml:mi>s</mml:mi><mml:mo>⁢</mml:mo><mml:mi>l</mml:mi><mml:mo>⁢</mml:mo><mml:mi>o</mml:mi><mml:mo>⁢</mml:mo><mml:mi>p</mml:mi><mml:mo>⁢</mml:mo><mml:mi>e</mml:mi></mml:mrow><mml:mo>=</mml:mo><mml:mn>148.1</mml:mn></mml:mrow></mml:mrow></mml:mrow></mml:math></inline-formula>). High within-host diversity does not appear to explain outliers in Locator’s prediction error.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig6-figsupp1-v2.tif"/></fig></fig-group><fig-group><fig id="fig7" position="float"><label>Figure 7.</label><caption><title>Top – Predicted locations for 162 individuals from the HGDP panel, using 773 training samples and a 10Mbp window size.</title><p>The geographic centroid of per-window predictions for each individual is shown in black points, and lines connect predicted to true locations. Sample localities are colored by the mean test error with size scaled to the number of training samples. Bottom – Uncertainty from predictions in 10Mbp windows. Contours show the 95%, 50%, and 10% quantiles of a two-dimensional kernel density across windows.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig7-v2.tif"/></fig><fig id="fig7s1" position="float" specific-use="child-fig"><label>Figure 7—figure supplement 1.</label><caption><title>Outliers in windowed Locator analyses identify genomic regions enriched for admixed ancestry.</title><p>(<bold>A</bold>) Windowed Locator predictions for Maya sample HGDP00871. (<bold>B</bold>) PCAs of all HGDP samples run on SNPs extracted from windows with predicted locations in western Europe (left) and west Africa (right). In these windows sample HGDP00871 (open points) clusters with individuals from region predicted by Locator in PC space, rather than with other genomes from the Americas.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig7-figsupp1-v2.tif"/></fig></fig-group><p>We summarize genome-wide window predictions in two ways: 1) by taking a kernel density estimate of the predictions and then finding the point of maximum density, and 2) by computing the centroid of the windowed predictions. These estimates are similar in spirit to ensemble prediction methods (<xref ref-type="bibr" rid="bib27">Ho and forests, 1995</xref>; <xref ref-type="bibr" rid="bib12">Breiman, 1996</xref>), but should not be interpreted as true statistical confidence intervals. At least in the context of windowed analyses, differences in predictions among windows appears to primarily reflect variation in ancestry rather than uncertainty in the inference itself, so we suggest the intervals returned by Locator’s kernel density estimation are best interpreted as representing areas from which a given proportion of the genome is likely to have originated. In general, we found that the maximum kernel density estimator has lower error, but tends to show classification behavior more than the centroid estimator – snapping to a single training locality rather than interpolating between sets of localities for samples with variable window predictions.</p></sec><sec id="s2-3"><title>Empirical analysis</title><sec id="s2-3-1"><title><italic>Anopheles</italic> mosquitoes</title><p>We next turn our attention to the application of <monospace>Locator</monospace> to empirical population genomic datasets. In <xref ref-type="fig" rid="fig5">Figure 5</xref>, we show predicted and true locations for 153 individuals from the Ag1000g dataset of <italic>Anopheles gambiae</italic> and <italic>A. coluzzii</italic>, estimated in 2Mbp windows across the genome. The location with highest kernel density across all windows had a median error of 5.7 km, and the centroid of the per-window predictions had a median error of 36 km (<xref ref-type="supplementary-material" rid="supp3">Supplementary file 3</xref>). Significant prediction error occurs only between sites in Cameroon, Burkina Faso, and the Republic of Guinea – localities which were also assigned to a single ancestry cluster in the <monospace>ADMIXTURE</monospace> analysis in <xref ref-type="bibr" rid="bib37">Miles and Harding, 2017</xref>. However uncertainty for these samples was relatively well described by visualizing the spread of per-window predictions, with predicted locations generally lying between sets of localities. The true locality was within the 95% interval of the kernel density across all windows for all samples.</p></sec><sec id="s2-3-2"><title><italic>Plasmodium falciparum</italic></title><p>In a windowed analysis of <italic>P. falciparum</italic>, Locator’s median error is 16.92 km using the maximum kernel density and 218.99 km using the geographic centroid of window predictions (<xref ref-type="fig" rid="fig6">Figure 6</xref>; <xref ref-type="supplementary-material" rid="supp3">Supplementary file 3</xref>). Mean predicted locations across all windows consistently separate populations in the Americas, West Africa, East Africa, southeast Asia, and Papua New Guinea; consistent with the major population subdivisions described via PCA in <xref ref-type="bibr" rid="bib40">Pearson et al., 2019</xref>. We also see good discrimination within clusters, particularly in southeast Asia where the average test error is less than 200 km for all but two localities. Error is highest in West Africa, where mean predictions tend towards the center of a set of regional collecting localities (<xref ref-type="fig" rid="fig6">Figure 6</xref>). These patterns are consistent with previous findings of fine-scale spatial structure in <italic>P. falciparum</italic> in Cambodia (<xref ref-type="bibr" rid="bib38">Miotto et al., 2013</xref>) and low levels of relative genetic differentiation (as measured by <inline-formula><mml:math id="inf5"><mml:msub><mml:mi mathsize="90%">F</mml:mi><mml:mrow><mml:mi mathsize="90%">S</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">T</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>) in Africa (<xref ref-type="bibr" rid="bib40">Pearson et al., 2019</xref>).</p><p>Rates of mixed-strain infection are elevated in West Africa relative to Southeast Asia (<xref ref-type="bibr" rid="bib64">Zhu et al., 2019</xref>; <xref ref-type="bibr" rid="bib40">Pearson et al., 2019</xref>), which we hypothesized could explain the higher prediction error in this region. To test this effect, we plotted Locator’s centroid prediction error as a function of within-host diversity (<inline-formula><mml:math id="inf6"><mml:msub><mml:mi mathsize="90%">F</mml:mi><mml:mrow><mml:mi mathsize="90%">W</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">S</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>; <xref ref-type="bibr" rid="bib4">Auburn et al., 2012</xref>). <inline-formula><mml:math id="inf7"><mml:msub><mml:mi mathsize="90%">F</mml:mi><mml:mrow><mml:mi mathsize="90%">W</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">S</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> measures the proportion of population genetic diversity present in individual hosts, with a value of 0 representing maximum within-host diversity and one minimum within-host diversity. If mixed-strain infections explain outliers of prediction error, we would expect that samples with the highest prediction error had low <inline-formula><mml:math id="inf8"><mml:msub><mml:mi mathsize="90%">F</mml:mi><mml:mrow><mml:mi mathsize="90%">W</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">S</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>. Instead we found a weak positive relationship (<xref ref-type="fig" rid="fig6s1">Figure 6—figure supplement 1</xref>), with the highest prediction errors seen in samples with maximum <inline-formula><mml:math id="inf9"><mml:msub><mml:mi mathsize="90%">F</mml:mi><mml:mrow><mml:mi mathsize="90%">W</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">S</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> (i.e. minimum infection diversity). Test error then likely reflects low levels of differentiation within <italic>Plasmodium</italic> lineages in West Africa rather than local prevalence of mixed-strain infections.</p><p>Again we found that visualizing per-window predictions reflects expected patterns of uncertainty in samples with high mean prediction error. For example, sample QM0215-C was collected in Madagascar and has a mean predicted location in Mozambique, but the spread of per-window predictions indicates a 95% interval that includes the true locality (<xref ref-type="fig" rid="fig6">Figure 6</xref>, bottom right).</p><p>The good performance we observed on this dataset also highlights a strength of <monospace>Locator’s</monospace> model-free approach. Recall that the sequencing strategy of preparing libraries from human blood samples suggests variant calls represent binned allele frequencies across the population of <italic>Plasmodium</italic> in a human blood sample rather than SNPs in a single <italic>Plasmodium</italic> individual. From the perspective of the network, however, the input genotypes are simply a set of normalized vectors, and the network can approximate the relationship between these vectors and the spatial location of training samples regardless of the generative process.</p></sec><sec id="s2-3-3"><title>Human populations</title><p>For humans in the HGDP dataset, the location with highest kernel density across all windows has a median test error of 85 km, and the centroid of window predictions has a median error of 452.6 km (<xref ref-type="fig" rid="fig7">Figure 7</xref>, <xref ref-type="supplementary-material" rid="supp3">Supplementary file 3</xref>). Visualizing the geographic distribution of predictions across the genome shows that predictions tend to cluster around the true reported sampling location, but also extend toward other sampling locations in a manner that reflects known patterns of human migration.</p><p>For example, the two largest individual errors in our analysis are found in South African Bantu individuals and Xibo people from western China. Predicted locations of South African Bantu people project towards the historic source of Bantu migrations in west Africa (<xref ref-type="bibr" rid="bib18">de Filippo et al., 2012</xref>), with some regions of the genome also projecting in the direction of east African Bantu populations (<xref ref-type="fig" rid="fig7">Figure 7</xref>, sample HGDP00993). In the case of Xibo people from western China Locator consistently predicts locations in Manchuria, central China, and southern Sibera – significantly east of the true sample location. This may reflect the known movement of this population, which historically originated in Manchuria and was resettled in western China during the 18th century (<xref ref-type="bibr" rid="bib23">Gorelova, 2002</xref>; <xref ref-type="bibr" rid="bib65">Zikmundová, 2013</xref>; <xref ref-type="fig" rid="fig7">Figure 7</xref>, sample HGDP01250). A sample of individual-level predictions is included in <xref ref-type="fig" rid="fig7">Figure 7</xref>.</p><p>To test whether outlier geographic predictions reflect error in the model fitting procedure versus true variation in ancestry in a given region of the genome, we ran principal component analyses on windows for which a Maya individual (sample HGDP00871) has predicted locations in Europe and Africa. In these windows, the Maya sample clusters with other individuals from the regions predicted by Locator – western Europe and Africa, respectively – rather than with other individuals from the Americas (<xref ref-type="fig" rid="fig7s1">Figure 7—figure supplement 1</xref>). This suggests outlier predictions primarily reflect variation in ancestry in different regions of the genome, rather than stochastic error in model fitting.</p></sec></sec><sec id="s2-4"><title>Genomic factors affecting prediction accuracy</title><p>Locator’s prediction accuracy varied widely along the human genome. To assess the sources of this variation, we first examined how recombination rate interacts with the accuracy of <monospace>Locator</monospace> predictions generated from different regions of the genome. A priori we might expect recombination rate to affect accuracy because in regions of the genome with higher recombination, there are a greater number of distinct genealogies, and hence a given sample has inherited from a larger subset of the possible ancestors. Test error was estimated as the distance in kilometers from the true sampling location to the geographic centroid of the cloud of per-window predictions, and is shown in <xref ref-type="fig" rid="fig8">Figure 8</xref> plotted against local recombination rates from the HapMap genetic map (<xref ref-type="bibr" rid="bib29">International HapMap Consortium, 2003</xref>). We find a relatively strong negative correlation (<inline-formula><mml:math id="inf10"><mml:mrow><mml:mi mathsize="90%">p</mml:mi><mml:mo mathsize="90%" stretchy="false">&lt;</mml:mo><mml:mn mathsize="90%">0.0001</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="inf11"><mml:mrow><mml:msup><mml:mi mathsize="90%">R</mml:mi><mml:mn mathsize="90%">2</mml:mn></mml:msup><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0.27</mml:mn></mml:mrow></mml:math></inline-formula>) – windows with the lowest recombination rates in general have the highest prediction error. This is consistent with our expectation that regions of the genome representing a greater number of marginal genealogies will yield more accurate predictions of a sample’s location.</p><fig-group><fig id="fig8" position="float"><label>Figure 8.</label><caption><title>Per-window test error and mean recombination rate for human populations in the HGDP dataset.</title><p>The top 2% of windows by test error were excluded from this analysis. The slope of the least-squares linear fit is −99.9723 km/(cM/Mbp) and has adjusted <inline-formula><mml:math id="inf12"><mml:mrow><mml:msup><mml:mi>R</mml:mi><mml:mn>2</mml:mn></mml:msup><mml:mo>=</mml:mo><mml:mn>0.2704</mml:mn></mml:mrow></mml:math></inline-formula>.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig8-v2.tif"/></fig><fig id="fig8s1" position="float" specific-use="child-fig"><label>Figure 8—figure supplement 1.</label><caption><title>Mean test error for HGDP samples in 10-megabase windows.</title><p>Triangles show approximate centromere locations.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig8-figsupp1-v2.tif"/></fig><fig id="fig8s2" position="float" specific-use="child-fig"><label>Figure 8—figure supplement 2.</label><caption><title>Mean test error for HGDP samples in 10-centimorgan windows.</title><p>Triangles show approximate centromere locations.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig8-figsupp2-v2.tif"/></fig><fig id="fig8s3" position="float" specific-use="child-fig"><label>Figure 8—figure supplement 3.</label><caption><title>Distributions of centroid prediction error across samples.</title><p>Despite differences in error among genomic windows (<xref ref-type="fig" rid="fig8s1">Figure 8—figure supplements 1</xref> and <xref ref-type="fig" rid="fig8s2">2</xref>), error in the mean genome-wide predicted location is very similar when using megabase (top) or centimorgan (bottom) windows.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig8-figsupp3-v2.tif"/></fig><fig id="fig8s4" position="float" specific-use="child-fig"><label>Figure 8—figure supplement 4.</label><caption><title>Distributions of prediction error across windows when using megabase- versus centimorgan-based windows.</title></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig8-figsupp4-v2.tif"/></fig></fig-group><p>This finding suggests recombination-based distances may be a better basis for establishing window bounds. We tested this by replicating our analysis of <monospace>HGDP</monospace> samples using a <monospace>10-centiMorgan</monospace> window size, which yields approximately the same number of windows across the genome. We found the distribution of centroid prediction errors across windowing methods was very similar (<xref ref-type="fig" rid="fig8s3">Figure 8—figure supplement 3</xref>) but the variance in per-window prediction error was lower when using recombination-based windows (<xref ref-type="fig" rid="fig8s4">Figure 8—figure supplement 4</xref>; Levene’s test <inline-formula><mml:math id="inf13"><mml:mrow><mml:mi mathsize="90%">p</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0.0002</mml:mn></mml:mrow></mml:math></inline-formula>, df = 654). Examining plots of window error along the genome suggests much of this effect is caused by high error in windows containing a centromere when using physical distance-based windows (<xref ref-type="fig" rid="fig8s1">Figure 8—figure supplement 1</xref>, <xref ref-type="fig" rid="fig8s2">Figure 8—figure supplement 2</xref>). Centromere presence explains 26.9% of variance in window prediction error using 10 Mb windows, but just 2.6% of variance with centiMorgan-based windows. Thus, we recommend researchers interested in analyzing individual window predictions use recombination-based windows when possible, but find that using fixed windows is sufficient for estimating individual-level locations.</p><p>Last, to examine how predictions vary near a well-known geographically differentiated region of the genome, we trained a <monospace>Locator</monospace> model using SNPs from within 100 kb of the <italic>EDAR</italic> gene. The rs3827760 SNP is a <inline-formula><mml:math id="inf14"><mml:mrow><mml:mi mathsize="90%">A</mml:mi><mml:mo mathsize="90%" stretchy="false">→</mml:mo><mml:mi mathsize="90%">G</mml:mi></mml:mrow></mml:math></inline-formula> mutation that created a derived allele which has reached high frequency in East Asian and North American populations but is rare elsewhere (<xref ref-type="bibr" rid="bib13">Bryk et al., 2008</xref>). This variant is thought to be associated with traits including hair thickness (<xref ref-type="bibr" rid="bib22">Fujimoto et al., 2008</xref>), and the EDAR region has been proposed as a site of recent positive selection in several analyses (<xref ref-type="bibr" rid="bib57">Voight and Kudaravalli, 2006</xref>; <xref ref-type="bibr" rid="bib53">Tang et al., 2007</xref>; <xref ref-type="bibr" rid="bib59">Williamson et al., 2007</xref>). We focused on predictions for samples from central Asia, in the middle of the east-west cline in rs3827760 allele frequencies across Eurasia.</p><p>In this analysis, the direction of prediction error generally followed the genotype at rs3827760 – individuals with a G allele tend to predict east of their true location (<xref ref-type="fig" rid="fig9">Figure 9</xref>). This was particularly clear in heterozygous populations. For example, homozygous G/G Xibo and Hazara individuals predict east of their true location, while one homozygous A/A Uyghur sample predicts well west of the sampling site. 3 of 4 heterozygous samples also predict east of their true location, and five other A/A Central/South Asian samples predict significantly west. The discrepancies between sampling and predicted locations likely in fact represent signal: haplotypes carrying a G allele at this locus likely have more ‘close’ relatives in eastern than western Eurasia. These patterns are magnified versions of the trends seen in windowed analyses, suggesting that strong differentiation in this genomic region biases location predictions away from the center of the geographic cline.</p><fig id="fig9" position="float"><label>Figure 9.</label><caption><title>Predicted locations for HGDP samples from central Asia using a model trained on SNPs within 100 kb of <italic>EDAR</italic>.</title><p>Black points show sampling locations. Arrows are colored by genotype at variant rs3827760 and point towards the predicted location. Frequency of the A allele by longitude is shown below the map.</p></caption><graphic mime-subtype="tiff" mimetype="image" xlink:href="elife-54507-fig9-v2.tif"/></fig></sec><sec id="s2-5"><title>Effects of unsampled populations</title><p>To understand how Locator predictions vary when a sample’s true locality is not included in the training set, we ran analyses on a single window of the <italic>Anopheles</italic> data at two scales – first dropping only sites from a specific sampling location, and then dropping all sites from a given country (<xref ref-type="fig" rid="fig5s2">Figure 5—figure supplements 2</xref>–<xref ref-type="fig" rid="fig5s3">3</xref>). Prediction error is much higher for individuals from regions excluded from training – increasing from a median of 14 km when training and test samples are randomly split to 116 km when excluding individual localities, and 778 km when excluding whole countries.</p><p>In most cases, predicted locations appear to project toward the nearest locality included in the training set (<xref ref-type="fig" rid="fig5s3">Figure 5—figure supplement 3</xref>). This is particularly the case when populations at the edge of the map are excluded. <monospace>Locator</monospace> networks appear to learn something about the boundaries of the landscape based on the distribution of training points, and show a tendency to project towards the middle of the landscape when given a small number of SNPs (e.g. the top right panel of <xref ref-type="fig" rid="fig2">Figure 2A</xref>), a trivial optimization of the loss function. We also see evidence of <monospace>Locator</monospace> learning some nonlinear aspects of population structure in the sample. For example, when Angolan <italic>A. coluzzii</italic> are excluded from the training set many of their predicted locations project toward the <italic>A. coluzzii</italic> sample localities in Burkina Faso rather than the much closer sampling localities for <italic>A. gambiae</italic> in Cameroon and Gabon. In general, we find that Locator can interpolate unsampled localities relatively well when genetic differentiation is smooth over the landscape (as among <italic>A. gambiae</italic> localities in west Africa), but does not extrapolate outside the bounds of the training set. Sampling the full landscape, or at least a sufficient portion thereof, is thus an important consideration in running our method.</p></sec></sec><sec id="s3" sec-type="discussion"><title>Discussion</title><p>The correlation of genealogy and geography leaves genetic signals of ancestral location across the genome that one can leverage for practical inference. For instance, tracking the migratory routes of disease vectors such as <italic>Anopheles</italic> (<xref ref-type="bibr" rid="bib28">Huestis et al., 2019</xref>) could in principle be achieved if one could accurately predict origin from DNA sequence data. Similarly, establishing the location of origin from biological samples is critical to anti-poaching conservation efforts (<xref ref-type="bibr" rid="bib58">Wasser et al., 2004</xref>), and efforts to map transmission during the ongoing SARS-CoV-2 pandemic have been informed by analysis of geographically restricted genetic variants (see e.g., <ext-link ext-link-type="uri" xlink:href="https://nextstrain.org/ncov/global">https://nextstrain.org/ncov/global</ext-link>). In this report, we present a new tool, <monospace>Locator</monospace>, which uses a deep neural network to predict the geographic location of a sample on the basis of its genotype. We show that Locator is highly accurate, computationally efficient, and can scale to thousands of genomes.</p><p>In simulations we found that our method achieves similar accuracy as a state-of-the-art model-based approach, <monospace>SPASIBA</monospace> (<xref ref-type="bibr" rid="bib24">Guillot et al., 2016</xref>), and does so at least an order of magnitude faster. We show that the accuracy of our estimator is naturally measured in terms of the dispersal rate of the population and that predictions from Locator are consistently within 3–4 generations of mean dispersal across a wide range of dispersal distances (<xref ref-type="fig" rid="fig2">Figure 2</xref>, <xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref>). However, the greatest increase in accuracy relative to <monospace>SPASIBA</monospace> was in empirical data (<xref ref-type="fig" rid="fig3">Figure 3</xref>). This seems to reflect two aspects of our approach that highlight its strengths and weaknesses: as a process-agnostic model <monospace>Locator</monospace> can easily handle situations in which allele frequencies do not vary smoothly over the landscape. However, the spatial concentration of the <italic>Anopheles</italic> samples may act as a strong prior that incentivizes the network to predict sample locations near sampling localities (<xref ref-type="fig" rid="fig3">Figure 3</xref>, <xref ref-type="fig" rid="fig5">Figure 5</xref>), thus acting more as a classifier than a continuous predictor. Thus, sampling should be taken into account when interpreting <monospace>Locator’s</monospace> output, and when possible users should avoid highly clustered sampling regimes.</p><p><monospace>Locator’s</monospace> computational efficiency makes it practical to estimate uncertainty through resampling approaches like windowed analysis or bootstrapping over the complete genotype matrix. The full windowed analysis of the HGDP data took roughly 30 hr to run on a single GPU, and windowed analysis of all 5965 complete <italic>Plasmodium</italic> genomes took just 8 hr. Thus, training Locator models for biobank-scale datasets including whole genomes of tens or hundreds of thousands of samples is well within reach, particularly if windows can be run on separate GPUs. This allows us to estimate uncertainty in predicted locations due both to our prediction methodology as well as biology; with repeated training runs integrating over error associated with network training and prediction and the windowed analysis allowing us to predict geographic origins for regions of the genome reflecting distinct sets of genealogical relationships.</p><p>Disentangling these sources of error is challenging, but analysis of human data for which we have strong prior knowledge of recent population movements suggests that much of the variation in genome-wide prediction we see reflects historic patterns of migration rather than simple prediction error. For example, genomes from Hazara individuals in central Asia return predicted locations extending from central Asia to Mongolia (<xref ref-type="fig" rid="fig7">Figure 7</xref> bottom, sample HGDP00118), which is consistent with historic records (<xref ref-type="bibr" rid="bib43">Qamar et al., 2002</xref>), previous analysis of Y chromosome data (<xref ref-type="bibr" rid="bib63">Zerjal et al., 2003</xref>), and identity-by-descent tract sharing (<xref ref-type="bibr" rid="bib35">Lawson et al., 2012</xref>) all of which find evidence of recent shared ancestry between Mongolian and Hazara individuals. Similarly some Maya individuals found to have a small proportion of European ancestry in previous analyses <xref ref-type="bibr" rid="bib46">Rosenberg et al., 2002</xref> have predicted locations extending from central Mexico across the Atlantic to Europe and west Africa in windowed Locator analysis (<xref ref-type="fig" rid="fig7">Figure 7</xref> bottom, sample HGDP00871), and these signals are replicated in principal components analysis (<xref ref-type="fig" rid="fig7s1">Figure 7—figure supplement 1</xref>).</p><p>The correspondence between our explicitly geographic method and unsupervised clustering or dimensionality reduction methods highlights the implicit prior assumption of genetic-geographic correlation often made when interpreting the output of <monospace>STRUCTURE</monospace> or <monospace>PCA</monospace>. Rather than mapping population structure to geography as a post-hoc interpretation, Locator and other continuous assignment methods directly incorporate space in the model. This also points to a critical consideration in running any form of supervised population clustering. Information about population structure comes only from the relative relationships among training and test samples, and interpretations can only be made relative to the set of training samples used. In the case of the HGDP panel, samples were intentionally selected to cover what were thought to be distinctive populations reflecting a vaguely pre-modern distribution of human genetic diversity (<xref ref-type="bibr" rid="bib26">Harry and Marks, 1999</xref>), and so would probably not be a good reference set for random individuals drawn from areas with recent histories of large population movements such as the United States.</p><p>Here, we have shown that our method, <monospace>Locator</monospace>, is fast, accurate, and scales well to large samples. However, we see several next steps that could improve the approach. First, our current implementation uses only diploid genotypes and does not pass the network any direct information about haplotype structure. Incorporating SNP position information and phased haploid sequences would likely increase inferential power, as in the case of unsupervised clustering (<xref ref-type="bibr" rid="bib35">Lawson et al., 2012</xref>). Running this method on phased, haploid genomes could also in theory allow us to predict parental locations individually for loci with ancestry from different geographic regions. Second, our network currently uses a simple fully connected architecture; it could be that other network architectures such as recurrent neural networks might be better suited for this task (e.g. <xref ref-type="bibr" rid="bib2">Adrion et al., 2020</xref>). Indeed the application of deep learning to population genetics is still in its infancy and we imagine much progress will be made in the coming years along these lines.</p><p>A central issue in this task will be understanding the limits of process-agnostic inference: when and how can we best use machine learning approaches in population genetics? <monospace>Locator</monospace> is essentially a flexible regressor designed without direct reference to genealogical or genetic process, so the exact design of the network or the arrangement of the weights and biases in a trained model gives little insight into the underlying mechanisms driving its inferences. These are instead best assessed by carefully studying the natural history of the focal organism, and by interpreting model output with population genetic theory and simulations. We suggest machine learning methods be seen as tools to answer narrowly defined questions, used as a complement to process-based statistical models that give deeper insight into the mechanisms generating the data being analyzed.</p><p>In principle, a completely process-based inference method that accurately modeled spatial population dynamics might provide the most accurate and best-calibrated inference of location and/or ancestry. However, the problem of modeling spatial populations is not solved, and all existing methods are based on assumptions (e.g. an unchanged species range on a uniform landscape [<xref ref-type="bibr" rid="bib60">Wright, 1943</xref>]) that may not hold in practice. For this reason, machine learning approaches might outperform methods based on process. Beyond the present application we believe a powerful approach will be to combine process-based population genetic models with the generalization abilities of deep learning – analogous to natural language processing methods that supplement neural network word embeddings with syntax models (<xref ref-type="bibr" rid="bib51">Strubell and McCallum, 2018</xref>). This could allow us to leverage theory where assumptions are well-founded while turning to robust generalized optimization techniques when they are not.</p></sec><sec id="s4" sec-type="materials|methods"><title>Materials and methods</title><sec id="s4-1"><title>Preprocessing</title><p><monospace>Locator</monospace> transforms input data in VCF or Zarr format to vectors of allele counts per individual using the scikit-allel (<xref ref-type="bibr" rid="bib37">Miles and Harding, 2017</xref>) and numpy (<xref ref-type="bibr" rid="bib55">van der Walt et al., 2011</xref>) libraries. Sites with missing data are replaced with two draws from a binomial distribution with probability equal to the frequency of the derived allele across all individuals – a discrete version of the common practice of assigning missing data as the mean allele frequency in genotype PCAs (e.g. the default settings for PCA in the R package adegenet [<xref ref-type="bibr" rid="bib31">Jombart, 2008</xref>]). We provide functions for filtering SNPs based on minor allele count, and by default remove singleton sites from the alignment prior to model fitting. The geographical <inline-formula><mml:math id="inf15"><mml:mi mathsize="90%">x</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="inf16"><mml:mi mathsize="90%">y</mml:mi></mml:math></inline-formula> coordinates are scaled to have mean 0 and variance one prior to training, while allele counts are scaled prior to model fitting by a batch normalization layer within the network. Batch normalization Z-normalizes activations of a neural network during training to reduce shifts in the distribution of parameter values across batches, which allows faster learning rates and sometimes reduces overfitting (<xref ref-type="bibr" rid="bib30">Ioffe and Szegedy, 2015</xref>).</p><p><monospace>Locator</monospace> selects user-defined fraction of the samples with known locations to use in training the model (the default is 0.9); remaining samples with known locations are kept aside as ‘validation’ samples. The validation set is used to tune the learning rate of the optimizer and set the stopping time of model training, but does not directly contribute to the loss used to fit model parameters. Throughout this manuscript, we use ‘validation loss’ to refer to error estimated on the validation set, and ‘test error’ to refer to error calculated on a set of samples entirely held out from the model training procedure.</p><p>For datasets with small sample sizes the random train/test split may lead to some regions being under- or overrepresented in the training sample. To mitigate this we suggest fitting multiple models with different random seeds, yielding an ensemble of models trained on different subsets of the original dataset. Predictions from this ensemble can then be summarized in the same way as windows or bootstrap samples (see below). An example of this approach is included in the Locator documentation (<ext-link ext-link-type="uri" xlink:href="https://github.com/kern-lab/locator">https://github.com/kern-lab/locator</ext-link>).</p></sec><sec id="s4-2"><title>Network</title><p>We use the unphased, diploid genotype vector of each individual as input to the network, whose target output is the two-dimensional coordinates of that individual in space. Locator uses a deep neural network consisting of a stack of fully connected ‘dense’ layers, implemented using the Keras (<xref ref-type="bibr" rid="bib15">Chollet, 2015</xref>) frontend to tensorflow (<xref ref-type="bibr" rid="bib1">Abadi et al., 2015</xref>). Roughly speaking, the network is trained to estimate a nonlinear function mapping genotypes to locations using gradient-based optimization. Models start with randomized initial parameters and are fit to data by looping through the training set and iteratively adjusting the weights and biases of the network. We use an early stopping function to monitor loss during training and under default settings stop training runs when validation loss has not improved for 100 epochs. We also use a learning rate scheduler to decrease the learning rate of the optimizer when validation loss stops improving, which we found to be effective in preventing the trajectories of training and validation loss from diverging. The program also outputs a plot of training and validation loss after each training run (<xref ref-type="fig" rid="fig2s2">Figure 2—figure supplement 2</xref>).</p><p>Locator’s architecture uses a batch normalization layer followed by a sequence of fully connected layers with a dropout layer in the middle of the network (<xref ref-type="fig" rid="fig1">Figure 1</xref>). The ‘dropout’ layer sets a random selection of weights to zero during each training step, which helps prevent overfitting (<xref ref-type="bibr" rid="bib50">Srivastava et al., 2014</xref>). Our implementation allows users to adjust the shape of the network, but current default settings use 10 dense layers of 256 nodes each with ‘ELU’ activations (<xref ref-type="bibr" rid="bib16">Clevert et al., 2015</xref>) and a 25% dropout after the fifth layer. We describe performance under varying network width and depth in <xref ref-type="fig" rid="fig5s1">Figure 5—figure supplement 1</xref>. In general, we found that all networks with over four layers perform similarly.</p><p>We use the Adam optimizer (<xref ref-type="bibr" rid="bib34">Kingma and Ba, 2014</xref>) with Euclidean distance as a loss function:<disp-formula id="equ1"><label>(1)</label><mml:math id="m1"><mml:mrow><mml:mrow><mml:mtext mathsize="90%">loss</mml:mtext><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:msqrt><mml:mrow><mml:msup><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mi mathsize="90%">x</mml:mi><mml:mtext mathsize="90%">predicted</mml:mtext></mml:msub><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:msub><mml:mi mathsize="90%">x</mml:mi><mml:mtext mathsize="90%">true</mml:mtext></mml:msub></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow><mml:mn mathsize="90%">2</mml:mn></mml:msup><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:msup><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mi mathsize="90%">y</mml:mi><mml:mtext mathsize="90%">predicted</mml:mtext></mml:msub><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:msub><mml:mi mathsize="90%">y</mml:mi><mml:mtext mathsize="90%">true</mml:mtext></mml:msub></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow><mml:mn mathsize="90%">2</mml:mn></mml:msup></mml:mrow></mml:msqrt></mml:mrow><mml:mo mathsize="90%" stretchy="false">.</mml:mo></mml:mrow></mml:math></disp-formula></p></sec><sec id="s4-3"><title>Uncertainty and genome-wide variation</title><p>Individuals are born at a single location, but have inherited their genomes as a mosaic from ancestors spreading geographically into the past (as discussed in, for instance, <xref ref-type="bibr" rid="bib60">Wright, 1943</xref>; <xref ref-type="bibr" rid="bib32">Kelleher et al., 2016</xref>; <xref ref-type="bibr" rid="bib10">Bradburd and Ralph, 2019</xref>). Any signal our method hopes to extract from the data must be due to geographic signal of recent ancestors shared between the test and training datasets. This suggests that any analogous method must quantify, roughly, ‘which modern day populations are most similar to this genome?”. The spatial spread of genetic relatedness both back in time from an individual’s to its ancestors’ locations and forward in time from ancestors to the present-day location of training samples means that even a perfect inference algorithm should have significant uncertainty associated with any predicted location from genetic data, and the magnitude of uncertainty should be in part a function of the dispersal rate of the population. In particular, no such method can infer locations more accurately than the mean dispersal distance, because in most cases an individual’s genome is not informative about where they live relative to their parents. Besides this fundamental limit to uncertainty, error in georeferencing of training samples and in model fitting will introduce additional prediction uncertainty.</p><p>We use a windowed analysis across the genome to describe this uncertainty, which is possible thanks to <monospace>Locator’s</monospace> computational efficiency. Genealogical relatedness on each contiguous stretch of genome can be described by a sequence of genealogical trees, separated by ancestral recombination events. By running Locator on a particular window of the genome, we restrict inference to a subset of these marginal trees, and hence to a subset of the genetic relationships between test and training samples. Predictions from different regions of the genome can then be visualized as a cloud of points, and the distribution of these points in space gives us a rough idea of the uncertainty associated with an individual-level prediction. Because windowed analyses involve repeated training runs from randomized starting parameters, they also help us to integrate over uncertainty associated with the model fitting process.</p><p>Some datasets lack the size or reference alignments necessary to conduct windowed analyses. In this case, we recommend uncertainty be assessed by training replicate models on bootstrapped samples drawn from a single set of unlinked SNPs (that is, resampling SNPs with replacement). Although this procedure does not reduce the number of marginal trees represented in the data, it does allow us to assess uncertainty associated with model training and prediction. In both cases, we summarize uncertainty in predicted locations by estimating a two-dimensional kernel density surface over a set of predicted locations, and provide plotting scripts to visualize the 95%, 50%, and 10% quantiles in geographic space (see <xref ref-type="fig" rid="fig5">Figures 5</xref>–<xref ref-type="fig" rid="fig7">7</xref> for examples). The location of an individual can then be predicted as either the location with highest kernel density (the modal prediction) or the geographic center of the cloud of predictions (the mean prediction).</p><p>We tested this approach in simulated data and in all empirical datasets. To explore factors affecting the accuracy of predicted locations generated from different regions of the genome, we also examined the relationship between recombination rate and test error from windowed <italic>Locator</italic> runs on human data from the HGDP panel (<xref ref-type="bibr" rid="bib8">Bergström et al., 2020</xref>). Recombination rates for each window were estimated by averaging per-base rates from the HapMap project (<xref ref-type="bibr" rid="bib29">International HapMap Consortium, 2003</xref>).</p></sec><sec id="s4-4"><title>Simulations</title><p>We first evaluated our method on genotypes from populations simulated by SLiM v3 (<xref ref-type="bibr" rid="bib25">Haller and Messer, 2019</xref>), using the model of continuous space described in <xref ref-type="bibr" rid="bib7">Battey, 2019</xref>. We simulated a 50 × 50 unit square landscape with expected density (<inline-formula><mml:math id="inf17"><mml:mi mathsize="90%">d</mml:mi></mml:math></inline-formula>) of 5 individuals per unit area, resulting in census sizes of around 12,500. We varied the mean parent-offspring dispersal distance <inline-formula><mml:math id="inf18"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula> across simulations from 0.45 to 3, to create populations with varying levels of isolation by distance. In terms of Wright’s ‘neighborhood size’ (<xref ref-type="bibr" rid="bib61">Wright, 1946</xref>), defined as <inline-formula><mml:math id="inf19"><mml:mrow><mml:msub><mml:mi mathsize="90%">N</mml:mi><mml:mtext mathsize="90%">loc</mml:mtext></mml:msub><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mn mathsize="90%">4</mml:mn><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">π</mml:mi><mml:mo>⁢</mml:mo><mml:msup><mml:mi mathsize="90%">σ</mml:mi><mml:mn mathsize="90%">2</mml:mn></mml:msup><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">d</mml:mi></mml:mrow></mml:mrow></mml:math></inline-formula>, this yields populations with neighborhood sizes from 13 to 565. Each diploid individual carried two copies of a 10<sup>8</sup> bp chromosome on which mutations and recombinations occured at a rate of 10<sup>-8</sup> per bp per generation. Simulations were run until all extant individuals shared a single common ancestor within the simulation at all locations on the genome (i.e., the tree sequence had coalesced). 500 individuals were randomly sampled from the final generation of each simulation for use in model fitting.</p><p>We selected 50 individuals from each simulation as a validation set and ran Locator while varying the number of training samples from 10 to 450 and the number of SNPs from 100 to 100,000. The SNPs used were a subset sampled from the full genotype matrix without replacement and thus mimic the semi-random distribution of genome-wide SNPs generated by reduced-representation sequencing approaches like RADseq (<xref ref-type="bibr" rid="bib20">Etter et al., 2012</xref>). To compare performance with an existing model-based approach, we also ran SPASIBA (<xref ref-type="bibr" rid="bib24">Guillot et al., 2016</xref>) on the simulation with <inline-formula><mml:math id="inf20"><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0.44</mml:mn></mml:mrow></mml:math></inline-formula> using 450 training samples and varying the number of SNPs from 100 to 100,000. Locator was run on a CUDA-enabled GPU and SPASIBA was run on 80 CPU cores. Last, we ran a windowed analysis on the <inline-formula><mml:math id="inf21"><mml:mrow><mml:mi mathsize="90%">σ</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">0.63</mml:mn></mml:mrow></mml:math></inline-formula> (neighborhood size <inline-formula><mml:math id="inf22"><mml:mrow><mml:mi/><mml:mo mathsize="90%" stretchy="false">≈</mml:mo><mml:mn mathsize="90%">25</mml:mn></mml:mrow></mml:math></inline-formula>) simulation in Locator using a 2Mbp window size (each window then contains ≈ 8000 SNPs).</p></sec><sec id="s4-5"><title>Empirical data</title><p>We applied Locator to three whole-genome resequencing datasets of geographically widespread samples: (1) 765 mosquitoes from the <italic>Anopheles gambiae/coluzzii</italic> species complex collected across sub-Saharan Africa (<xref ref-type="bibr" rid="bib3">Anopheles gambiae 1000 Genomes Consortium et al., 2017</xref>), (2) 5965 samples of the malaria parasite <italic>Plasmodium falciparum</italic> sequenced from human blood samples collected across Papua New Guinea, southeast Asia, sub-Saharan Africa, and northern South America (<xref ref-type="bibr" rid="bib40">Pearson et al., 2019</xref>) and (3) whole-genome data for 56 human populations from the Human Genome Diversity Project (<xref ref-type="bibr" rid="bib8">Bergström et al., 2020</xref>). Genotype calls for the <italic>Anopheles</italic> dataset are available at <ext-link ext-link-type="uri" xlink:href="https://www.malariagen.net/data/ag1000g-phase1-ar3">https://www.malariagen.net/data/ag1000g-phase1-ar3</ext-link>, for <italic>P. falciparum</italic> at <ext-link ext-link-type="uri" xlink:href="https://www.malariagen.net/resource/26">https://www.malariagen.net/resource/26</ext-link>, and for human data at <ext-link ext-link-type="uri" xlink:href="ftp://ngs.sanger.ac.uk/production/hgdp">ftp://ngs.sanger.ac.uk/production/hgdp</ext-link>. We used VCF files as provided with no further postprocessing.</p><p>The <italic>Plasmodium falciparum</italic> dataset is unusual relative to our other empirical examples in that sequencing libraries were prepared from blood samples without filtering for coinfections or isolating individual <italic>Plasmodium</italic>. Sequence reads returned from short read sequencing then reflect the population of <italic>Plasmodium</italic> present in a human blood sample, or even multiple lineages of parasite if an individual is co-infected with multiple strains (<xref ref-type="bibr" rid="bib64">Zhu et al., 2019</xref>), rather than individual <italic>Plasmodium</italic>. The VCFs we analyzed were prepared by aligning illumina short read sequences to the <italic>Plasmodium falciparum</italic> reference genome prepared by the Pf3K project (<xref ref-type="bibr" rid="bib41">Pf3K Consortium, 2016</xref>; <ext-link ext-link-type="uri" xlink:href="https://www.malariagen.net/data/pf3K-5">https://www.malariagen.net/data/pf3K-5</ext-link>), then calling SNPs in GATK (<xref ref-type="bibr" rid="bib36">McKenna et al., 2010</xref>). Variant calls then represent the pool of mutations present in the infecting <italic>Plasmodium</italic> population rather than SNPs in a single individual. We used only field-collected samples from the ‘analysis’ set, as described in <xref ref-type="bibr" rid="bib40">Pearson et al., 2019</xref>.</p><p>For the <italic>Anopheles</italic> dataset, we ran Locator in 2Mbp windows across the genome with a randomly selected 10% of individuals held out as a test set. We also ran <monospace>SPASIBA</monospace> on subsets sampled from the first five million base pairs of chromosome 2L while varying the number of SNPs from 100 to 100,000. For the <italic>P. falciparum</italic> dataset, we used 500 kb windows and held out 5% of samples from each collection locality as a test set. Last, for humans we used 10Mbp windows and selected three individuals from each HGDP population to hold out as a test set. Window sizes in each case were chosen to include roughly 100,000–200,000 SNPs per window. All empirical analyses were run with default settings (10×256 network size, patience 100, 25% dropout, a random 10% of training samples used for validation).</p><p>We also tested <monospace>Locator’s</monospace> performance with empirical data when the true location is not represented in the training sample. To do this, we ran a series of models on 10,000 SNPs randomly selected from the first 5Mbp of chromosome 2L in the <italic>Anopheles</italic> data. For each run, we held out all samples from a given sampling locality from the training set, then predicted the locations of these individuals using the trained model. We also tested this approach while holding out all samples collected in a given country, which eliminates even nearby localities from the training set.</p></sec><sec id="s4-6"><title>Data and code</title><p>Locator is implemented as a command-line program written in Python: <ext-link ext-link-type="uri" xlink:href="http://www.github.com/kern-lab/locator">www.github.com/kern-lab/locator</ext-link>. SNP calls for the <italic>Anopheles</italic> dataset are available at <ext-link ext-link-type="uri" xlink:href="https://www.malariagen.net/data/ag1000g-phase1-ar3">https://www.malariagen.net/data/ag1000g-phase1-ar3</ext-link>, for <italic>P. falciparum</italic> at <ext-link ext-link-type="uri" xlink:href="https://www.malariagen.net/resource/26">https://www.malariagen.net/resource/26</ext-link>, and for the HGDP at <ext-link ext-link-type="uri" xlink:href="ftp://ngs.sanger.ac.uk/production/hgdp">ftp://ngs.sanger.ac.uk/production/hgdp</ext-link>. Code to run continuous-space simulations can be found at <ext-link ext-link-type="uri" xlink:href="https://github.com/kern-lab/spaceness/blob/master/slim_recipes/spaceness.slim">https://github.com/kern-lab/spaceness/blob/master/slim_recipes/spaceness.slim</ext-link> (<xref ref-type="bibr" rid="bib7">Battey, 2019</xref>). This publication uses data from the MalariaGEN <italic>Plasmodium falciparum</italic> Community Project as described in <xref ref-type="bibr" rid="bib40">Pearson et al., 2019</xref>. Statistical analyses and many plots were produced in R (<xref ref-type="bibr" rid="bib44">R Development Core Team, 2018</xref>).</p></sec></sec></body><back><ack id="ack"><title>Acknowledgements</title><p>We thank members of the Kern-Ralph co-lab, Daniel Schrider, Matthew Hahn, and Ethan Linck for comments and suggestions on this work, and Mara Lawniczak for the suggestion to look at the <italic>Plasmodium</italic> dataset. Comments from reviewers and editors at eLife significantly improved the final version of this study. CJB and ADK were funded by NIH award R01GM117241. PLR was funded in part by an I3 award from the University of Oregon.</p></ack><sec id="s5" sec-type="additional-information"><title>Additional information</title><fn-group content-type="competing-interest"><title>Competing interests</title><fn fn-type="COI-statement" id="conf1"><p>No competing interests declared</p></fn></fn-group><fn-group content-type="author-contribution"><title>Author contributions</title><fn fn-type="con" id="con1"><p>Conceptualization, Resources, Data curation, Software, Formal analysis, Validation, Investigation, Visualization, Methodology, Writing - original draft, Writing - review and editing</p></fn><fn fn-type="con" id="con2"><p>Conceptualization, Formal analysis, Supervision, Investigation, Methodology, Writing - review and editing</p></fn><fn fn-type="con" id="con3"><p>Conceptualization, Software, Supervision, Funding acquisition, Investigation, Methodology, Project administration, Writing - review and editing</p></fn></fn-group></sec><sec id="s6" sec-type="supplementary-material"><title>Additional files</title><supplementary-material id="supp1"><label>Supplementary file 1.</label><caption><title>Validation error in terms of map units and generations of mean population dispersal for Locator runs in simulations with 450 training samples and 100,000 SNPs.</title><p>Note that while absolute error increases along with dispersal rate, it is roughly constant when expressed in terms of generations of mean dispersal.</p></caption><media mime-subtype="octet-stream" mimetype="application" xlink:href="elife-54507-supp1-v2.csv"/></supplementary-material><supplementary-material id="supp2"><label>Supplementary file 2.</label><caption><title>Mean and median prediction error for Locator and SPASIBA run on simulations and Anopheles data as shown in <xref ref-type="fig" rid="fig3">Figure 3</xref>.</title><p>Error is in terms of map units for simulated data (total landscape width = 50).</p></caption><media mime-subtype="octet-stream" mimetype="application" xlink:href="elife-54507-supp2-v2.csv"/></supplementary-material><supplementary-material id="supp3"><label>Supplementary file 3.</label><caption><title>Test error for windowed analyses of empirical datasets using the location with highest kernel density and the centroid of per-window predictions, as <italic>median (90% interval)</italic>.</title></caption><media mime-subtype="octet-stream" mimetype="application" xlink:href="elife-54507-supp3-v2.csv"/></supplementary-material><supplementary-material id="transrepform"><label>Transparent reporting form</label><media mime-subtype="docx" mimetype="application" xlink:href="elife-54507-transrepform-v2.docx"/></supplementary-material></sec><sec id="s7" sec-type="data-availability"><title>Data availability</title><p>Locator is implemented as a command-line program written in Python: <ext-link ext-link-type="uri" xlink:href="http://www.github.com/kern-lab/locator">www.github.com/kern-lab/locator</ext-link>. SNP calls for the Anopheles dataset are available at <ext-link ext-link-type="uri" xlink:href="https://www.malariagen.net/data/ag1000g-phase1-ar3">https://www.malariagen.net/data/ag1000g-phase1-ar3</ext-link>, for <italic>P. falciparum</italic> at <ext-link ext-link-type="uri" xlink:href="https://www.malariagen.net/resource/26">https://www.malariagen.net/resource/26</ext-link>, and for the HGDP at <ext-link ext-link-type="uri" xlink:href="ftp://ngs.sanger.ac.uk/production/hgdp">ftp://ngs.sanger.ac.uk/production/hgdp</ext-link>. Code to run continuous-space simulations can be found at <ext-link ext-link-type="uri" xlink:href="https://github.com/kern-lab/spaceness/blob/master/slim_recipes/spaceness.slim">https://github.com/kern-lab/spaceness/blob/master/slim_recipes/spaceness.slim</ext-link>. This publication uses data from the MalariaGEN Plasmodium falciparum Community Project as described in Pearson et al. (2019). Statistical analyses and many plots were produced in R (R Core Team, 2018).</p><p>The following previously published datasets were used:</p><p><element-citation id="dataset1" publication-type="data" specific-use="references"><person-group person-group-type="author"><collab>The Anopheles gambiae 1000 Genomes Consortium</collab></person-group><year iso-8601-date="2015">2015</year><data-title>Ag1000G phase 1 AR3 data release</data-title><source>MalariaGEN</source><pub-id assigning-authority="other" pub-id-type="accession" xlink:href="https://www.malariagen.net/data/ag1000g-phase1-ar3">ag1000g-phase1-AR3</pub-id></element-citation></p><p><element-citation id="dataset2" publication-type="data" specific-use="references"><person-group person-group-type="author"><collab>Plasmodium facliparum community project</collab></person-group><year iso-8601-date="2019">2019</year><data-title>Plasmodium falciparum community project version 6 data release</data-title><source>MalariaGEN</source><pub-id assigning-authority="other" pub-id-type="accession" xlink:href="https://www.malariagen.net/resource/26">26</pub-id></element-citation></p><p><element-citation id="dataset3" publication-type="data" specific-use="references"><person-group person-group-type="author"><name><surname>Bergström</surname><given-names>A</given-names></name><name><surname>McCarthy</surname><given-names>SA</given-names></name><name><surname>Hui</surname><given-names>R</given-names></name><name><surname>Almarri</surname><given-names>MA</given-names></name><name><surname>Ayub</surname><given-names>Q</given-names></name><name><surname>Danecek</surname><given-names>P</given-names></name><name><surname>Chen</surname><given-names>Y</given-names></name><name><surname>Felkel</surname><given-names>S</given-names></name><name><surname>Hallast</surname><given-names>P</given-names></name><name><surname>Kamm</surname><given-names>J</given-names></name><name><surname>Blanché</surname><given-names>H</given-names></name><name><surname>Deleuze</surname><given-names>JF</given-names></name><name><surname>Cann</surname><given-names>H</given-names></name><name><surname>Mallick</surname><given-names>S</given-names></name><name><surname>Reich</surname><given-names>D</given-names></name><name><surname>Sandhu</surname><given-names>DA</given-names></name><name><surname>Skoglund</surname><given-names>P</given-names></name><name><surname>Scally</surname><given-names>A</given-names></name><name><surname>Xue</surname><given-names>Y</given-names></name><name><surname>Durbin</surname><given-names>R</given-names></name><name><surname>Smith</surname><given-names>CT</given-names></name></person-group><year iso-8601-date="2019">2019</year><data-title>Insights into human genetic variation and population history from 929 diverse genomes</data-title><source>HGDP</source><pub-id assigning-authority="other" pub-id-type="accession" xlink:href="ftp://ngs.sanger.ac.uk/production/hgdp">hgdp</pub-id></element-citation></p></sec><ref-list><title>References</title><ref id="bib1"><element-citation publication-type="preprint"><person-group person-group-type="author"><name><surname>Abadi</surname> <given-names>M</given-names></name><name><surname>Agarwal</surname> <given-names>A</given-names></name><name><surname>Barham</surname> <given-names>P</given-names></name><name><surname>Brevdo</surname> <given-names>E</given-names></name><name><surname>Chen</surname> <given-names>Z</given-names></name><name><surname>Citro</surname> <given-names>C</given-names></name><name><surname>Corrado</surname> <given-names>GS</given-names></name><name><surname>Davis</surname> <given-names>A</given-names></name><name><surname>Dean</surname> <given-names>J</given-names></name><name><surname>Devin</surname> <given-names>M</given-names></name><name><surname>Ghemawat</surname> <given-names>S</given-names></name><name><surname>Goodfellow</surname> <given-names>I</given-names></name><name><surname>Harp</surname> <given-names>A</given-names></name><name><surname>Irving</surname> <given-names>G</given-names></name><name><surname>Isard</surname> <given-names>M</given-names></name><name><surname>Jia</surname> <given-names>Y</given-names></name><name><surname>Jozefowicz</surname> <given-names>R</given-names></name><name><surname>Kaiser</surname> <given-names>L</given-names></name><name><surname>Kudlur</surname> <given-names>M</given-names></name><name><surname>Levenberg</surname> <given-names>J</given-names></name><name><surname>Mané</surname> <given-names>D</given-names></name><name><surname>Monga</surname> <given-names>R</given-names></name><name><surname>Moore</surname> <given-names>S</given-names></name><name><surname>Murray</surname> <given-names>D</given-names></name><name><surname>Olah</surname> <given-names>C</given-names></name><name><surname>Schuster</surname> <given-names>M</given-names></name><name><surname>Shlens</surname> <given-names>J</given-names></name><name><surname>Steiner</surname> <given-names>B</given-names></name><name><surname>Sutskever</surname> <given-names>I</given-names></name><name><surname>Talwar</surname> <given-names>K</given-names></name><name><surname>Tucker</surname> <given-names>P</given-names></name><name><surname>Vanhoucke</surname> <given-names>V</given-names></name><name><surname>Vasudevan</surname> <given-names>V</given-names></name><name><surname>Viégas</surname> <given-names>F</given-names></name><name><surname>Vinyals</surname> <given-names>O</given-names></name><name><surname>Warden</surname> <given-names>P</given-names></name><name><surname>Wattenberg</surname> <given-names>M</given-names></name><name><surname>Wicke</surname> <given-names>M</given-names></name><name><surname>Yu</surname> <given-names>Y</given-names></name><name><surname>Zheng</surname> <given-names>X</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>TensorFlow: large-scale machine learning on heterogeneous systems</article-title><source>arXiv</source><ext-link ext-link-type="uri" xlink:href="https://arxiv.org/abs/1603.04467">https://arxiv.org/abs/1603.04467</ext-link></element-citation></ref><ref id="bib2"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Adrion</surname> <given-names>JR</given-names></name><name><surname>Galloway</surname> <given-names>JG</given-names></name><name><surname>Kern</surname> <given-names>AD</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>Predicting the landscape of recombination using deep learning</article-title><source>Molecular Biology and Evolution</source><volume>37</volume><fpage>1790</fpage><lpage>1808</lpage><pub-id pub-id-type="doi">10.1093/molbev/msaa038</pub-id><pub-id pub-id-type="pmid">32077950</pub-id></element-citation></ref><ref id="bib3"><element-citation publication-type="journal"><person-group person-group-type="author"><collab>Anopheles gambiae 1000 Genomes Consortium</collab><collab>Data analysis group</collab><collab>Partner working group</collab><collab>Sample collections—Angola:</collab><collab>Burkina Faso:</collab><collab>Cameroon:</collab><collab>Gabon:</collab><collab>Guinea:</collab><collab>Guinea-Bissau:</collab><collab>Kenya:</collab><collab>Uganda:</collab><collab>Crosses:</collab><collab>Sequencing and data production</collab><collab>Web application development</collab><collab>Project coordination</collab></person-group><year iso-8601-date="2017">2017</year><article-title>Genetic diversity of the African malaria vector anopheles gambiae</article-title><source>Nature</source><volume>552</volume><fpage>96</fpage><lpage>100</lpage><pub-id pub-id-type="doi">10.1038/nature24995</pub-id><pub-id pub-id-type="pmid">29186111</pub-id></element-citation></ref><ref id="bib4"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Auburn</surname> <given-names>S</given-names></name><name><surname>Campino</surname> <given-names>S</given-names></name><name><surname>Miotto</surname> <given-names>O</given-names></name><name><surname>Djimde</surname> <given-names>AA</given-names></name><name><surname>Zongo</surname> <given-names>I</given-names></name><name><surname>Manske</surname> <given-names>M</given-names></name><name><surname>Maslen</surname> <given-names>G</given-names></name><name><surname>Mangano</surname> <given-names>V</given-names></name><name><surname>Alcock</surname> <given-names>D</given-names></name><name><surname>MacInnis</surname> <given-names>B</given-names></name><name><surname>Rockett</surname> <given-names>KA</given-names></name><name><surname>Clark</surname> <given-names>TG</given-names></name><name><surname>Doumbo</surname> <given-names>OK</given-names></name><name><surname>Ouédraogo</surname> <given-names>JB</given-names></name><name><surname>Kwiatkowski</surname> <given-names>DP</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Characterization of within-host <italic>Plasmodium falciparum</italic> diversity using next-generation sequence data</article-title><source>PLOS ONE</source><volume>7</volume><elocation-id>e32891</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pone.0032891</pub-id><pub-id pub-id-type="pmid">22393456</pub-id></element-citation></ref><ref id="bib5"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Baran</surname> <given-names>Y</given-names></name><name><surname>Quintela</surname> <given-names>I</given-names></name><name><surname>Carracedo</surname> <given-names>A</given-names></name><name><surname>Pasaniuc</surname> <given-names>B</given-names></name><name><surname>Halperin</surname> <given-names>E</given-names></name></person-group><year iso-8601-date="2013">2013</year><article-title>Enhanced localization of genetic samples through linkage-disequilibrium correction</article-title><source>The American Journal of Human Genetics</source><volume>92</volume><fpage>882</fpage><lpage>894</lpage><pub-id pub-id-type="doi">10.1016/j.ajhg.2013.04.023</pub-id><pub-id pub-id-type="pmid">23726367</pub-id></element-citation></ref><ref id="bib6"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Battey</surname> <given-names>CJ</given-names></name><name><surname>Linck</surname> <given-names>EB</given-names></name><name><surname>Epperly</surname> <given-names>KL</given-names></name><name><surname>French</surname> <given-names>C</given-names></name><name><surname>Slager</surname> <given-names>DL</given-names></name><name><surname>Sykes</surname> <given-names>PW</given-names></name><name><surname>Klicka</surname> <given-names>J</given-names></name></person-group><year iso-8601-date="2018">2018</year><article-title>A migratory divide in the painted bunting (<italic>Passerina ciris</italic>)</article-title><source>The American Naturalist</source><volume>191</volume><fpage>259</fpage><lpage>268</lpage><pub-id pub-id-type="doi">10.1086/695439</pub-id><pub-id pub-id-type="pmid">29351011</pub-id></element-citation></ref><ref id="bib7"><element-citation publication-type="preprint"><person-group person-group-type="author"><name><surname>Battey</surname> <given-names>CJ</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Space is the place: effects of continuous spatial structure on analysis of population genetic data</article-title><source>bioRxiv</source><pub-id pub-id-type="doi">10.1101/659235</pub-id></element-citation></ref><ref id="bib8"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Bergström</surname> <given-names>A</given-names></name><name><surname>McCarthy</surname> <given-names>SA</given-names></name><name><surname>Hui</surname> <given-names>R</given-names></name><name><surname>Almarri</surname> <given-names>MA</given-names></name><name><surname>Ayub</surname> <given-names>Q</given-names></name><name><surname>Danecek</surname> <given-names>P</given-names></name><name><surname>Chen</surname> <given-names>Y</given-names></name><name><surname>Felkel</surname> <given-names>S</given-names></name><name><surname>Hallast</surname> <given-names>P</given-names></name><name><surname>Kamm</surname> <given-names>J</given-names></name><name><surname>Blanché</surname> <given-names>H</given-names></name><name><surname>Deleuze</surname> <given-names>JF</given-names></name><name><surname>Cann</surname> <given-names>H</given-names></name><name><surname>Mallick</surname> <given-names>S</given-names></name><name><surname>Reich</surname> <given-names>D</given-names></name><name><surname>Sandhu</surname> <given-names>MS</given-names></name><name><surname>Skoglund</surname> <given-names>P</given-names></name><name><surname>Scally</surname> <given-names>A</given-names></name><name><surname>Xue</surname> <given-names>Y</given-names></name><name><surname>Durbin</surname> <given-names>R</given-names></name><name><surname>Tyler-Smith</surname> <given-names>C</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>Insights into human genetic variation and population history from 929 diverse genomes</article-title><source>Science</source><volume>367</volume><elocation-id>eaay5012</elocation-id><pub-id pub-id-type="doi">10.1126/science.aay5012</pub-id><pub-id pub-id-type="pmid">32193295</pub-id></element-citation></ref><ref id="bib9"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Bhaskar</surname> <given-names>A</given-names></name><name><surname>Javanmard</surname> <given-names>A</given-names></name><name><surname>Courtade</surname> <given-names>TA</given-names></name><name><surname>Tse</surname> <given-names>D</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Novel probabilistic models of spatial genetic ancestry with applications to stratification correction in genome-wide association studies</article-title><source>Bioinformatics</source><volume>22</volume><elocation-id>btw720</elocation-id><pub-id pub-id-type="doi">10.1093/bioinformatics/btw720</pub-id></element-citation></ref><ref id="bib10"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Bradburd</surname> <given-names>GS</given-names></name><name><surname>Ralph</surname> <given-names>PL</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Spatial population genetics: it's about time</article-title><source>Annual Review of Ecology, Evolution, and Systematics</source><volume>50</volume><fpage>427</fpage><lpage>449</lpage><pub-id pub-id-type="doi">10.1146/annurev-ecolsys-110316-022659</pub-id></element-citation></ref><ref id="bib11"><element-citation publication-type="preprint"><person-group person-group-type="author"><name><surname>Breidenbach</surname> <given-names>N</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Assignment of frost tolerant coast redwood trees of unknown origin to populations within their natural range using nuclear and chloroplast microsatellite genetic markers</article-title><source>bioRxiv</source><pub-id pub-id-type="doi">10.1101/732834</pub-id></element-citation></ref><ref id="bib12"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Breiman</surname> <given-names>L</given-names></name></person-group><year iso-8601-date="1996">1996</year><article-title>Bagging predictors</article-title><source>Machine Learning</source><volume>24</volume><fpage>123</fpage><lpage>140</lpage><pub-id pub-id-type="doi">10.1007/BF00058655</pub-id></element-citation></ref><ref id="bib13"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Bryk</surname> <given-names>J</given-names></name><name><surname>Hardouin</surname> <given-names>E</given-names></name><name><surname>Pugach</surname> <given-names>I</given-names></name><name><surname>Hughes</surname> <given-names>D</given-names></name><name><surname>Strotmann</surname> <given-names>R</given-names></name><name><surname>Stoneking</surname> <given-names>M</given-names></name><name><surname>Myles</surname> <given-names>S</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>Positive selection in east asians for an EDAR allele that enhances NF-kappaB activation</article-title><source>PLOS ONE</source><volume>3</volume><elocation-id>e2209</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pone.0002209</pub-id><pub-id pub-id-type="pmid">18493316</pub-id></element-citation></ref><ref id="bib14"><element-citation publication-type="confproc"><person-group person-group-type="author"><name><surname>Chan</surname> <given-names>J</given-names></name><name><surname>Perrone</surname> <given-names>V</given-names></name><name><surname>Spence</surname> <given-names>J</given-names></name><name><surname>Jenkins</surname> <given-names>P</given-names></name><name><surname>Mathieson</surname> <given-names>S</given-names></name><name><surname>Song</surname> <given-names>Y</given-names></name></person-group><year iso-8601-date="2018">2018</year><article-title>A likelihood-free inference framework for population genetic data using exchangeable neural networks</article-title><conf-name>Neural Information Processing Systems</conf-name><fpage>8594</fpage><lpage>8605</lpage></element-citation></ref><ref id="bib15"><element-citation publication-type="software"><person-group person-group-type="author"><name><surname>Chollet</surname> <given-names>F</given-names></name></person-group><year iso-8601-date="2015">2015</year><data-title>Keras</data-title><publisher-name>Google</publisher-name><ext-link ext-link-type="uri" xlink:href="https://keras.io">https://keras.io</ext-link></element-citation></ref><ref id="bib16"><element-citation publication-type="preprint"><person-group person-group-type="author"><name><surname>Clevert</surname> <given-names>D-A</given-names></name><name><surname>Unterthiner</surname> <given-names>T</given-names></name><name><surname>Hochreiter</surname> <given-names>S</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>Fast and accurate deep network learning by exponential linear units (ELUs)</article-title><source>arXiv</source><ext-link ext-link-type="uri" xlink:href="https://arxiv.org/abs/1511.07289">https://arxiv.org/abs/1511.07289</ext-link></element-citation></ref><ref id="bib17"><element-citation publication-type="preprint"><person-group person-group-type="author"><name><surname>Cong</surname> <given-names>Q</given-names></name><name><surname>Shen</surname> <given-names>J</given-names></name><name><surname>Zhang</surname> <given-names>J</given-names></name><name><surname>Li</surname> <given-names>W</given-names></name><name><surname>Kinch</surname> <given-names>LN</given-names></name><name><surname>Calhoun</surname> <given-names>JV</given-names></name><name><surname>Warren</surname> <given-names>AD</given-names></name><name><surname>Grishin</surname> <given-names>NV</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Genomics reveals the origins of ancient specimens</article-title><source>bioRxiv</source><pub-id pub-id-type="doi">10.1101/752121</pub-id></element-citation></ref><ref id="bib18"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>de Filippo</surname> <given-names>C</given-names></name><name><surname>Bostoen</surname> <given-names>K</given-names></name><name><surname>Stoneking</surname> <given-names>M</given-names></name><name><surname>Pakendorf</surname> <given-names>B</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Bringing together linguistic and genetic evidence to test the bantu expansion</article-title><source>Proceedings of the Royal Society B: Biological Sciences</source><volume>279</volume><fpage>3256</fpage><lpage>3263</lpage><pub-id pub-id-type="doi">10.1098/rspb.2012.0318</pub-id></element-citation></ref><ref id="bib19"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Durvasula</surname> <given-names>A</given-names></name><name><surname>Sankararaman</surname> <given-names>S</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>A statistical model for reference-free inference of archaic local ancestry</article-title><source>PLOS Genetics</source><volume>15</volume><elocation-id>e1008175</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pgen.1008175</pub-id><pub-id pub-id-type="pmid">31136573</pub-id></element-citation></ref><ref id="bib20"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Etter</surname> <given-names>PD</given-names></name><name><surname>Bassham</surname> <given-names>S</given-names></name><name><surname>Hohenlohe</surname> <given-names>PA</given-names></name></person-group><year iso-8601-date="2012">2012</year><chapter-title>SNP discovery and genotyping for evolutionary genetics using RAD sequencing</chapter-title><person-group person-group-type="editor"><name><surname>Johnson</surname> <given-names>E. A</given-names></name><name><surname>Cresko</surname> <given-names>W. A</given-names></name></person-group><source>Molecular Methods for Evolutionary Genetics</source><publisher-name>Springer</publisher-name><fpage>157</fpage><lpage>178</lpage><pub-id pub-id-type="doi">10.1007/978-1-61779-228-1</pub-id></element-citation></ref><ref id="bib21"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Flagel</surname> <given-names>L</given-names></name><name><surname>Brandvain</surname> <given-names>Y</given-names></name><name><surname>Schrider</surname> <given-names>DR</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>The unreasonable effectiveness of convolutional neural networks in population genetic inference</article-title><source>Molecular Biology and Evolution</source><volume>36</volume><fpage>220</fpage><lpage>238</lpage><pub-id pub-id-type="doi">10.1093/molbev/msy224</pub-id><pub-id pub-id-type="pmid">30517664</pub-id></element-citation></ref><ref id="bib22"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Fujimoto</surname> <given-names>A</given-names></name><name><surname>Kimura</surname> <given-names>R</given-names></name><name><surname>Ohashi</surname> <given-names>J</given-names></name><name><surname>Omi</surname> <given-names>K</given-names></name><name><surname>Yuliwulandari</surname> <given-names>R</given-names></name><name><surname>Batubara</surname> <given-names>L</given-names></name><name><surname>Mustofa</surname> <given-names>MS</given-names></name><name><surname>Samakkarn</surname> <given-names>U</given-names></name><name><surname>Settheetham-Ishida</surname> <given-names>W</given-names></name><name><surname>Ishida</surname> <given-names>T</given-names></name><name><surname>Morishita</surname> <given-names>Y</given-names></name><name><surname>Furusawa</surname> <given-names>T</given-names></name><name><surname>Nakazawa</surname> <given-names>M</given-names></name><name><surname>Ohtsuka</surname> <given-names>R</given-names></name><name><surname>Tokunaga</surname> <given-names>K</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>A scan for genetic determinants of human hair morphology: edar is associated with asian hair thickness</article-title><source>Human Molecular Genetics</source><volume>17</volume><fpage>835</fpage><lpage>843</lpage><pub-id pub-id-type="doi">10.1093/hmg/ddm355</pub-id><pub-id pub-id-type="pmid">18065779</pub-id></element-citation></ref><ref id="bib23"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Gorelova</surname> <given-names>LM</given-names></name></person-group><year iso-8601-date="2002">2002</year><source>Manchu Grammar</source><publisher-name>Brill</publisher-name></element-citation></ref><ref id="bib24"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Guillot</surname> <given-names>G</given-names></name><name><surname>Jónsson</surname> <given-names>H</given-names></name><name><surname>Hinge</surname> <given-names>A</given-names></name><name><surname>Manchih</surname> <given-names>N</given-names></name><name><surname>Orlando</surname> <given-names>L</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Accurate continuous geographic assignment from low- to high-density SNP data</article-title><source>Bioinformatics</source><volume>32</volume><fpage>1106</fpage><lpage>1108</lpage><pub-id pub-id-type="doi">10.1093/bioinformatics/btv703</pub-id><pub-id pub-id-type="pmid">26615214</pub-id></element-citation></ref><ref id="bib25"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Haller</surname> <given-names>BC</given-names></name><name><surname>Messer</surname> <given-names>PW</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>SLiM 3: forward genetic simulations beyond the Wright-Fisher model</article-title><source>Molecular Biology and Evolution</source><volume>36</volume><fpage>632</fpage><lpage>637</lpage><pub-id pub-id-type="doi">10.1093/molbev/msy228</pub-id><pub-id pub-id-type="pmid">30517680</pub-id></element-citation></ref><ref id="bib26"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Harry</surname> <given-names>D</given-names></name><name><surname>Marks</surname> <given-names>J</given-names></name></person-group><year iso-8601-date="1999">1999</year><article-title>Human population genetics versus the HGDP</article-title><source>Politics and the Life Sciences</source><volume>18</volume><fpage>303</fpage><lpage>305</lpage><pub-id pub-id-type="doi">10.1017/S0730938400021535</pub-id><pub-id pub-id-type="pmid">12557896</pub-id></element-citation></ref><ref id="bib27"><element-citation publication-type="confproc"><person-group person-group-type="author"><name><surname>Ho</surname> <given-names>TK</given-names></name><name><surname>forests</surname> <given-names>R</given-names></name></person-group><year iso-8601-date="1995">1995</year><article-title>Proceedings of 3rd international conference on document analysis and recognition</article-title><conf-name>IEEE</conf-name><fpage>278</fpage><lpage>282</lpage><pub-id pub-id-type="doi">10.1109/ICDAR.1995.598929</pub-id></element-citation></ref><ref id="bib28"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Huestis</surname> <given-names>DL</given-names></name><name><surname>Dao</surname> <given-names>A</given-names></name><name><surname>Diallo</surname> <given-names>M</given-names></name><name><surname>Sanogo</surname> <given-names>ZL</given-names></name><name><surname>Samake</surname> <given-names>D</given-names></name><name><surname>Yaro</surname> <given-names>AS</given-names></name><name><surname>Ousman</surname> <given-names>Y</given-names></name><name><surname>Linton</surname> <given-names>YM</given-names></name><name><surname>Krishna</surname> <given-names>A</given-names></name><name><surname>Veru</surname> <given-names>L</given-names></name><name><surname>Krajacich</surname> <given-names>BJ</given-names></name><name><surname>Faiman</surname> <given-names>R</given-names></name><name><surname>Florio</surname> <given-names>J</given-names></name><name><surname>Chapman</surname> <given-names>JW</given-names></name><name><surname>Reynolds</surname> <given-names>DR</given-names></name><name><surname>Weetman</surname> <given-names>D</given-names></name><name><surname>Mitchell</surname> <given-names>R</given-names></name><name><surname>Donnelly</surname> <given-names>MJ</given-names></name><name><surname>Talamas</surname> <given-names>E</given-names></name><name><surname>Chamorro</surname> <given-names>L</given-names></name><name><surname>Strobach</surname> <given-names>E</given-names></name><name><surname>Lehmann</surname> <given-names>T</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Windborne long-distance migration of malaria mosquitoes in the sahel</article-title><source>Nature</source><volume>574</volume><fpage>404</fpage><lpage>408</lpage><pub-id pub-id-type="doi">10.1038/s41586-019-1622-4</pub-id><pub-id pub-id-type="pmid">31578527</pub-id></element-citation></ref><ref id="bib29"><element-citation publication-type="journal"><person-group person-group-type="author"><collab>International HapMap Consortium</collab></person-group><year iso-8601-date="2003">2003</year><article-title>The international HapMap project</article-title><source>Nature</source><volume>426</volume><fpage>789</fpage><lpage>796</lpage><pub-id pub-id-type="doi">10.1038/nature02168</pub-id><pub-id pub-id-type="pmid">14685227</pub-id></element-citation></ref><ref id="bib30"><element-citation publication-type="preprint"><person-group person-group-type="author"><name><surname>Ioffe</surname> <given-names>S</given-names></name><name><surname>Szegedy</surname> <given-names>C</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>Batch normalization: accelerating deep network training by reducing internal covariate shift</article-title><source>arXiv</source><ext-link ext-link-type="uri" xlink:href="https://arxiv.org/abs/1502.03167">https://arxiv.org/abs/1502.03167</ext-link></element-citation></ref><ref id="bib31"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Jombart</surname> <given-names>T</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>adegenet: a R package for the multivariate analysis of genetic markers</article-title><source>Bioinformatics</source><volume>24</volume><fpage>1403</fpage><lpage>1405</lpage><pub-id pub-id-type="doi">10.1093/bioinformatics/btn129</pub-id></element-citation></ref><ref id="bib32"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kelleher</surname> <given-names>J</given-names></name><name><surname>Etheridge</surname> <given-names>AM</given-names></name><name><surname>Véber</surname> <given-names>A</given-names></name><name><surname>Barton</surname> <given-names>NH</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Spread of pedigree versus genetic ancestry in spatially distributed populations</article-title><source>Theoretical Population Biology</source><volume>108</volume><fpage>1</fpage><lpage>12</lpage><pub-id pub-id-type="doi">10.1016/j.tpb.2015.10.008</pub-id><pub-id pub-id-type="pmid">26546979</pub-id></element-citation></ref><ref id="bib33"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kern</surname> <given-names>AD</given-names></name><name><surname>Schrider</surname> <given-names>DR</given-names></name></person-group><year iso-8601-date="2018">2018</year><article-title>diploS/HIC: an updated approach to classifying selective sweeps</article-title><source>G3: Genes, Genomes, Genetics</source><volume>8</volume><fpage>1959</fpage><lpage>1970</lpage><pub-id pub-id-type="doi">10.1534/g3.118.200262</pub-id></element-citation></ref><ref id="bib34"><element-citation publication-type="preprint"><person-group person-group-type="author"><name><surname>Kingma</surname> <given-names>DP</given-names></name><name><surname>Ba</surname> <given-names>J</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Adam: a method for stochastic optimization</article-title><source>arXiv</source><ext-link ext-link-type="uri" xlink:href="https://arxiv.org/abs/1412.6980">https://arxiv.org/abs/1412.6980</ext-link></element-citation></ref><ref id="bib35"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Lawson</surname> <given-names>DJ</given-names></name><name><surname>Hellenthal</surname> <given-names>G</given-names></name><name><surname>Myers</surname> <given-names>S</given-names></name><name><surname>Falush</surname> <given-names>D</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Inference of population structure using dense haplotype data</article-title><source>PLOS Genetics</source><volume>8</volume><elocation-id>e1002453</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pgen.1002453</pub-id><pub-id pub-id-type="pmid">22291602</pub-id></element-citation></ref><ref id="bib36"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>McKenna</surname> <given-names>A</given-names></name><name><surname>Hanna</surname> <given-names>M</given-names></name><name><surname>Banks</surname> <given-names>E</given-names></name><name><surname>Sivachenko</surname> <given-names>A</given-names></name><name><surname>Cibulskis</surname> <given-names>K</given-names></name><name><surname>Kernytsky</surname> <given-names>A</given-names></name><name><surname>Garimella</surname> <given-names>K</given-names></name><name><surname>Altshuler</surname> <given-names>D</given-names></name><name><surname>Gabriel</surname> <given-names>S</given-names></name><name><surname>Daly</surname> <given-names>M</given-names></name><name><surname>DePristo</surname> <given-names>MA</given-names></name></person-group><year iso-8601-date="2010">2010</year><article-title>The genome analysis toolkit: a MapReduce framework for analyzing next-generation DNA sequencing data</article-title><source>Genome Research</source><volume>20</volume><fpage>1297</fpage><lpage>1303</lpage><pub-id pub-id-type="doi">10.1101/gr.107524.110</pub-id><pub-id pub-id-type="pmid">20644199</pub-id></element-citation></ref><ref id="bib37"><element-citation publication-type="software"><person-group person-group-type="author"><name><surname>Miles</surname> <given-names>A</given-names></name><name><surname>Harding</surname> <given-names>N</given-names></name></person-group><year iso-8601-date="2017">2017</year><data-title>Cggh/scikit-allel</data-title><source>Zenodo</source><version designator="1.1">v1.1</version><ext-link ext-link-type="uri" xlink:href="https://doi.org/10.5281/zenodo.822784">https://doi.org/10.5281/zenodo.822784</ext-link></element-citation></ref><ref id="bib38"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Miotto</surname> <given-names>O</given-names></name><name><surname>Almagro-Garcia</surname> <given-names>J</given-names></name><name><surname>Manske</surname> <given-names>M</given-names></name><name><surname>Macinnis</surname> <given-names>B</given-names></name><name><surname>Campino</surname> <given-names>S</given-names></name><name><surname>Rockett</surname> <given-names>KA</given-names></name><name><surname>Amaratunga</surname> <given-names>C</given-names></name><name><surname>Lim</surname> <given-names>P</given-names></name><name><surname>Suon</surname> <given-names>S</given-names></name><name><surname>Sreng</surname> <given-names>S</given-names></name><name><surname>Anderson</surname> <given-names>JM</given-names></name><name><surname>Duong</surname> <given-names>S</given-names></name><name><surname>Nguon</surname> <given-names>C</given-names></name><name><surname>Chuor</surname> <given-names>CM</given-names></name><name><surname>Saunders</surname> <given-names>D</given-names></name><name><surname>Se</surname> <given-names>Y</given-names></name><name><surname>Lon</surname> <given-names>C</given-names></name><name><surname>Fukuda</surname> <given-names>MM</given-names></name><name><surname>Amenga-Etego</surname> <given-names>L</given-names></name><name><surname>Hodgson</surname> <given-names>AV</given-names></name><name><surname>Asoala</surname> <given-names>V</given-names></name><name><surname>Imwong</surname> <given-names>M</given-names></name><name><surname>Takala-Harrison</surname> <given-names>S</given-names></name><name><surname>Nosten</surname> <given-names>F</given-names></name><name><surname>Su</surname> <given-names>XZ</given-names></name><name><surname>Ringwald</surname> <given-names>P</given-names></name><name><surname>Ariey</surname> <given-names>F</given-names></name><name><surname>Dolecek</surname> <given-names>C</given-names></name><name><surname>Hien</surname> <given-names>TT</given-names></name><name><surname>Boni</surname> <given-names>MF</given-names></name><name><surname>Thai</surname> <given-names>CQ</given-names></name><name><surname>Amambua-Ngwa</surname> <given-names>A</given-names></name><name><surname>Conway</surname> <given-names>DJ</given-names></name><name><surname>Djimdé</surname> <given-names>AA</given-names></name><name><surname>Doumbo</surname> <given-names>OK</given-names></name><name><surname>Zongo</surname> <given-names>I</given-names></name><name><surname>Ouedraogo</surname> <given-names>JB</given-names></name><name><surname>Alcock</surname> <given-names>D</given-names></name><name><surname>Drury</surname> <given-names>E</given-names></name><name><surname>Auburn</surname> <given-names>S</given-names></name><name><surname>Koch</surname> <given-names>O</given-names></name><name><surname>Sanders</surname> <given-names>M</given-names></name><name><surname>Hubbart</surname> <given-names>C</given-names></name><name><surname>Maslen</surname> <given-names>G</given-names></name><name><surname>Ruano-Rubio</surname> <given-names>V</given-names></name><name><surname>Jyothi</surname> <given-names>D</given-names></name><name><surname>Miles</surname> <given-names>A</given-names></name><name><surname>O'Brien</surname> <given-names>J</given-names></name><name><surname>Gamble</surname> <given-names>C</given-names></name><name><surname>Oyola</surname> <given-names>SO</given-names></name><name><surname>Rayner</surname> <given-names>JC</given-names></name><name><surname>Newbold</surname> <given-names>CI</given-names></name><name><surname>Berriman</surname> <given-names>M</given-names></name><name><surname>Spencer</surname> <given-names>CC</given-names></name><name><surname>McVean</surname> <given-names>G</given-names></name><name><surname>Day</surname> <given-names>NP</given-names></name><name><surname>White</surname> <given-names>NJ</given-names></name><name><surname>Bethell</surname> <given-names>D</given-names></name><name><surname>Dondorp</surname> <given-names>AM</given-names></name><name><surname>Plowe</surname> <given-names>CV</given-names></name><name><surname>Fairhurst</surname> <given-names>RM</given-names></name><name><surname>Kwiatkowski</surname> <given-names>DP</given-names></name></person-group><year iso-8601-date="2013">2013</year><article-title>Multiple populations of artemisinin-resistant <italic>Plasmodium falciparum</italic> in Cambodia</article-title><source>Nature Genetics</source><volume>45</volume><fpage>648</fpage><lpage>655</lpage><pub-id pub-id-type="doi">10.1038/ng.2624</pub-id><pub-id pub-id-type="pmid">23624527</pub-id></element-citation></ref><ref id="bib39"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Mughal</surname> <given-names>MR</given-names></name><name><surname>DeGiorgio</surname> <given-names>M</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Localizing and classifying adaptive targets with trend filtered regression</article-title><source>Molecular Biology and Evolution</source><volume>36</volume><fpage>252</fpage><lpage>270</lpage><pub-id pub-id-type="doi">10.1093/molbev/msy205</pub-id><pub-id pub-id-type="pmid">30398642</pub-id></element-citation></ref><ref id="bib40"><element-citation publication-type="preprint"><person-group person-group-type="author"><name><surname>Pearson</surname> <given-names>RD</given-names></name><name><surname>Amato</surname> <given-names>R</given-names></name><name><surname>Kwiatkowski</surname> <given-names>DP</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>An open dataset of <italic>Plasmodium falciparum</italic> genome variation in 7,000 worldwide samples</article-title><source>bioRxiv</source><pub-id pub-id-type="doi">10.1101/824730</pub-id></element-citation></ref><ref id="bib41"><element-citation publication-type="software"><person-group person-group-type="author"><collab>Pf3K Consortium</collab></person-group><year iso-8601-date="2016">2016</year><data-title>The Pf3K project (2016)</data-title><source>Pilot Data Release 5, 2016</source><version designator="5.0">5.0</version><ext-link ext-link-type="uri" xlink:href="https://www.malariagen.net/data/pf3k-5">https://www.malariagen.net/data/pf3k-5</ext-link></element-citation></ref><ref id="bib42"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Pudlo</surname> <given-names>P</given-names></name><name><surname>Marin</surname> <given-names>JM</given-names></name><name><surname>Estoup</surname> <given-names>A</given-names></name><name><surname>Cornuet</surname> <given-names>JM</given-names></name><name><surname>Gautier</surname> <given-names>M</given-names></name><name><surname>Robert</surname> <given-names>CP</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Reliable ABC model choice via random forests</article-title><source>Bioinformatics</source><volume>32</volume><fpage>859</fpage><lpage>866</lpage><pub-id pub-id-type="doi">10.1093/bioinformatics/btv684</pub-id><pub-id pub-id-type="pmid">26589278</pub-id></element-citation></ref><ref id="bib43"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Qamar</surname> <given-names>R</given-names></name><name><surname>Ayub</surname> <given-names>Q</given-names></name><name><surname>Mohyuddin</surname> <given-names>A</given-names></name><name><surname>Helgason</surname> <given-names>A</given-names></name><name><surname>Mazhar</surname> <given-names>K</given-names></name><name><surname>Mansoor</surname> <given-names>A</given-names></name><name><surname>Zerjal</surname> <given-names>T</given-names></name><name><surname>Tyler-Smith</surname> <given-names>C</given-names></name><name><surname>Mehdi</surname> <given-names>SQ</given-names></name><name><surname>Qasim Mehdi</surname> <given-names>S</given-names></name></person-group><year iso-8601-date="2002">2002</year><article-title>Y-Chromosomal DNA Variation in Pakistan</article-title><source>The American Journal of Human Genetics</source><volume>70</volume><fpage>1107</fpage><lpage>1124</lpage><pub-id pub-id-type="doi">10.1086/339929</pub-id></element-citation></ref><ref id="bib44"><element-citation publication-type="software"><person-group person-group-type="author"><collab>R Development Core Team</collab></person-group><year iso-8601-date="2018">2018</year><data-title>R: A Language and Environment for Statistical Computing</data-title><publisher-loc>Vienna, Austria</publisher-loc><publisher-name>R Foundation for Statistical Computing</publisher-name><ext-link ext-link-type="uri" xlink:href="http://www.r-project.org">http://www.r-project.org</ext-link></element-citation></ref><ref id="bib45"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Rañola</surname> <given-names>JM</given-names></name><name><surname>Novembre</surname> <given-names>J</given-names></name><name><surname>Lange</surname> <given-names>K</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Fast spatial ancestry via flexible allele frequency surfaces</article-title><source>Bioinformatics</source><volume>30</volume><fpage>2915</fpage><lpage>2922</lpage><pub-id pub-id-type="doi">10.1093/bioinformatics/btu418</pub-id></element-citation></ref><ref id="bib46"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Rosenberg</surname> <given-names>NA</given-names></name><name><surname>Pritchard</surname> <given-names>JK</given-names></name><name><surname>Weber</surname> <given-names>JL</given-names></name><name><surname>Cann</surname> <given-names>HM</given-names></name><name><surname>Kidd</surname> <given-names>KK</given-names></name><name><surname>Zhivotovsky</surname> <given-names>LA</given-names></name><name><surname>Feldman</surname> <given-names>MW</given-names></name></person-group><year iso-8601-date="2002">2002</year><article-title>Genetic structure of human populations</article-title><source>Science</source><volume>298</volume><fpage>2381</fpage><lpage>2385</lpage><pub-id pub-id-type="doi">10.1126/science.1078311</pub-id><pub-id pub-id-type="pmid">12493913</pub-id></element-citation></ref><ref id="bib47"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Schrider</surname> <given-names>DR</given-names></name><name><surname>Ayroles</surname> <given-names>J</given-names></name><name><surname>Matute</surname> <given-names>DR</given-names></name><name><surname>Kern</surname> <given-names>AD</given-names></name></person-group><year iso-8601-date="2018">2018</year><article-title>Supervised machine learning reveals introgressed loci in the genomes of <italic>Drosophila</italic> simulans and D. sechellia</article-title><source>PLOS Genetics</source><volume>14</volume><elocation-id>e1007341</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pgen.1007341</pub-id></element-citation></ref><ref id="bib48"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Schrider</surname> <given-names>DR</given-names></name><name><surname>Kern</surname> <given-names>AD</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>S/HIC: robust identification of soft and hard sweeps using machine learning</article-title><source>PLOS Genetics</source><volume>12</volume><elocation-id>e1005928</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pgen.1005928</pub-id><pub-id pub-id-type="pmid">26977894</pub-id></element-citation></ref><ref id="bib49"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sheehan</surname> <given-names>S</given-names></name><name><surname>Song</surname> <given-names>YS</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Deep learning for population genetic inference</article-title><source>PLOS Computational Biology</source><volume>12</volume><elocation-id>e1004845</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pcbi.1004845</pub-id><pub-id pub-id-type="pmid">27018908</pub-id></element-citation></ref><ref id="bib50"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Srivastava</surname> <given-names>N</given-names></name><name><surname>Hinton</surname> <given-names>G</given-names></name><name><surname>Krizhevsky</surname> <given-names>A</given-names></name><name><surname>Sutskever</surname> <given-names>I</given-names></name><name><surname>Salakhutdinov</surname> <given-names>R</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Dropout: a simple way to prevent neural networks from overfitting</article-title><source>The Journal of Machine Learning Research</source><volume>15</volume><fpage>1929</fpage><lpage>1958</lpage></element-citation></ref><ref id="bib51"><element-citation publication-type="preprint"><person-group person-group-type="author"><name><surname>Strubell</surname> <given-names>E</given-names></name><name><surname>McCallum</surname> <given-names>A</given-names></name></person-group><year iso-8601-date="2018">2018</year><article-title>Syntax helps elmo understand semantics: is syntax still relevant in a deep neural architecture for srl?</article-title><source>arXiv</source><ext-link ext-link-type="uri" xlink:href="https://arxiv.org/abs/1811.04773">https://arxiv.org/abs/1811.04773</ext-link></element-citation></ref><ref id="bib52"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sugden</surname> <given-names>LA</given-names></name><name><surname>Atkinson</surname> <given-names>EG</given-names></name><name><surname>Fischer</surname> <given-names>AP</given-names></name><name><surname>Rong</surname> <given-names>S</given-names></name><name><surname>Henn</surname> <given-names>BM</given-names></name><name><surname>Ramachandran</surname> <given-names>S</given-names></name></person-group><year iso-8601-date="2018">2018</year><article-title>Localization of adaptive variants in human genomes using averaged one-dependence estimation</article-title><source>Nature Communications</source><volume>9</volume><elocation-id>703</elocation-id><pub-id pub-id-type="doi">10.1038/s41467-018-03100-7</pub-id></element-citation></ref><ref id="bib53"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Tang</surname> <given-names>K</given-names></name><name><surname>Thornton</surname> <given-names>KR</given-names></name><name><surname>Stoneking</surname> <given-names>M</given-names></name></person-group><year iso-8601-date="2007">2007</year><article-title>A new approach for using genome scans to detect recent positive selection in the human genome</article-title><source>PLOS Biology</source><volume>5</volume><elocation-id>e171</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pbio.0050171</pub-id><pub-id pub-id-type="pmid">17579516</pub-id></element-citation></ref><ref id="bib54"><element-citation publication-type="data"><person-group person-group-type="author"><collab>The Anopheles gambiae 1000 Genomes Consortium</collab></person-group><year iso-8601-date="2015">2015</year><data-title>Ag1000G phase 1 AR3 data release</data-title><source>MalariaGEN</source><pub-id pub-id-type="archive" xlink:href="http://www.malariagen.net/data/ag1000g-phase1-AR3">ag1000g-phase1-AR3</pub-id></element-citation></ref><ref id="bib55"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>van der Walt</surname> <given-names>S</given-names></name><name><surname>Colbert</surname> <given-names>SC</given-names></name><name><surname>Varoquaux</surname> <given-names>G</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>The NumPy array: a structure for efficient numerical computation</article-title><source>Computing in Science &amp; Engineering</source><volume>13</volume><fpage>22</fpage><lpage>30</lpage><pub-id pub-id-type="doi">10.1109/MCSE.2011.37</pub-id></element-citation></ref><ref id="bib56"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Villanea</surname> <given-names>FA</given-names></name><name><surname>Schraiber</surname> <given-names>JG</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Multiple episodes of interbreeding between neanderthal and modern humans</article-title><source>Nature Ecology &amp; Evolution</source><volume>3</volume><fpage>39</fpage><lpage>44</lpage><pub-id pub-id-type="doi">10.1038/s41559-018-0735-8</pub-id><pub-id pub-id-type="pmid">30478305</pub-id></element-citation></ref><ref id="bib57"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Voight</surname> <given-names>BF</given-names></name><name><surname>Kudaravalli</surname> <given-names>S</given-names></name></person-group><year iso-8601-date="2006">2006</year><article-title>A map of recent positive selection in the human genome</article-title><source>PLOS Biology</source><volume>3</volume><elocation-id>e72</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pbio.0040072</pub-id></element-citation></ref><ref id="bib58"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Wasser</surname> <given-names>SK</given-names></name><name><surname>Shedlock</surname> <given-names>AM</given-names></name><name><surname>Comstock</surname> <given-names>K</given-names></name><name><surname>Ostrander</surname> <given-names>EA</given-names></name><name><surname>Mutayoba</surname> <given-names>B</given-names></name><name><surname>Stephens</surname> <given-names>M</given-names></name></person-group><year iso-8601-date="2004">2004</year><article-title>Assigning african elephant DNA to geographic region of origin: applications to the ivory trade</article-title><source>PNAS</source><volume>101</volume><fpage>14847</fpage><lpage>14852</lpage><pub-id pub-id-type="doi">10.1073/pnas.0403170101</pub-id><pub-id pub-id-type="pmid">15459317</pub-id></element-citation></ref><ref id="bib59"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Williamson</surname> <given-names>SH</given-names></name><name><surname>Hubisz</surname> <given-names>MJ</given-names></name><name><surname>Clark</surname> <given-names>AG</given-names></name><name><surname>Payseur</surname> <given-names>BA</given-names></name><name><surname>Bustamante</surname> <given-names>CD</given-names></name><name><surname>Nielsen</surname> <given-names>R</given-names></name></person-group><year iso-8601-date="2007">2007</year><article-title>Localizing recent adaptive evolution in the human genome</article-title><source>PLOS Genetics</source><volume>3</volume><elocation-id>e90</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pgen.0030090</pub-id><pub-id pub-id-type="pmid">17542651</pub-id></element-citation></ref><ref id="bib60"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Wright</surname> <given-names>S</given-names></name></person-group><year iso-8601-date="1943">1943</year><article-title>Isolation by distance</article-title><source>Genetics</source><volume>28</volume><fpage>114</fpage><lpage>138</lpage><pub-id pub-id-type="pmid">17247074</pub-id></element-citation></ref><ref id="bib61"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Wright</surname> <given-names>S</given-names></name></person-group><year iso-8601-date="1946">1946</year><article-title>Isolation by distance under diverse systems of mating</article-title><source>Genetics</source><volume>31</volume><fpage>39</fpage><lpage>59</lpage><pub-id pub-id-type="pmid">21009706</pub-id></element-citation></ref><ref id="bib62"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Yang</surname> <given-names>WY</given-names></name><name><surname>Novembre</surname> <given-names>J</given-names></name><name><surname>Eskin</surname> <given-names>E</given-names></name><name><surname>Halperin</surname> <given-names>E</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>A model-based approach for analysis of spatial structure in genetic data</article-title><source>Nature Genetics</source><volume>44</volume><fpage>725</fpage><lpage>731</lpage><pub-id pub-id-type="doi">10.1038/ng.2285</pub-id><pub-id pub-id-type="pmid">22610118</pub-id></element-citation></ref><ref id="bib63"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Zerjal</surname> <given-names>T</given-names></name><name><surname>Xue</surname> <given-names>Y</given-names></name><name><surname>Bertorelle</surname> <given-names>G</given-names></name><name><surname>Wells</surname> <given-names>RS</given-names></name><name><surname>Bao</surname> <given-names>W</given-names></name><name><surname>Zhu</surname> <given-names>S</given-names></name><name><surname>Qamar</surname> <given-names>R</given-names></name><name><surname>Ayub</surname> <given-names>Q</given-names></name><name><surname>Mohyuddin</surname> <given-names>A</given-names></name><name><surname>Fu</surname> <given-names>S</given-names></name><name><surname>Li</surname> <given-names>P</given-names></name><name><surname>Yuldasheva</surname> <given-names>N</given-names></name><name><surname>Ruzibakiev</surname> <given-names>R</given-names></name><name><surname>Xu</surname> <given-names>J</given-names></name><name><surname>Shu</surname> <given-names>Q</given-names></name><name><surname>Du</surname> <given-names>R</given-names></name><name><surname>Yang</surname> <given-names>H</given-names></name><name><surname>Hurles</surname> <given-names>ME</given-names></name><name><surname>Robinson</surname> <given-names>E</given-names></name><name><surname>Gerelsaikhan</surname> <given-names>T</given-names></name><name><surname>Dashnyam</surname> <given-names>B</given-names></name><name><surname>Mehdi</surname> <given-names>SQ</given-names></name><name><surname>Tyler-Smith</surname> <given-names>C</given-names></name></person-group><year iso-8601-date="2003">2003</year><article-title>The genetic legacy of the mongols</article-title><source>The American Journal of Human Genetics</source><volume>72</volume><fpage>717</fpage><lpage>721</lpage><pub-id pub-id-type="doi">10.1086/367774</pub-id><pub-id pub-id-type="pmid">12592608</pub-id></element-citation></ref><ref id="bib64"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Zhu</surname> <given-names>SJ</given-names></name><name><surname>Hendry</surname> <given-names>JA</given-names></name><name><surname>Almagro-Garcia</surname> <given-names>J</given-names></name><name><surname>Pearson</surname> <given-names>RD</given-names></name><name><surname>Amato</surname> <given-names>R</given-names></name><name><surname>Miles</surname> <given-names>A</given-names></name><name><surname>Weiss</surname> <given-names>DJ</given-names></name><name><surname>Lucas</surname> <given-names>TC</given-names></name><name><surname>Nguyen</surname> <given-names>M</given-names></name><name><surname>Gething</surname> <given-names>PW</given-names></name><name><surname>Kwiatkowski</surname> <given-names>D</given-names></name><name><surname>McVean</surname> <given-names>G</given-names></name><collab>Pf3k Project</collab></person-group><year iso-8601-date="2019">2019</year><article-title>The origins and relatedness structure of mixed infections vary with local prevalence of <italic>P. falciparum</italic> malaria</article-title><source>eLife</source><volume>8</volume><elocation-id>e40845</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.40845</pub-id><pub-id pub-id-type="pmid">31298657</pub-id></element-citation></ref><ref id="bib65"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Zikmundová</surname> <given-names>V</given-names></name></person-group><year iso-8601-date="2013">2013</year><source>Spoken Sibe: Morphology of the Inflected Parts of Speech</source><publisher-name>Karolinum Press</publisher-name></element-citation></ref></ref-list><app-group><app id="appendix-1"><title>Appendix 1</title><sec id="s8" sec-type="appendix"><title>Theoretical limits on accuracy</title><boxed-text><p>Suppose that we know the spatial locations of some relatives of a given individual, and want to predict the location of that focal individual. This is a best-case scenario for our actual problem, as in fact we would have to infer the degrees of relatedness of the reference set to the focal individual, but the calculations are useful in establishing a lower bound on the resolution of inference.</p><p>Suppose furthermore that the displacement in spatial position along each parent-child relationship has mean zero and variance <inline-formula><mml:math id="inf23"><mml:msup><mml:mi mathsize="90%">σ</mml:mi><mml:mn mathsize="90%">2</mml:mn></mml:msup></mml:math></inline-formula>, so that the net distance traveled along any path along <inline-formula><mml:math id="inf24"><mml:mi mathsize="90%">k</mml:mi></mml:math></inline-formula> links in the pedigree has mean zero and variance <inline-formula><mml:math id="inf25"><mml:mrow><mml:mi mathsize="90%">k</mml:mi><mml:mo>⁢</mml:mo><mml:msup><mml:mi mathsize="90%">σ</mml:mi><mml:mn mathsize="90%">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>. Given the location of <inline-formula><mml:math id="inf26"><mml:mi mathsize="90%">n</mml:mi></mml:math></inline-formula> relatives of a focal individual, a simple estimator of that individual’s spatial location is simply the average of their locations. How well does this do?</p><p>We can associate each link between parent <inline-formula><mml:math id="inf27"><mml:mi mathsize="90%">p</mml:mi></mml:math></inline-formula> and child <inline-formula><mml:math id="inf28"><mml:mi mathsize="90%">c</mml:mi></mml:math></inline-formula> in the pedigree with the displacement between them, <inline-formula><mml:math id="inf29"><mml:mrow><mml:msub><mml:mi mathsize="90%">X</mml:mi><mml:mrow><mml:mi mathsize="90%">p</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">c</mml:mi></mml:mrow></mml:msub><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:msub><mml:mi mathsize="90%">X</mml:mi><mml:mrow><mml:mi mathsize="90%">c</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">p</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mrow></mml:math></inline-formula>; we have assumed that <inline-formula><mml:math id="inf30"><mml:mrow><mml:mrow><mml:mo mathsize="90%" stretchy="false">var</mml:mo><mml:mo>⁡</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">[</mml:mo><mml:msub><mml:mi mathsize="90%">X</mml:mi><mml:mrow><mml:mi mathsize="90%">c</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">p</mml:mi></mml:mrow></mml:msub><mml:mo maxsize="90%" minsize="90%">]</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:msup><mml:mi mathsize="90%">σ</mml:mi><mml:mn mathsize="90%">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> for each. Suppose that the <inline-formula><mml:math id="inf31"><mml:msup><mml:mi mathsize="90%">i</mml:mi><mml:mtext mathsize="90%">th</mml:mtext></mml:msup></mml:math></inline-formula> relative can be reached by traversing relatives <inline-formula><mml:math id="inf32"><mml:mrow><mml:msub><mml:mi mathsize="90%">r</mml:mi><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo>⁢</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow></mml:msub><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:mi mathsize="90%" mathvariant="normal">…</mml:mi><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msub><mml:mi mathsize="90%">r</mml:mi><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo>⁢</mml:mo><mml:msub><mml:mi mathsize="90%">k</mml:mi><mml:mi mathsize="90%">i</mml:mi></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, and so their location relative to the focal individual is <inline-formula><mml:math id="inf33"><mml:mrow><mml:msub><mml:mi mathsize="90%">Y</mml:mi><mml:mi mathsize="90%">i</mml:mi></mml:msub><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:msub><mml:mi mathsize="90%">X</mml:mi><mml:mrow><mml:msub><mml:mi mathsize="90%">r</mml:mi><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo>⁢</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow></mml:msub><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msub><mml:mi mathsize="90%">r</mml:mi><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo>⁢</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:msub><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:mi mathsize="90%" mathvariant="normal">⋯</mml:mi><mml:mo mathsize="90%" stretchy="false">+</mml:mo><mml:msub><mml:mi mathsize="90%">X</mml:mi><mml:mrow><mml:msub><mml:mi mathsize="90%">r</mml:mi><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo>⁢</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mi mathsize="90%">k</mml:mi><mml:mi mathsize="90%">i</mml:mi></mml:msub><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow></mml:mrow></mml:msub><mml:mo mathsize="90%" stretchy="false">,</mml:mo><mml:msub><mml:mi mathsize="90%">r</mml:mi><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo>⁢</mml:mo><mml:msub><mml:mi mathsize="90%">k</mml:mi><mml:mi mathsize="90%">i</mml:mi></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:msub></mml:mrow></mml:mrow></mml:math></inline-formula>. To compute the variance of our estimator, <inline-formula><mml:math id="inf34"><mml:mrow><mml:mover accent="true"><mml:mi mathsize="90%">Y</mml:mi><mml:mo mathsize="90%" stretchy="false">¯</mml:mo></mml:mover><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:msubsup><mml:mo largeop="true" mathsize="90%" stretchy="false" symmetric="true">∑</mml:mo><mml:mrow><mml:mi mathsize="90%">i</mml:mi><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mi mathsize="90%">n</mml:mi></mml:msubsup><mml:mrow><mml:msub><mml:mi mathsize="90%">Y</mml:mi><mml:mi mathsize="90%">i</mml:mi></mml:msub><mml:mo mathsize="90%" stretchy="false">/</mml:mo><mml:mi mathsize="90%">n</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:math></inline-formula>, let <inline-formula><mml:math id="inf35"><mml:msub><mml:mi mathsize="90%">n</mml:mi><mml:mrow><mml:mi mathsize="90%">c</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">p</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> be the number of <inline-formula><mml:math id="inf36"><mml:mi mathsize="90%">i</mml:mi></mml:math></inline-formula> for which <inline-formula><mml:math id="inf37"><mml:msub><mml:mi mathsize="90%">X</mml:mi><mml:mrow><mml:mi mathsize="90%">c</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">p</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> appears in the sum for <inline-formula><mml:math id="inf38"><mml:msub><mml:mi mathsize="90%">Y</mml:mi><mml:mi mathsize="90%">i</mml:mi></mml:msub></mml:math></inline-formula>, so that <inline-formula><mml:math id="inf39"><mml:mrow><mml:mover accent="true"><mml:mi mathsize="90%">Y</mml:mi><mml:mo mathsize="90%" stretchy="false">¯</mml:mo></mml:mover><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:msub><mml:mo largeop="true" mathsize="90%" stretchy="false" symmetric="true">∑</mml:mo><mml:mrow><mml:mi mathsize="90%">c</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">p</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mrow><mml:msub><mml:mi mathsize="90%">n</mml:mi><mml:mrow><mml:mi mathsize="90%">c</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">p</mml:mi></mml:mrow></mml:msub><mml:mo>⁢</mml:mo><mml:msub><mml:mi mathsize="90%">X</mml:mi><mml:mrow><mml:mi mathsize="90%">c</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">p</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo mathsize="90%" stretchy="false">/</mml:mo><mml:mi mathsize="90%">n</mml:mi></mml:mrow></mml:mrow></mml:mrow></mml:math></inline-formula>. Then, simply, <inline-formula><mml:math id="inf40"><mml:mrow><mml:mrow><mml:mo mathsize="90%" stretchy="false">var</mml:mo><mml:mo>⁡</mml:mo><mml:mrow><mml:mo maxsize="90%" minsize="90%">[</mml:mo><mml:mover accent="true"><mml:mi mathsize="90%">Y</mml:mi><mml:mo mathsize="90%" stretchy="false">¯</mml:mo></mml:mover><mml:mo maxsize="90%" minsize="90%">]</mml:mo></mml:mrow></mml:mrow><mml:mo mathsize="90%" stretchy="false">=</mml:mo><mml:mrow><mml:msub><mml:mo largeop="true" mathsize="90%" stretchy="false" symmetric="true">∑</mml:mo><mml:mrow><mml:mi mathsize="90%">c</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">p</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:msup><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:msub><mml:mi mathsize="90%">n</mml:mi><mml:mrow><mml:mi mathsize="90%">c</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">p</mml:mi></mml:mrow></mml:msub><mml:mo mathsize="90%" stretchy="false">/</mml:mo><mml:mi mathsize="90%">n</mml:mi></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow><mml:mn mathsize="90%">2</mml:mn></mml:msup><mml:mo>⁢</mml:mo><mml:msub><mml:mi mathsize="90%">X</mml:mi><mml:mrow><mml:mi mathsize="90%">c</mml:mi><mml:mo>⁢</mml:mo><mml:mi mathsize="90%">p</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mrow></mml:mrow></mml:math></inline-formula>. For instance, if those relatives are all <inline-formula><mml:math id="inf41"><mml:msup><mml:mn mathsize="90%">2</mml:mn><mml:mi mathsize="90%">k</mml:mi></mml:msup></mml:math></inline-formula> ancestors <inline-formula><mml:math id="inf42"><mml:mi mathsize="90%">k</mml:mi></mml:math></inline-formula> generations ago (i.e., the great <inline-formula><mml:math id="inf43"><mml:msup><mml:mi/><mml:mrow><mml:mi mathsize="90%">k</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">2</mml:mn></mml:mrow></mml:msup></mml:math></inline-formula>-grandparents) of the focal individual, then each of the <inline-formula><mml:math id="inf44"><mml:msup><mml:mn mathsize="90%">2</mml:mn><mml:mi mathsize="90%" mathvariant="normal">ℓ</mml:mi></mml:msup></mml:math></inline-formula> links between the <inline-formula><mml:math id="inf45"><mml:msup><mml:mi mathsize="90%" mathvariant="normal">ℓ</mml:mi><mml:mtext mathsize="90%">th</mml:mtext></mml:msup></mml:math></inline-formula> and <inline-formula><mml:math id="inf46"><mml:msup><mml:mrow><mml:mo maxsize="90%" minsize="90%">(</mml:mo><mml:mrow><mml:mi mathsize="90%" mathvariant="normal">ℓ</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mn mathsize="90%">1</mml:mn></mml:mrow><mml:mo maxsize="90%" minsize="90%">)</mml:mo></mml:mrow><mml:mtext mathsize="90%">th</mml:mtext></mml:msup></mml:math></inline-formula> generations are traversed by <inline-formula><mml:math id="inf47"><mml:msup><mml:mn mathsize="90%">2</mml:mn><mml:mrow><mml:mi mathsize="90%">k</mml:mi><mml:mo mathsize="90%" stretchy="false">-</mml:mo><mml:mi mathsize="90%" mathvariant="normal">ℓ</mml:mi></mml:mrow></mml:msup></mml:math></inline-formula> of the paths, and so<disp-formula id="equ2"><mml:math id="m2"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi mathvariant="normal">v</mml:mi><mml:mi mathvariant="normal">a</mml:mi><mml:mi mathvariant="normal">r</mml:mi><mml:mo stretchy="false">[</mml:mo><mml:mrow><mml:mover><mml:mi mathvariant="normal">Y</mml:mi><mml:mo stretchy="false">¯</mml:mo></mml:mover></mml:mrow><mml:mo stretchy="false">]</mml:mo><mml:mo>=</mml:mo><mml:munderover><mml:mo>∑</mml:mo><mml:mrow><mml:mi>ℓ</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi mathvariant="normal">k</mml:mi></mml:mrow></mml:munderover><mml:msup><mml:mn>2</mml:mn><mml:mrow><mml:mi>ℓ</mml:mi></mml:mrow></mml:msup><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mfrac><mml:msup><mml:mn>2</mml:mn><mml:mrow><mml:mi mathvariant="normal">k</mml:mi><mml:mo>−</mml:mo><mml:mi>ℓ</mml:mi></mml:mrow></mml:msup><mml:msup><mml:mn>2</mml:mn><mml:mrow><mml:mi mathvariant="normal">k</mml:mi></mml:mrow></mml:msup></mml:mfrac><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:msup><mml:mi>σ</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:msup><mml:mn>2</mml:mn><mml:mrow><mml:mo>−</mml:mo><mml:mi mathvariant="normal">k</mml:mi></mml:mrow></mml:msup><mml:mo stretchy="false">)</mml:mo><mml:msup><mml:mi>σ</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:mo>.</mml:mo></mml:mrow></mml:mstyle></mml:math></disp-formula></p><p>Clearly, with less full pedigree coverage and more distant relatives, the error would become worse, but it does not depend strongly on the degree of relatedness used: in general, using a few close or many distant relatives should give an estimate of location within some moderate factor of <inline-formula><mml:math id="inf48"><mml:mi mathsize="90%">σ</mml:mi></mml:math></inline-formula>.</p></boxed-text></sec></app></app-group></back><sub-article article-type="decision-letter" id="sa1"><front-stub><article-id pub-id-type="doi">10.7554/eLife.54507.sa1</article-id><title-group><article-title>Decision letter</article-title></title-group><contrib-group><contrib contrib-type="editor"><name><surname>Nordborg</surname><given-names>Magnus</given-names></name><role>Reviewing Editor</role><aff><institution>Austrian Academy of Sciences</institution><country>Austria</country></aff></contrib></contrib-group><contrib-group><contrib contrib-type="reviewer"><name><surname>Huber</surname><given-names>Christian</given-names> </name><role>Reviewer</role><aff><institution>University of Adelaide</institution><country>Australia</country></aff></contrib><contrib contrib-type="reviewer"><name><surname>Harpak</surname><given-names>Arbel</given-names> </name><role>Reviewer</role><aff><institution>Columbia University</institution><country>United States</country></aff></contrib><contrib contrib-type="reviewer"><name><surname>Speidel</surname><given-names>Leo</given-names> </name><role>Reviewer</role></contrib></contrib-group></front-stub><body><boxed-text><p>In the interests of transparency, eLife publishes the most substantive revision requests and the accompanying author responses.</p></boxed-text><p><bold>Acceptance summary:</bold></p><p>Your paper introduces a novel efficient tool for &quot;placing samples on a map&quot; using genetic variation – a fundamental problem of considerable practical importance.</p><p><bold>Decision letter after peer review:</bold></p><p>Thank you for submitting your article &quot;Predicting Geographic Location from Genetic Variation with Deep Neural Networks&quot; for consideration by <italic>eLife</italic>. Your article has been reviewed by Patricia Wittkopp as the Senior Editor, a Reviewing Editor, and three reviewers. The following individuals involved in review of your submission have agreed to reveal their identity: Christian Huber (Reviewer #1); Arbel Harpak (Reviewer #2); Leo Speidel (Reviewer #3).</p><p>The reviewers have discussed the reviews with one another and the Reviewing Editor has drafted this decision to help you prepare a revised submission.</p><p>Summary:</p><p>This paper describes an elegant and highly efficient method for assigning samples to geographic location based on polymorphism data.</p><p>Essential revisions:</p><p>The reviewers were unanimous in liking this paper, but were equally unanimous in thinking it needed more discussion/clarification of what the advantages and disadvantages of this machine learning approach is compared to explicitly model-based approaches. How should we interpret the results, what are suitable applications (beyond examples given), etc.</p><p>As the reviews are consistent and self-explanatory, they are attached in full, rather than condensed here. This also goes for minor comments.</p><p><italic>Reviewer #1:</italic></p><p>The authors present a new, neural network (NN) based approach for predicting the geographic location of a sample based on its genetic information and a reference dataset of multiple samples with known genetic and geographic information. The new method, Locator, is compared to a probabilistic approach that explicitly models the geographic distribution of alleles.</p><p>One major advantage of the new approach is the dramatic increase in speed, particularly when dealing with very large datasets. The simulations and empirical analyses make a lot of sense. I further appreciate the theoretical and simulation-based insight that dispersal distance is the single limiting factor for the accuracy of the inference, assuming datasets are moderately large. I strongly support publication of the study in <italic>eLife</italic>. However, I think the manuscript could improve by providing a better presentation of advantages and disadvantages of this type of machine learning approach compared to model-based (i.e. statistical) approaches. I suspect that model-based approaches such as SPASIBA should work better for out-of-sample prediction (e.g. for geographic regions that are not covered by the training sample) and have a clearer approach to quantifying uncertainty (i.e. confidence intervals), at least when model assumptions are correct. Specific comments and examples are below.</p><p>1) I wonder about cases where the distribution of the species is continuous across space, but the sampling of the training sample is strongly clustered, which seems highly relevant for many empirical cases where samples are rarely sampled uniformly across species range (e.g., the Anopheles data). Further, it seems that the clustering of the training samples affects the prediction of Locator almost like a strong &quot;prior&quot;, i.e. as if it is implicitly assumed that the new sample most likely also comes from one of these clusters. This might explain why Locator is superior to SPASIBA for the Anopheles data but not for the simulations (Figure 3) since SPASIBA does not have a prior on location but assumes that the new sample could come from any arbitrary location. However, this might also imply that SPASIBA is better for out-of-sample prediction, i.e. when the spatial location of the investigated sample is different from the locations of the clustered training data. Related to this, in the discussion the authors state that they found that &quot;the greatest increase in performance relative to the model-based approach is in empirical data for which the assumption of smooth variation in allele frequencies across the landscape is unlikely to hold, such as the complex multi-species Anopheles sample analyzed here (Figure 3)&quot;. My alternative interpretation here is that this has nothing to do with smooth variation in allele frequency, but is a result of the strong clustering of the training sample, and the fact that the test samples are also sampled from these cluster locations. In fact, one of the results (subsection &quot;Effects of Unsampled Populations&quot;) is that prediction error is much higher for individuals from regions excluded from training, and that &quot;predicted locations appear to project towards the nearest locality included in the training set&quot;, which is supporting my interpretation. I thus would change the discussion regarding the mentioned statement and bring up the problem of clustered sampling locations of the training sample. It might be out of the scope of the current study, but testing both SPASIBA and Locator on spatial simulations with clustered training samples but uniformly sampled test samples would also be informative regarding this question.</p><p>2) The statistical method SPASIBA allows to compute a likelihood surface of the location of the tested individual, i.e. it provides a statistical way of quantifying uncertainty in the estimate. The Locator method does not allow such a quantification. However, the authors suggest to run Locator on multiple 2 Mb windows across the genome and use the predicted locations from such multiple runs to quantify the uncertainty, for example by plotting contours of the 95% quantiles of a two-dimensional kernel density of these locations. This approach certainly gives some idea about the spatial extent of uncertainty (i.e. if there are certain spatial directions where estimating the location is harder than for other directions). However, it seems important to point out that these contours are not proper confidence or credibility intervals to avoid any confusion. There is no guarantee that the 95% contours capture the true location 95% of times. Further, the contours might look very different depending on the choice of the window size. The authors should provide more explicit guidelines about how to (or not to) interpret these contours, and also guide the choice of window size (e.g., why 2 Mb? Is there an optimal window size?).</p><p><italic>Reviewer #2:</italic></p><p>Battey et al., develop a software to predict geographic location from genotype data. They use the fact that their method is fast to quantify individual prediction uncertainty and describe &quot;mosaic ancestry&quot; by predicting locations separately in windows across the genome.</p><p>The manuscript and code are overall clear and the work is well-rounded, with applications to simulations and three real data sets and a thoughtful discussion of the method's performance on each. The fact that LOCATOR works directly on a VCF and a coordinates file, is very fast, and quantifies individual level uncertainty-should all be very appealing to users.</p><p>I have some doubts are about the utility of the method and about the neural net approach. What are some possible motivations / applications beyond the trafficked elephant ivory example? Assuming that there are some important applications, is the neural net approach really preferable to a generative model? Throughout, the authors articulate interesting insight (e.g. the reasons underlying variance in estimates across genomic windows; the way dispersal distance sets a lower bound on accuracy) that they cannot fully quantify with their method due to its black-box nature. Relatedly, the authors demonstrate that the performance is superior to SPASIBA when the input is raw, unphased genotype data. While this may represent the current state of the art, it seems to me plausible that in the future we will separate the learning of genealogical trees from learning dispersal patterns. I wonder, for example, if feeding the network with inferred tree sequences (e.g. tsInfer) would lead to much better performance, as it disentangles these two learning steps. To be clear, I am not asking the authors to develop a new method, but only to modify their discussion to either explain the benefits of their steering away from the generative model; or alternatively say that down the line, a generative approach is more fruitful.</p><p><italic>Reviewer #3:</italic></p><p>The manuscript describes a method for predicting geographic location using a simple, fully connected deep neural network which is trained on labelled samples of known geographic location. I am particularly impressed that the method can be applied to genomic subregions, quantifying uncertainty about predictions as well as variation of ancestry along the genome due to recent admixture or other evolutionary processes influencing genetic structure.</p><p>The presented method is a significant advance from existing methods, which are substantially slower and impose stronger modelling assumptions. Accuracy appears comparable to existing methods on simulated data (with one exception, see below), while on real data the presented method outperforms existing approaches.</p><p>The manuscript is very well written; details of the method were clear. While I did not attempt to do so, I believe that analyses were explained in sufficient detail for reproducing the results.</p><p>I believe that the work is of interest to the readership of <italic>eLife</italic> and I would recommend it for publication. Below, I am listing a few comments I have after reading the manuscript.</p><p>- Prediction of geographic location has many similarities with (recent) ancestry inference, and can be seen as a projection of genetic structure onto a geographic landscape (where genetic structure may be affected by many processes). It would be great if the authors could include a discussion putting this work into context with previous work on genetic structure, in particular methods that also don't require discrete populations, e.g., PCA on various types of matrices (genotype, chromopainter coancestry matrices etc) (genes mirror geography!). I do think and like that projecting structure on geography can improve interpretability compared to these methods, however perhaps adds constraints on the projection space that other methods may not have/or differ from other methods?</p><p>- I believe that a potential weak point of the current manuscript is that it is unclear how to interpret these predictions (apart from the naive interpretation of geographic origin of ancestors). In particular, I believe that the impact of this paper would be very much elevated if the authors could include examples where geographic location can be used for inference of some underlying biological process, e.g., selection acting on the genome or regions with reduced genetic diversity. Is there a difference in predicted geographic location in coding/non-coding regions (such as coding regions have lower variance of prediction for instance)?</p><p>- Is it possible to estimate dispersal rates from these predictions and their uncertainty? (which may be the obvious parameter one might want to learn about an organism/group of interest).</p><p>- I like that the authors provided an analysis where some samples were dropped from the training step, to illustrate the effect of unsampled groups. In practise, is there a way to learn from the data whether the reference/training samples are representative for the sample I want to do prediction for? E.g., one could think about having multiple neural networks that are trained on subsets of samples and compare predictions.</p><p>- What is the reason for windowing according to number of base-pairs instead of recombination rate (cM), especially given that Figure 8 shows a higher prediction error in regions of lower recombination rate (and fewer genealogical trees).</p><p>Overall, I very much enjoyed reading this paper. Out of interest and with no need to mention or implementing this in the current paper – If the underlying genealogies were known, would you be able to predict geographic locations of most recent common ancestors? You could then extract information about directional migration from this for instance I believe?</p></body></sub-article><sub-article article-type="reply" id="sa2"><front-stub><article-id pub-id-type="doi">10.7554/eLife.54507.sa2</article-id><title-group><article-title>Author response</article-title></title-group></front-stub><body><disp-quote content-type="editor-comment"><p>Essential revisions:</p><p>The reviewers were unanimous in liking this paper, but were equally unanimous in thinking it needed more discussion/clarification of what the advantages and disadvantages of this machine learning approach is compared to explicitly model-based approaches. How should we interpret the results, what are suitable applications (beyond examples given), etc.</p><p>As the reviews are consistent and self-explanatory, they are attached in full, rather than condensed here. This also goes for minor comments.</p></disp-quote><p>Thanks to the editors and reviewers for your thorough comments. In this revision we have added two new analyses looking at (1) fixed- vs recombination-distance-based windows, and (2) the EDAR locus as an example of a well-studied genomic region with a steep geographic cline. We also added to the end of our Discussion section to explore the general utility of machine learning approaches in population genetics. We also made minor figure edits and clarified several methodological points and syntax issues. Specific responses for each reviewer comment are printed below.</p><disp-quote content-type="editor-comment"><p>Reviewer #1:</p><p>The authors present a new, neural network (NN) based approach for predicting the geographic location of a sample based on its genetic information and a reference dataset of multiple samples with known genetic and geographic information. The new method, Locator, is compared to a probabilistic approach that explicitly models the geographic distribution of alleles.</p><p>One major advantage of the new approach is the dramatic increase in speed, particularly when dealing with very large datasets. The simulations and empirical analyses make a lot of sense. I further appreciate the theoretical and simulation-based insight that dispersal distance is the single limiting factor for the accuracy of the inference, assuming datasets are moderately large. I strongly support publication of the study in eLife. However, I think the manuscript could improve by providing a better presentation of advantages and disadvantages of this type of machine learning approach compared to model-based (i.e. statistical) approaches. I suspect that model-based approaches such as SPASIBA should work better for out-of-sample prediction (e.g. for geographic regions that are not covered by the training sample) and have a clearer approach to quantifying uncertainty (i.e. confidence intervals), at least when model assumptions are correct. Specific comments and examples are below.</p></disp-quote><p>Thank you for your comments. We have expanded the general discussion of the utility of machine learning approaches in population genetics at the end of the Discussion section, and respond to specific comments below.</p><disp-quote content-type="editor-comment"><p>1) I wonder about cases where the distribution of the species is continuous across space, but the sampling of the training sample is strongly clustered, which seems highly relevant for many empirical cases where samples are rarely sampled uniformly across species range (e.g., the Anopheles data). Further, it seems that the clustering of the training samples affects the prediction of Locator almost like a strong &quot;prior&quot;, i.e. as if it is implicitly assumed that the new sample most likely also comes from one of these clusters. This might explain why Locator is superior to SPASIBA for the Anopheles data but not for the simulations (Figure 3) since SPASIBA does not have a prior on location but assumes that the new sample could come from any arbitrary location. However, this might also imply that SPASIBA is better for out-of-sample prediction, i.e. when the spatial location of the investigated sample is different from the locations of the clustered training data. Related to this, in the discussion the authors state that they found that &quot;the greatest increase in performance relative to the model-based approach is in empirical data for which the assumption of smooth variation in allele frequencies across the landscape is unlikely to hold, such as the complex multi-species Anopheles sample analyzed here (Figure 3)&quot;. My alternative interpretation here is that this has nothing to do with smooth variation in allele frequency, but is a result of the strong clustering of the training sample, and the fact that the test samples are also sampled from these cluster locations. In fact, one of the results (subsection &quot;Effects of Unsampled Populations&quot;) is that prediction error is much higher for individuals from regions excluded from training, and that &quot;predicted locations appear to project towards the nearest locality included in the training set&quot;, which is supporting my interpretation. I thus would change the discussion regarding the mentioned statement and bring up the problem of clustered sampling locations of the training sample. It might be out of the scope of the current study, but testing both SPASIBA and Locator on spatial simulations with clustered training samples but uniformly sampled test samples would also be informative regarding this question.</p></disp-quote><p>This is a good point, and the analogy to a strong prior given spatially concentrated sampling seems right to us. We have edited the second paragraph of the Discussion section to include this point.</p><disp-quote content-type="editor-comment"><p>2) The statistical method SPASIBA allows to compute a likelihood surface of the location of the tested individual, i.e. it provides a statistical way of quantifying uncertainty in the estimate. The Locator method does not allow such a quantification. However, the authors suggest to run Locator on multiple 2 Mb windows across the genome and use the predicted locations from such multiple runs to quantify the uncertainty, for example by plotting contours of the 95% quantiles of a two-dimensional kernel density of these locations. This approach certainly gives some idea about the spatial extent of uncertainty (i.e. if there are certain spatial directions where estimating the location is harder than for other directions). However, it seems important to point out that these contours are not proper confidence or credibility intervals to avoid any confusion. There is no guarantee that the 95% contours capture the true location 95% of times. Further, the contours might look very different depending on the choice of the window size. The authors should provide more explicit guidelines about how to (or not to) interpret these contours, and also guide the choice of window size (e.g., why 2 Mb? Is there an optimal window size?).</p></disp-quote><p>We added a note to the relevant Results section explaining differences between window prediction intervals and confidence intervals (ie we think they’re best interpreted as “x% of the genome likely originated in this interval”).</p><disp-quote content-type="editor-comment"><p>Reviewer #2:</p><p>Battey et al., develop a software to predict geographic location from genotype data. They use the fact that their method is fast to quantify individual prediction uncertainty and describe &quot;mosaic ancestry&quot; by predicting locations separately in windows across the genome.</p><p>The manuscript and code are overall clear and the work is well-rounded, with applications to simulations and three real data sets and a thoughtful discussion of the method's performance on each. The fact that LOCATOR works directly on a VCF and a coordinates file, is very fast, and quantifies individual level uncertainty-should all be very appealing to users.</p><p>I have some doubts are about the utility of the method and about the neural net approach. What are some possible motivations / applications beyond the trafficked elephant ivory example? Assuming that there are some important applications, is the neural net approach really preferable to a generative model? Throughout, the authors articulate interesting insight (e.g. the reasons underlying variance in estimates across genomic windows; the way dispersal distance sets a lower bound on accuracy) that they cannot fully quantify with their method due to its black-box nature. Relatedly, the authors demonstrate that the performance is superior to SPASIBA when the input is raw, unphased genotype data. While this may represent the current state of the art, it seems to me plausible that in the future we will separate the learning of genealogical trees from learning dispersal patterns. I wonder, for example, if feeding the network with inferred tree sequences (e.g. tsInfer) would lead to much better performance, as it disentangles these two learning steps. To be clear, I am not asking the authors to develop a new method, but only to modify their discussion to either explain the benefits of their steering away from the generative model; or alternatively say that down the line, a generative approach is more fruitful.</p></disp-quote><p>Thank you for your comments. We have expanded our Discussion section to talk more generally about the utility and desirability of machine-learning vs statistical approaches – see the new final two paragraphs.</p><disp-quote content-type="editor-comment"><p>Reviewer #3:</p><p>The manuscript describes a method for predicting geographic location using a simple, fully connected deep neural network which is trained on labelled samples of known geographic location. I am particularly impressed that the method can be applied to genomic subregions, quantifying uncertainty about predictions as well as variation of ancestry along the genome due to recent admixture or other evolutionary processes influencing genetic structure.</p><p>The presented method is a significant advance from existing methods, which are substantially slower and impose stronger modelling assumptions. Accuracy appears comparable to existing methods on simulated data (with one exception, see below), while on real data the presented method outperforms existing approaches.</p><p>The manuscript is very well written; details of the method were clear. While I did not attempt to do so, I believe that analyses were explained in sufficient detail for reproducing the results.</p><p>I believe that the work is of interest to the readership of eLife and I would recommend it for publication. Below, I am listing a few comments I have after reading the manuscript.</p></disp-quote><p>Thank you for your comments. In this revision we have expanded our discussion to talk more generally about the utility of process-agnostic models in population genetic inference, and made a number of small edits to syntax and figures. Specific responses are below.</p><disp-quote content-type="editor-comment"><p>- Prediction of geographic location has many similarities with (recent) ancestry inference, and can be seen as a projection of genetic structure onto a geographic landscape (where genetic structure may be affected by many processes). It would be great if the authors could include a discussion putting this work into context with previous work on genetic structure, in particular methods that also don't require discrete populations, e.g., PCA on various types of matrices (genotype, chromopainter coancestry matrices etc) (genes mirror geography!). I do think and like that projecting structure on geography can improve interpretability compared to these methods, however perhaps adds constraints on the projection space that other methods may not have/or differ from other methods?</p></disp-quote><p>We like this suggestion. To address this we have added the following text to the Discussion section: “The correspondence between our explicitly geographic method and unsupervised clustering or dimensionality reduction methods highlights the implicit prior assumption of genetic-geographic correlation often made when interpreting the output of STRUCTURE or PCA. Rather than mapping population structure to geography as a post-hoc interpretation, Locator and other continuous assignment methods directly incorporate space in the model.”</p><disp-quote content-type="editor-comment"><p>- I believe that a potential weak point of the current manuscript is that it is unclear how to interpret these predictions (apart from the naive interpretation of geographic origin of ancestors). In particular, I believe that the impact of this paper would be very much elevated if the authors could include examples where geographic location can be used for inference of some underlying biological process, e.g., selection acting on the genome or regions with reduced genetic diversity. Is there a difference in predicted geographic location in coding/non-coding regions (such as coding regions have lower variance of prediction for instance)?</p></disp-quote><p>Thanks for this suggestion. We have now expanded on our analysis of association or error with recombination rate to look at different windowing designs, and pulled out a case study of the EDAR locus in Eurasia as an example of a highly geographically differentiated region of the genome that readers familiar with the human genetics literature in particular may be familiar with.</p><disp-quote content-type="editor-comment"><p>- Is it possible to estimate dispersal rates from these predictions and their uncertainty? (which may be the obvious parameter one might want to learn about an organism/group of interest).</p></disp-quote><p>In simulations we found that error was roughly constant when expressed in units of population mean dispersal distance (3 – 4 generations of dispersal), so it may be possible to work backwards from observed validation error in empirical data to estimate a dispersal kernal for the organism. However, we didn’t design the method with this use in mind and haven’t tested extensively enough to be confident in using it that way, so we decided to leave this out of the main text.</p><disp-quote content-type="editor-comment"><p>- I like that the authors provided an analysis where some samples were dropped from the training step, to illustrate the effect of unsampled groups. In practise, is there a way to learn from the data whether the reference/training samples are representative for the sample I want to do prediction for? E.g., one could think about having multiple neural networks that are trained on subsets of samples and compare predictions.</p></disp-quote><p>The multiple networks idea is an interesting one that we hadn’t considered. The closest approach that we’ve worked on here is in small samples (i.e. <italic>&lt;</italic>40 training samples), where randomly splitting training/validation samples can result in some regions under- or overrepresented in the training set. On the Locator documentation (i.e., the github readme) we now included a section suggesting users fit models in a loop with different seeds to get an ensemble of models trained on different subsets of their reference data. This doesn’t quite get at whether or not each training set is representative, but does help average over some of the noise from the training / validation split. In this revision we added a paragraph to the Materials and methods section suggesting this approach to users with small sample sizes.</p><disp-quote content-type="editor-comment"><p>- What is the reason for windowing according to number of base-pairs instead of recombination rate (cM), especially given that Figure 8 shows a higher prediction error in regions of lower recombination rate (and fewer genealogical trees).</p></disp-quote><p>Good point. We have now added a section comparing fixed versus per-centimorgan windowing, and looking a little deeper at genomic factors that could affect prediction accuracy. Perhaps unsurprisingly the error of centroid estimates is extremely similar using bp or cm windows, but the distribution along the genome is quite different in a way that seems to reflect the association with recombination rate. Overall, the variance in per-window prediction error is lower for recombination-distance based windows. This mostly seems to reflect centromeres, whose presence predicts significant proportions of variance in error using fixed windows but not in centimorgan windows.</p><disp-quote content-type="editor-comment"><p>Overall, I very much enjoyed reading this paper. Out of interest and with no need to mention or implementing this in the current paper – If the underlying genealogies were known, would you be able to predict geographic locations of most recent common ancestors? You could then extract information about directional migration from this for instance I believe?</p></disp-quote><p>Interesting idea – I think the answer is yes if you make some assumptions about the dispersal kernal (the model we sketch out in the appendix would get you part of the way there). We are also aware of another group with a method in the works that does something like this and are excited to see it!</p></body></sub-article></article>