LDheatmap will not accept LD matrix from Plink
1
4
Entering edit mode
9.6 years ago

I get error message "column 1 is not a genotype object" in LDheatmap in R when I load an LD matrix generated in Plink. Obviously, I am well aware that column 1 is not a genotype object, however I don't understand how I communicate this to R. The manual has some examples with genotype data, and frequently states that "For gdat, any square matrix with values between 0 and 1 inclusive can be passed, and the value above the diagonal will be plotted". however no examples include an LD matrix and none of the commands work.

Here, are the first columns and rows in the matrix:

1            0.001685     0.135168     0        0.003753
0.001685     1            0.170858     0        0.024787
0.135168     0.170858     1            0        0.079526
0            0            0            0        0
0.003753     0.024787     0.079526     0        1

Any help and advice is appreciated,

Cheers
Ingerid

genome SNP R • 6.9k views
ADD COMMENT
0
Entering edit mode

Is this imputed data?

ADD REPLY
0
Entering edit mode

no, the data is not imputed. Where there are 0, there were originally 'nan'

ADD REPLY
0
Entering edit mode

I see, this is actual LD output values ranging 0-1. The LDHeatmap works with genotype data, e.g.:

rs4615512     rs2283089     rs1894731
T/C           C/C           A/A
T/C           C/T           A/A
T/C           C/C           A/A
ADD REPLY
1
Entering edit mode

Yes, but then why does the manual state that "The input data set can be a data frame containing SNP genotypes, a matrix of pairwise LD measurements, or an LDheatmap object returned by the function LDheatmap()". I have a matrix of pairwise LD measurements but clearly LDheatmap does not like it.

ADD REPLY
0
Entering edit mode

Yes, you are right, just tried a dummy matrix and it works, something must be wrong with your input matrix. Try this example:

LDheatmap(matrix(runif(100,0,1),nrow = 10))

Also, add your code that gives an error.

ADD REPLY
5
Entering edit mode
9.6 years ago
janinajeff ▴ 50

Hi there,

I just ran into the same problem. When you load into R you have to specify

LD <-as.matrix(read.table(myLDdata.matrix))
LDheatmap(LD)

Hopefully this works!

ADD COMMENT

Login before adding your answer.

Traffic: 2127 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6