Search
Question: extracting the genes associated with the clusters
2
gravatar for Bogdan
19 months ago by
Bogdan520
Palo Alto, CA, USA
Bogdan520 wrote:

Dear all,

after clustering a gene expression dataset, please can you advise, how can i extract the group of gene names corresponding to  the dendrogram ? thanks,

 

bogdan

 

ADD COMMENTlink modified 19 months ago by Gavin Kelly560 • written 19 months ago by Bogdan520
6
gravatar for Gavin Kelly
19 months ago by
Gavin Kelly560
United Kingdom / London / Francis Crick Institute
Gavin Kelly560 wrote:

I guess you mean extract the names of genes that correspond to parts of the dendrogram?

It depends on which method you use to create the dendrogram.  If you've got one, such as pheatmap, that returns the hclust objects, then you can use cutree to get the labels of the genes.  So it's just a question of extracting the hclust object from your method of generating the clusters, or recreating the same dendrogram if your clustering plot doesn't return it.  e.g

pl <- pheatmap(...)

hc <- pl$tree_row

lbl <- cutree(hc, 5) # you'll need to change '5' to the number of gene-groups you're interested in

which(lbl==1) # find genes corresponding to first group, ...

or in ComplexHeatmap

pl <- Heatmap(...)

hc <- as.hclust(row_dend(pl)[[1]])

If you can't find a method for extracting the dendrogram, then you'll need to look at exactly how the clustering is generating, and simulate all steps in its construction (ie is the matrix scaled, what distance metric is it using, what agglomeration method, ...).

 

ADD COMMENTlink written 19 months ago by Gavin Kelly560
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.2.0
Traffic: 380 users visited in the last hour