我有这样的树形图热像图.
完整的数据在这里.
问题是左边的树状图被压扁了.如何在不改变热图的列大小的情况下取消(展开)它?
它是使用以下代码生成的:
#!/usr/bin/Rscript
library(gplots);
library(RColorBrewer);
plot_hclust <- function(inputfile,clust.height,type.order=c(),row.margins=70) {
# Read data
dat.bcd <- read.table(inputfile,na.strings=NA, sep="\t",header=TRUE);
rownames(dat.bcd) <- do.call(paste,c(dat.bcd[c("Probes","Gene.symbol")],sep=" "))
dat.bcd <- dat.bcd[,!names(dat.bcd) %in% c("Probes","Gene.symbol")]
dat.bcd <- dat.bcd
# Clustering and distance function
hclustfunc <- function(x) hclust(x, method="complete")
distfunc <- function(x) dist(x,method="maximum")
# Select based on FC, as long as any of them >= anylim
anylim <- 2.0
dat.bcd <- dat.bcd[ apply(dat.bcd, 1,function(x) any (x >= anylim)), ]
# Clustering functions
height <- clust.height;
# Define …Run Code Online (Sandbox Code Playgroud)