LDmeasure | R Documentation |
Functions for computing LD measures for predefined (or estimated) allele frequency values and a predefined (or estimated) disequilibrium coefficient value.
Dcoef(pA1, pA2, D)
Dprime(pA1, pA2, D)
r2(pA1, pA2, D)
pA1 |
Allele frequency for the first SNP |
pA2 |
Allele frequency for the second SNP |
D |
Disequilibrium coefficient |
The LD measures available in GUSLD are:
Dcoef
The disequilibrium coefficient \insertCitelewontin1960evolutionGUSLD
defined as D=p_{A_1A_2}-p_{A_1}p_{A_2}
Dprime
The normalized disequilibrium coefficient \insertCitelewontin1964geneticsGUSLD defined as
D'=D/D_{max}
where D_{max} = min(p_{A_1}p_{A_2},(1-p_{A_1})(1-p_{A_2}))
if D>0
and
D_{max} = min(p_{A_1}(1-p_{A_2}),(1-p_{A_1})p_{A_2})
r2
The squared correlation coefficient \insertCitehill1968TAGGUSLD defined as
r^2=D^2/\sqrt{p_{A_1}p_{A_2}(1-p_{A_1})(1-p_{A_2})}
where p_{A_1A_2}
is the probability of observing a haplotype containing the reference allele at both loci,
p_{A_1}
is the major allele frequency at the first SNP and p_{A_2}
is the allele
frequency at the second SNP.
One can also specify their own LD measure (see examples below).
A numeric value giving the value of the LD measure
Timothy P. Bilton
Dcoef(0.25,0.25,0.1)
Dprime(0.25,0.25,0.1)
r2(0.25,0.25,0.1)
## One can also define there own LD measure which GUSLD can use
## e.g., the correlation coefficient
LD_r <- function(pA1,pA2,D){
return( D/sqrt((prod(c(pA1,pA2,1-c(pA1,pA2))))) )
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.