Zalpha {zalpha}R Documentation

Runs the Zalpha function

Description

Returns a ZαZ_{\alpha} value for each SNP location supplied to the function. For more information about the ZαZ_{\alpha} statistic, please see Jacobs (2016). The ZαZ_{\alpha} statistic is defined as:

Zα=(L2)1i,jLri,j2+(R2)1i,jLri,j22Z_{\alpha}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}r^2_{i,j} + {|R| \choose 2}^{-1}\sum_{i,j \in L}r^2_{i,j}}{2}

where |L| and |R| are the number of SNPs to the left and right of the current locus within the given window ws, and r2r^2 is equal to the squared correlation between a pair of SNPs

Usage

Zalpha(pos, ws, x, minRandL = 4, minRL = 25, X = NULL)

Arguments

pos

A numeric vector of SNP locations

ws

The window size which the ZαZ_{\alpha} statistic will be calculated over. This should be on the same scale as the pos vector.

x

A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the pos vector. SNPs should all be biallelic.

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αZ_{\alpha} for in the format c(startposition, endposition). The start position and the end position should be within the extremes of the positions given in the pos vector. If not supplied, the function will calculate ZαZ_{\alpha} for every SNP in the pos vector.

Value

A list containing the SNP positions and the ZαZ_{\alpha} values for those SNPs

References

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

Examples

## load the snps example dataset
data(snps)
## run Zalpha over all the SNPs with a window size of 3000 bp
Zalpha(snps$bp_positions,3000,as.matrix(snps[,3:12]))
## only return results for SNPs between locations 600 and 1500 bp
Zalpha(snps$bp_positions,3000,as.matrix(snps[,3:12]),X=c(600,1500))


[Package zalpha version 0.3.0 Index]