hello,
I'm dealing with DEG dataset which contains many NAs in certain treatments from RNA-seq analysis, and gonna make a heatmap in R. when I used the ComplexHeatmap package in R, following error was poping up:
Error in hclust(get_dist(t(submat), distance), method = method):NA/NaN/Inf in foreign function call (arg 10)
my dataset as below:
gene 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
3L 2.64 3 -0.98 -1.79 NA -1.42 3.38 3.74 3.47 4.03 -0.89 -1.27 -0.89 0.9 1.25 NA NA
6L NA 1.79 NA NA -0.85 NA 3.15 0.99 0.73 1.87 NA NA NA NA 0.68 1.35 1.38
9L 2.59 4.44 1.43 1.53 NA NA 4.51 5.23 4.1 4.32 NA NA NA NA 1.3 NA NA
The code I used in R was simply:
mat <- read.table("path_of_txt", na.strings = "NA")
mat <- data.matrix(mat)
Heatmap(mat)
after searching around the internet for the solution from similar questions, I figure the problem may resulted from the internal function of ComplexHeatmap -hclust- being unable to calculate the distance between certain samples of my data (for example,via method which basically remove the NA value, distance of column 5 and 6 would be turned out as NA?). But I don't know what I could do to modify my dataset in order to fit the package setting or what parameters in the package could I specify to avoid this error.
appreciate any help:)
What are these values?
log2foldchange of DEGs