compute_ld | R Documentation |
This function computes linkage disequilibrium (LD) for a set of selected loci.
The measure can be either r2, r2v, r2s, or r2vs. Function ld
from
package snpStats
is used when computing r2, whereas r2 values corrected
with kinship data (r2v), population structure (r2s), or both (r2vs) make use
of function LD.Measures
from package LDcorSV
.
compute_ld(snp_data, measure, kinship = NULL, structure = NULL)
snp_data |
A list of SNP data comprising at least an element called
|
measure |
A character of length one. The r2 measure that was used
for computing the linkage disequilibrium values in |
kinship |
A square numeric matrix of kinship values with as many rows and
columns as there are individuals included in the analysis. More specifically,
|
structure |
A numeric matrix with as many rows as there are individuals in the analysis and as many columns as there are putative subpopulations in the dataset. |
An error will be thrown if the function is asked to compute an r2 measure without all required inputs (kinship and/or structure data). If kinship and/or structure data are given as input but the computed measure makes no use of these data, they will be ignored with a warning.
A list with two components :
LD A symmetric Matrix of class dsCMatrix
containing linkage
disequilibrium values for all marker pairs.
LD_measure A character of length one. The r2 measure that was used
for computing the linkage disequilibrium values in LD
. Can be either
"r2"
, "r2v"
, "r2s"
, "r2vs"
.
NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.