Description Usage Arguments Details Value Author(s) See Also Examples
Compute the linkage disequilibrium (LD) between a pair of loci.
1 |
x |
A numeric vector. The haplotype/genotype data of the first locus. If they are phased, there must only contain 0 and 1. If they are unphased, they must only contain 0, 1, or 2, where 1 codes for the heterozygot. |
y |
A numeric vector. The haplotype/genotype data of the second locus. |
is_phased |
A logical. Are the data phased? |
any_na |
A logical. May some genotypes contain missing values? If not, computations are more efficient for phased genotypes. |
r_only |
Should only the r-statistic be computed? (Produces minimal output for saving memory and computation time.) |
check |
A logical. Should checks be performed? |
For computing LD among a large number of loci, please use
LD_mult
, which is much more efficient for that.
Linkage disequilibrium (LD) is the non-random association of marker alleles and can arise from marker proximity or from selection bias.
Three estimators of LD are computed:
D raw difference in frequency between the observed number of AB pairs and the expected number:
D = p(AB) - p(A)*p(B)
D' scaled D spanning the range [-1,1]
D' = D / Dmax
where, if D > 0:
Dmax = min( p(A)p(b), p(a)p(B) )
or if D < 0:
Dmax = max( -p(A)p(B), -p(a)p(b) )
r correlation coefficient between the markers
r = -D / sqrt( p(A) * p(a) * p(B) * p(b) )
where
- p(A) is defined as the observed probability of allele 'A' for marker 1,
- p(a) = 1-p(A) is defined as the observed probability of allele 'a' for marker 1,
-p(B) is defined as the observed probability of allele 'B' for marker 2, and
-p(b) = 1- p(B) is defined as the observed probability of allele 'b' for marker 2, and
-p(AB) is defined as the probability of the marker allele pair 'AB'.
For genotype data, AB/ab cannot be distinguished from aB/Ab. Consequently, we estimate p(AB) using maximum likelihood and use this value in the computations.
LD
returns a list with the following components:
D Linkage disequilibrium estimate
Dprime Scaled linkage disequilibrium estimate
r Correlation coefficient
r2 Squared correlation coefficient
n Number of observations
chis2 Chi-square statistic for linkage equilibrium (i.e., D = Dprime = r = r2 = 0)
pval Chi-square p-value for marker independence
Dominik Mueller (dominikmueller64@yahoo.de) The documentation is adapted from the LD function of the genetics package by Gregory Warnes.
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.