Parameter assumptions

c=1E-7 # recombination rate per bp
s=0.01 # selection coefficient
G=2.1E9 # genome size
snps=1E5 # number of SNPs
fragment=60 # each SNP represents a 60 bp fragment

Calculations

Basic naive sweep model (Hudson and Kaplan) gives length of sweep \(L=\frac{0.02s}{c}\)

L=0.02*s/c

and our data represent \(x=\frac{snps\,\times\,fragment}{G}\) proportion of the genome

x=snps*fragment/G

If we represent the nonindependence of bp by dividing sweepsize by fragment length, our probability of missing a sweep is \((1-x)^\frac{L}{fragment}\):

p=(1-x)^(L/fragment)

And for us to have 80% power to dectect at least one sweep, there need to be at least \(n\) shared sweeps, where \(n=\frac{log(1-power)}{log(p)}\)

power=0.8
round(log(1-power)/log(p))
## [1] 17