getLD {trio} | R Documentation |
Computes the value of D' and r^2 for each pair of SNPs in a matrix.
getLD(x, which = c("both", "rSquare", "Dprime"), iter = 50, snp.in.col = TRUE, asMatrix = FALSE, addVarN = FALSE)
x |
a numeric matrix consisting of 0, 1, and 2, where it is assumed that
the values represent the numbers of minor alleles that the SNPs show. Missing values
are allowed. By default, each column represents a SNP and each row a subject.
This can be changed by setting snp.in.col = FALSE . The SNPs should be ordered
by their position on the considered chromosome.
|
which |
which LD measures should be computed? Either "rSquare" , or "Dprime" ,
or the values of "both" measures are computed. The latter is the default.
|
iter |
integer specifying how many iterations are used in the procedure of Hill (1974) which is used to estimate D. |
snp.in.col |
logical indicating whether each column of x represents a SNP (and each row a
subject). If FALSE , each row represents a SNP (and each column a subject).
|
asMatrix |
logical indicating whether the LD values are returned as a m x m matrix,
where m is the number of SNPs. If FALSE , the LD values are returned as a vector
of length m * (m - 1) / 2.
|
addVarN |
logical indicating whether for each pair of SNPs the number of non-missing values
and the variance estimates of D' proposed by Zabaleta et al. (1997) should be added to the output. The
variance estimates are required for the identification of LD-blocks with findLDblocks .
|
An object of class getLD
consisting (depending of the specification of which
) the
D' (Dprime
) or r^2 (rSquare
) values for each SNP pair, and (depending of the specification
of addVarN
) the variance estimates for D' (varDprime
) and the numbers of non-missing values
(n
). Furthermore, the names of the SNPs (rn
) will be added if asMatrix = FALSE
.
Holger Schwender, holger.schwender@udo.edu
Hill, W.O. (1974). Estimation of Linkage Disequilibrium in Randomly Mating Populations. Heredity, 33, 229-239.
Zapata, C., Alvarez, G., and Carollo, C. (1997). Approximate Variance of the Standardized Measure of Gametic Disequilibrium D'. American Journal of Human Genetics, 61, 771-774.
## Not run: # Andrea's data data(mat) out <- getLD(mat, addVarN=TRUE) # Plot r^2 plot(out) # Plot r starting with SNP 24 and ending with SNP 60. plot(out, squared=FALSE, start=24, end=60) # Now the same for D'. plot(out, "Dprime", start=24, end=60) # Now Gabriel's categories starting with SNP ABI.355 # and ending with SNP CRC.45. plot(out, "gabriel", start="ABI.355", end="CRC.45") ## End(Not run)