This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Calculate P-Value Of Ld Using Ldheatmap Package In R

Does anyone know a way to calculate the p-values for the corresponding r2 and D' output of LDheatmap?

Thanks

r snp

1 answer

This is now a bit old, but I just saw it - the best way to get to the p-values is not to use LDHeatmap, but to use LD() of the "genetics" library. I don't think LDheatmap even has the capacity of giving you the p-values directly, the reference says nothing.

library(LDHeatmap)
# this is probably how you did it
genotypes <- read.csv("some_file")
LDheatmap(genotypes)

# this is easier
library(genetics)
results <- LD(genotypes)
head(results$p.value) # gives you the beginning of the p-values
head(results$D) # gives you the beginning of D

Log in to answer this question.