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
Is this imputed data?
no, the data is not imputed. Where there are 0, there were originally 'nan'
I see, this is actual LD output values ranging 0-1. The LDHeatmap works with genotype data, e.g.:
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.
Yes, you are right, just tried a dummy matrix and it works, something must be wrong with your input matrix. Try this example:
Also, add your code that gives an error.