ld.snp3 {Relate}R Documentation

Function to calculate pairwise D', r-squared, but also haplotype frequencies

Description

ld.snp3 takes an genotype matrix and a suitable depth LOD and returns a list of r-square, lods and pba's.

Usage

ld.snp3(snpdata, back = 100)

Arguments

snpdata An genotype matrix with M samples of N snps
back The depth or lag of pair-wise calculation. Should be between 1 and N-1; default 100.

Details

This function was used during development and is quite borrowed from the snpMatrix function called ld.snp(). The cubic equation and quadratic equation solver code is borrowed from GSL (GNU Scientific Library).

Value

dprime D'
rsq2 $r^2$
r signed $r$
lod Log of Odd's

All the matrices are defined such that the ($n, m$)th entry is the pair-wise value between the ($n$)th snp and the $(n+m)$th snp. Hence the lower right triangles are always filled with zeros. (See example section for the actual layout)
Invalid values are represented by an out-of-range value - currently we use -1 for D', $r^2$ (both of which are between 0 and 1), and -2 for $r$ (valid values are between -1 and +1). lod is set to zero in most of these invalid cases. (lod can be any value so it is not indicative).

Author(s)

Thorfinn Sand thorfinn@binf.ku.dk

References

Anders albrechtsen, Thorfinn Sand Korneliussen Clayton, D.G. and Leung, Hin-Tak (2007) An R package for analysis of whole-genome association studies. Human Heredity 64:45-51.
GSL (GNU Scientific Library) http://www.gnu.org/software/gsl/


[Package Relate version 0.987 Index]