heatmap.2 reorder branches
1
0
Entering edit mode
b.nota ▴ 360
@bnota-7379
Last seen 3.6 years 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)

Thanks in advance!

Ben

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

https://drive.google.com/open?id=0ByVMqlqqt462WGtjX0FBLVRYdGc

 

heatmap.2 hclust reorderfun • 1.7k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen just now
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.
 

ADD COMMENT

Login before adding your answer.

Traffic: 1057 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6