[BioC] Question: how to obtain the clusters of genes (basically the ones in the row dendrograms) from an object obtained by heatmap.2 function

Wolfgang Huber whuber at embl.de
Fri Sep 17 16:11:48 CEST 2010


the function "cut.dendrogram" from the "stats" package does what you 
want. It's described in the manual page of the "dendrogram" class. Try 
typing, in R:

  ? dendrogram

Best wishes


On Sep/16/10 12:57 PM, Sunny Srivastava wrote:
> Hello Bioconductor Helpers,
> I have a question about extracting the clusters of genes after we make the
> heatmap (say ht4) using the heatmap.2 function. Basically, I want to get the
> clusters which are shown as row dendrogram in the heatmap.
> I understand that ht4$rowDendrogram is an object of dendrogram and it
> containes details of all the nodes and branches, but lets say I want to know
> the number of clusters and the genes in each cluster if I terminated the
> tree (dendrogram) at a particular height. Also, if I know that I want 12
> clusters, how do I know which height I should terminate the tree (or
> branching structure)
> I am sorry I am not clear. Please let me know if you need any further
> clarifications. Thanks in advance for your help.
> Best Regards,
> S.
> Below is the dump of the matrix *row.scaled.fc2* and the object *ht4* which
> was obtained by using the heatmap.2 function.

Wolfgang Huber

More information about the Bioconductor mailing list