SnpMatrix
object, or from two different SnpMatrix
objects. Statistics which can be calculated are the
log likelihood ratio, odds ratio, Yule's Q, covariance, D-prime,
R-squared, and R.
ld(x, y = NULL, depth = NULL, stats, symmetric = FALSE)
SnpMatrix
or XSnpMatrix
x
. If y
is supplied, LD statistics are calculated between each column of
x
and each column of y
. Otherwise, they are calculated
between columns of x
y
is not supplied, this parameter is mandatory and
controls the maximum lag between columns of x
considered. Thus, LD statistics are calculated between x[,i]
and x[,j]
only if i
and j
differ by no more
than depth
"LLR"
,
"OR"
, "Q"
, "Covar"
, "D.prime"
,
"R.squared"
, ad "R"
y
argument is supplied this argument controls the format of
the output band matrices. If TRUE
, symmetric matrices are
returned and, otherwise, an upper triangular matrices are returned
y
is not supplied), or as conventional
rectangular matrices (when y
is supplied). Band matrices are
stored in compressed form as objects of class dsCMatrix
(symmetric) or dgCMatrix
(upper triangular). These classes are
defined in the "Matrix"
package)
"Matrix-class"
data(testdata)
ld1 <- ld(Autosomes[, 1:50], depth=10, stats=c("D.prime", "R.squared"))
ld2 <- ld(Autosomes[, 1:20], Autosomes[, 21:25], stats="R.squared")
Run the code above in your browser using DataLab