szpiech / selscan

Haplotype based scans for selection
GNU General Public License v3.0
109 stars 33 forks source link

Request: alternate version of XP-EHH for better performance on incomplete sweeps #27

Closed lasugden closed 4 years ago

lasugden commented 6 years ago

The current implementation of XP-EHH uses the formula from Sabeti et al. (2007) for EHH, with (N choose 2) in the denominator. There is an alternate version that can be found in the supplement of Wagh et al. 2012 (http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0044751#s6) (supplementary note here: http://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0044751.s011&type=supplementary), and I wonder if you would be willing to implement it as an optional flag? The difference is in the denominator of EHH: (N_A choose 2) + (N_a choose 2) where N_A and N_a are the numbers of chromosomes with each of the alleles at the core SNP. The benefit of this definition is that the denominator is the number of pairwise comparisons that could possibly be identical given the alleles at the core SNP, instead of just the total number of possible pairwise comparisons. This makes it much more sensitive for ongoing sweeps in which the beneficial allele has not yet swept through most of the population (and so the number of pairwise comparisons is greater than the number of those comparisons that could possibly result in a match). I have already implemented this in my forked repository by adding in a few lines in selscan-main.cpp if this is helpful. Thanks!!

szpiech commented 6 years ago

Could you initiate a pull-request? I'll look it over and work on merging it. Cheers!

lasugden commented 6 years ago

I just initiated a pull request -- let me know if I can make things more clear!

Thanks so much!

szpiech commented 4 years ago

Two years later, but it's finally in the master branch.

lasugden commented 4 years ago

I noticed! I am extremely grateful, thank you!

On Mon, Jun 1, 2020 at 10:09 AM Zachary A Szpiech notifications@github.com wrote:

Two years later, but it's finally in the master branch.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/szpiech/selscan/issues/27#issuecomment-636913246, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACL5BKR4JLF5QCZSYZOFZWLRUPACXANCNFSM4EXV6ZIQ .