首页 > 解决方案 > 制作热图时 hclustfun(distMatrixR, method = method) 出错

问题描述

我正在尝试使用 pastebin 中的以下数据创建热图:https ://pastebin.com/rZE0nEmc 。但是我在 hclustfun(distMatrixR, method = method) 中收到错误错误:外部函数调用中的 NA/NaN/Inf (arg 10) 另外:警告消息:在 cor(t(x), use = "pa") :标准偏差为零,我无法解决问题。我附上了我目前拥有的代码

library("gplots")
library("heatmap3")
library("RColorBrewer")
library("readxl")
colfunc <- colorRampPalette(c("mistyrose", "red"))

Data <- read_excel("TE_polymophism.xlsx")
# N=100
# Data <- Data[sample(nrow(Data), N), ]
# Data <- Data[order(Data$svtype),]

Data <- Data[,2:ncol(Data)]
Data <- log2(Data+1)
colnames(Data) <- c("AraucanaWhite","Cornell2", "ACRB30Weeks", "Luoyangwu","RedJungleFowl", "Tibetan")
Data_final <- as.matrix(Data)

pdf("TE_polymophism.pdf", height = 10, width = 10)
par(oma=c(1,1,1,1))

heatmap3(Data_final,
         Colv=T, #To keep the column order (sample order), cluster the genes
         scale="none",
         hclustfun = ,
         labRow=" ",
         cexCol = 0.9,
         key=TRUE,#Show color key
         density.info="none",trace="none", na.rm=TRUE)
dev.off()

标签: rggplot2colorsheatmap

解决方案


推荐阅读