Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I am trying to create a heatmap with gene expression values with the package pheatmap in R. I have used the code numerous times and never had a problem untill today. It seems when I do the scale="row" , I end up with this error. I cannot create the z-scores. So probably some rows have no variability for which this is happening. How can I get rid of this. The matrix is having 1100 rows and 9 columns. My code:
data <- read.table("~path/DEGs_DESeq.txt",sep="\t")
data2 <- as.matrix(data[,2:9])
data3 <- data2[-1,]
samples <- data2[1,]
genes <- data[2:length(data2[,1]),1]
vett <- as.numeric(data3)
data4 <- matrix(vett, length(genes), length(samples), dimnames=list(paste(genes),paste(samples)))
head(data4)
pheatmap(as.matrix(data4), col=bluered(200), scale="row", key=T, keysize=1.5,
density.info="none", trace="none",cexCol=0.6, fontsize_row=8, fontsize_col=10)
Error in hclust(d, method = method) :
NA/NaN/Inf in foreign function call (arg 11)
How can I get rid of this error?
–
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.