颜色是不是取反了,你检查一下;
dissTOM = 1-TOMsimilarityFromExpr(datExpr, power = sft$powerEstimate)
plotTOM = dissTOM^7
diag(plotTOM) = NA
TOMplot(plotTOM, geneTree, moduleColors, main = "Network heatmap plot, all genes")
nSelect = 400
set.seed(10);
select = sample(nGenes, size = nSelect);
selectTOM = dissTOM[select, select];
selectTree = hclust(as.dist(selectTOM), method = "average")
selectColors = moduleColors[select]
plotDiss = selectTOM^7;
diag(plotDiss) = NA;
TOMplot(plotDiss, selectTree, selectColors, main = "Network heatmap plot, selected genes")
这是代码文件