Question: Extract Dendrogram Information From Heatmap Generated By Heatmap.2
1
gravatar for Ming Tang
5.6 years ago by
Ming Tang2.4k
Houston/MD Anderson Cancer Center
Ming Tang2.4k wrote:

Hi all,

I am having a hard time to extract the corresponding subgroup members in the heatmap generated by heatmap.2 in gplots. I have looked here: http://stackoverflow.com/questions/15388082/understanding-heatmap-dendogram-clustering-in-r and http://stackoverflow.com/questions/11489696/how-to-know-about-group-information-in-cluster-analysis-hierarchical and here https://stat.ethz.ch/pipermail/bioconductor/2007-December/020521.html

I have a matrix m, the heatmap can be generated by

heatmap.2(m, colv=FALSE, dendrogram= "row", trace="none")

it gave me very good looking heatmap, now I want to extract the subgroup members.

I know I can use hclust and cutree to extract the information:

hc.rows<- hclust(dist(m))

plot(hc.rows) # it gives me just the dendrogram, and it looks the same as the dendrogram appeared in the heatmap, only differ in the order. it seems to me the order is reversed.

I can cut the tree based on either the number of group (k), or the height (h)

ct<- cutree(hc.rows, h=10) # it gives me 6 groups

rect.hclust(hc.rows, h=10) # draw red rectangles to mark the subgroups

table(ct)

ct

1 2 3 4 5 6

196 248 294 119 42 4

I can get the labels of each row, and the assigned the group number by:

tableclust<- data.frame(m,ct)

my question is that how do I map the cluster number here back to the dendrogram? cluster 6 has 4 members, but it looks like to me cluster 6 appears in the most left of the dendrogram, cluster 5 has 42 members, it appears in the second most left (based on the width of the red rectangle in the dendrogram), cluster 4 has 119 members, but it appears not next to cluster 5....

enter image description here

I am confused.....

Thanks for your advice.

Tommy Tang

heatmap • 15k views
ADD COMMENTlink modified 3.2 years ago by kanika.15150 • written 5.6 years ago by Ming Tang2.4k
1
gravatar for kanika.151
3.2 years ago by
kanika.15150
United States
kanika.15150 wrote:

use svg(width=50) option. Increase it for bigger width. How To Get The Clear Values At The Bottom Of A Dendrogram In Clustering In R?

ADD COMMENTlink written 3.2 years ago by kanika.15150
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2119 users visited in the last hour