Can you colour dendrogram branch clusters in pheatmap?
1
0
Entering edit mode
trichorico ▴ 10
@9b83e781
Last seen 3.1 years ago

Is there a function in pheatmap or some complementary package where you can color the branches of the dendrogram used to cluster the rows?

R heatmaps pheatmap • 2.3k views
ADD COMMENT
0
Entering edit mode
Kevin Blighe ★ 3.9k
@kevin
Last seen 1 day ago
Republic of Ireland

Hi, you should be able to do this by first creating the dendrogram and hclust object via CRAN's dendextend package, and then supplying these hclust objects to pheatmap via cluster_rows and cluster_cols.

One function to colour the dendrogram in dendextend is color_branches()

There is an example with gplots::heatmap.2() in the vignette: https://cran.r-project.org/web/packages/dendextend/vignettes/Cluster_Analysis.html

Kevin

ADD COMMENT

Login before adding your answer.

Traffic: 807 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