Github repository: SelectionHapStats

SelectionHapStats is a repository of Python scripts written to identify natural selection events in the genome and R scripts written to visualize the signatures of selective sites. The python code provided calculates haplotype homozygosity statistics H12 and H2/H1 in a genome-wide scan, as well as identified H12 peaks in genomic data. The R code provided visualizes the haplotype frequency spectra for the top peaks in the data and the genome-wide scan of H12.

This code presented in this repository is based on the arXived paper, Recent selective sweeps in North American Drosophila melanogaster show signatures of soft sweeps (

Check out my blog post for further description on the project and examples of visual output from the code!