Zbeta.Rd
Returns a \(Z_{\beta}\) value for each SNP location supplied to the function.
For more information about the \(Z_{\beta}\) statistic, please see Jacobs (2016).
The \(Z_{\beta}\) statistic is defined as:
$$Z_{\beta}=\frac{\sum_{i \in L,j \in R}r^2_{i,j}}{|L||R|}$$
where |L|
and |R|
are the number of SNPs to the left and right of the current locus within the given window ws
, and \(r^2\) is equal to the squared correlation between a pair of SNPs
Zbeta(pos, ws, x, minRandL = 4, minRL = 25, X = NULL)
pos | A numeric vector of SNP locations |
---|---|
ws | The window size which the \(Z_{\beta}\) statistic will be calculated over. This should be on the same scale as the |
x | A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the |
minRandL | Minimum number of SNPs in each set R and L for the statistic to be calculated. Default is 4. |
minRL | Minimum value for the product of the set sizes for R and L. Default is 25. |
X | Optional. Specify a region of the chromosome to calculate \(Z_{\beta}\) for in the format |
A list containing the SNP positions and the \(Z_{\beta}\) 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 Zbeta over all the SNPs with a window size of 3000 bp Zbeta(snps$bp_positions,3000,as.matrix(snps[,3:12]))#> $position #> [1] 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 #> [16] 1600 1700 1800 1900 2000 #> #> $Zbeta #> [1] NA NA NA NA 0.1280042 0.1298619 0.1219965 #> [8] 0.1071535 0.1124896 0.1121871 0.1033178 0.1185118 0.1212802 0.1281512 #> [15] 0.1275420 0.1442328 NA NA NA NA #>## only return results for SNPs between locations 600 and 1500 bp Zbeta(snps$bp_positions,3000,as.matrix(snps[,3:12]),X=c(600,1500))#> $position #> [1] 600 700 800 900 1000 1100 1200 1300 1400 1500 #> #> $Zbeta #> [1] 0.1298619 0.1219965 0.1071535 0.1124896 0.1121871 0.1033178 0.1185118 #> [8] 0.1212802 0.1281512 0.1275420 #>