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)
Thanks in advance!
edit. Why is adding a picture so hard on this site??