heatmap.2 reorder branches
1
0
Entering edit mode
b.nota ▴ 340
@bnota-7379
Last seen 12 months ago
Netherlands

Hello,

I am using hierarchical clustering with heatmap.2, and would like to reorder the tree generated for the columns. I have searched here, on Biostars, and on google but don't seem to find the right solution. Wondering if someone here knows how to manipulate the tree.

In more detail, I have clustered with the following code, and the column tree is perfect, except that I would like the red group left of the blue one (so between green and blue). I know from evolution biology class that these branches in theory can be turned (like a baby mobile). But I don't know how to do this with heatmap.2, I guess I would have to use the reorderfun, but don't know how?

heatmap.2(z_RPKM_ro, key = TRUE, col=blueyellow, density.info=c("none"),
scale = c("none"), trace=c("none"), cexCol=1, cexRow=0.7, key.xlab="Row Z-score",
hclustfun = function(x) hclust(x, method = "ward.D"), dendrogram="both",
distfun = function(x) dist(x, method = "euclidean"),
labRow = F, RowSideColors = colorset, ColSideColors = colorBar2)

Ben

edit. Why is adding a picture so hard on this site??

heatmap.2 hclust reorderfun • 1.1k views
0
Entering edit mode
@james-w-macdonald-5106
Last seen 12 hours ago
United States

Please note that heatmap.2 is part of gplots, which itself is a CRAN package, not Bioconductor. Questions about CRAN packages should be directed to r-help@r-project.org.