Fast and Memory-Efficient Dynamic Programming Approach for Large-Scale EHH-Based Selection Scans
Abstract
Haplotype-based statistics are widely used for finding genomic regions under positive selection. At the heart of many such statistics is the computation of extended haplotype homozygosity (EHH), which captures the decay of homozygosity away from a focal site. This computation, repeated for potentially millions of sites, is computationally demanding, as it involves tracking counts of unique haplotypes iteratively over long genomic distances and across many individuals. Because of these computational challenges, existing tools do not scale well when applied to large-scale population datasets, such as the 1000 Genomes Project, or the UK Biobank with 500,000 individuals. Optimizing computation becomes crucial when data sets grow large, especially when handling large sample sizes or generating training data for machine learning algorithms. https://github.com/szpiech/selscan Here, we propose a dynamic programming algorithm that substantially improves runtime and memory usage over existing tools on both real and simulated data. On real phased data, we achieve 5-50x speedup with minimal memory footprint. Our simulations show an even more pronounced performance gap with large populations (up to 15x speedup and 46x memory reduction). EHH-based statistics designed for unphased genotypes run an order of magnitude faster, and multi-parameter support results in 20x runtime improvement. Source code and binaries are available at https://github.com/szpiech/selscan as selscan v2.1.
02 /Specification & Classification
Click any tag to browse matching papers- Citations
- 7
- FWCI
- 4.09
- Field percentile
- top 5%
- Assay
- Research Focus
- Approach
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- Selection scans and downstream analysis with selscan
Amatur Rahman, T. C. Smith, Zachary A. Szpiech·Human Population Genetics and GenomicsPeer-reviewed·Mar 20, 2026
- rehh 2.0: a reimplementation of the R package rehh to detect positive selection from haplotype structure.
Mathieu Gautier, Alexander Klassmann, Renaud Vitalis·bioRxiv·Aug 3, 2016
- selscan 2.0: scanning for sweeps in unphased data
Z. A. Szpiech·BioinformaticsPeer-reviewed·Jan 5, 2024
- SelNeTime: a python package inferring effective population size and selection intensity from genomic time series data
Mathieu Uhl, Paul Bunel, … Bertrand Servin·Peer Community JournalPeer-reviewed·May 21, 2026
- Fast simulation of identity-by-descent segments
Seth D Temple, Sharon R. Browning, E. A. Thompson·Bulletin of Mathematical BiologyPeer-reviewed·May 23, 2025
- Polaris: Polarization of ancestral and derived polymorphic alleles for inferences of extended haplotype homozygosity in human populations.
Alessandro Lisi, Michael C. Campbell·BioinformaticsPeer-reviewed·Apr 11, 2025