This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Colsep for dendrogram and ColSideColors in heatmap.2

Hi dear community,

I created a heat map of DE genes from my RNA-Seq experiment with the heatmap.2 function. I would like to seperate the two main clusters in my heat map visually.

I managed to seperate the columns using the colsep and sepwidth arguments of the function but cant manage to seperate the dendrogram or the colours of the groups.

col.pan <- colorpanel(100, "blue", "white", "red")
colrow.colors <- case_when(
  colnames(logCPM) == "No" ~ "yellow",
  colnames(logCPM) == "Yes" ~ "red"
)

heatmap_plot <- heatmap.2(logCPM, 
          col = col.pan,
          Rowv = TRUE,
          scale = "none",
          trace = "none", 
          dendrogram = "column", #both 
          cexRow = 5, 
          cexCol = 5, 
          density.info = "none",
          margin = c(10, 30),
          ColSideColors = colrow.colors,
          labCol = "",
          lhei = c(0.85, 6.8),
          lwid = c(2.5, 20),
          keysize = c(0.6),
          key.par = list(cex = 3),
          labRow = NA,
          colsep = c(40),
          sepwidth = c(2, 5),
          distfun = function(x) dist(x, method="euclidean"),
          hclustfun = function(x) hclust(x, method="ward.D2")
          )

Heatmap generated with the code

heatmap dge edger heatmap.2

0 answers

No answers yet.

Log in to answer this question.