[R] calculating of linkage-disequilibrium measures?
Scott D Chasalow
scott.chasalow at bms.com
Fri Mar 4 17:03:46 CET 2005
Taking a lead from Brian, the answer is "yes". :-)
But just in case you were seeking a somewhat more detailed answer:
If phase is known, it is not only possible to compute all these LD
measures in R, it is much simpler.
For example, if you have alleles A and a at locus 1, and B and b at
locus 2, and you let p(i) = relative frequency of gamete genotype i,
then D = p(AB) - p(A)p(B). If you have these relative frequencies
stored e.g. in a matrix, you don't really need a special function to
compute D. D' is marginally more complicated, and worth a function.
(Unfortunately, I am not at present at liberty to send you mine. But
I'm working on that.) The R^2 statistic typically used in this context
is, for 2-allele loci, simply X2/N, where X2 is the Pearson X2 statistic
to test for association in the 2x2 table, and N is the number of
gametes. You might find function chisq.test of interest. Although, if
you want to do this for 100,000s of locus pairs, there are MUCH faster ways.
Cheers,
Scott
Bettina Kulle wrote:
> Hi ,
> is it possible to calculate ld-measures D, D', r and
> perhaps corresponding p-values with r IF THE
> PHASE IS KNOWN?
> The genetics - package provides the LD function
> only for ambigious phase.
>
> Thank you very much
>
> Bettina Kulle
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list