L_plus_R.Rd
Returns the \({|L| \choose 2} + {|R| \choose 2}\) value for each SNP location supplied to the function. |L|
and |R|
are the number of SNPs to the left and right of the current locus within the given window ws
.
For more information about the L_plus_R
diversity statistic, please see Jacobs (2016).
L_plus_R(pos, ws, X = NULL)
pos | A numeric vector of SNP locations |
---|---|
ws | The window size which the |
X | Optional. Specify a region of the chromosome to calculate |
A list containing the SNP positions and the L_plus_R
values for those SNPs
Jacobs, G.S., T.J. Sluckin, and T. Kivisild, Refining the Use of Linkage Disequilibrium as a Robust Signature of Selective Sweeps. Genetics, 2016. 203(4): p. 1807
## load the snps example dataset data(snps) ## run L_plus_R over all the SNPs with a window size of 3000 bp L_plus_R(snps$bp_positions,3000)#> $position #> [1] 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 #> [16] 1600 1700 1800 1900 2000 #> #> $L_plus_R #> [1] 105 105 106 108 111 101 93 87 83 81 81 83 87 93 101 111 108 106 105 #> [20] 105 #>## only return results for SNPs between locations 600 and 1500 bp L_plus_R(snps$bp_positions,3000,X=c(600,1500))#> $position #> [1] 600 700 800 900 1000 1100 1200 1300 1400 1500 #> #> $L_plus_R #> [1] 101 93 87 83 81 81 83 87 93 101 #>