getLD
computes the value of D' and r^2 for each pair of SNPs in a matrix,
getLDlarge
determines D' and r^2 between each SNP and a user-specified number of SNPs
closest to the SNP on the corresponding chromosome. Thus, getLDlarge
can be applied
to much more SNPs than getLD
.
getLD(x, which = c("both", "rSquare", "Dprime"), parentsOnly = FALSE, iter = 50, snp.in.col = TRUE, asMatrix = FALSE, addVarN = FALSE) getLDlarge(x, neighbors=25, which=c("both", "rSquare", "Dprime"), parentsOnly=FALSE, iter=50, snp.in.col=TRUE, addVarN=FALSE)
snp.in.col = FALSE
. It is assumed that the SNPs are ordered
by their position on the considered chromosome.
neighbors
columns of x
), 2 * neighbors
r^2 or D' values are computed.
"rSquare"
, or "Dprime"
,
or the values of "both"
measures are computed. The latter is the default.
x
, should be used in the computation of the LD measures when x
is in genotype format and contains case-parent trio data (see ped2geno
and read.pedfile
).
If FALSE
(default), all rows are used in the determination of the pairwise LD measure.
x
represents a SNP (and each row a
subject). If FALSE
, each row represents a SNP (and each column a subject).
FALSE
, the LD values are returned as a vector
of length $m * (m - 1) / 2$.
findLDblocks
.
getLD
or getLDlarge
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 (in getLD
, if asMatrix = FALSE
).plot.getLD
, findLDblocks
# Load the simulated data.
data(trio.data)
# The values of Dprime and Rsquare for each pair of SNPs
# in LDdata can be computed by
ld.out <- getLD(LDdata)
# By default, the LD measures are returned as a vector.
# If they should be returned as a matrix, then use
ld.out2 <- getLD(LDdata, asMatrix = TRUE)
Run the code above in your browser using DataLab