How do I extract gene names from different portions of my heatmap?
1
0
Entering edit mode
3 months ago

I have this heatmap that I generated using DESeq2 and pheatmap(). I had it perform hierarchal clustering on the rows. Now, how do I identify which genes are in the primarily blue band (on top) or the red band (on bottom). I am fairly new to R, so I have been using the code displayed on the vignette. Code below.

library("pheatmap")
df <- as.data.frame(colData(dds)[,c("condition","type")])
pheatmap(assay(vsd), cluster_rows=TRUE, show_rownames=FALSE,
cluster_cols=FALSE, annotation_col=df)

pheatmap heatmap deseq2 • 269 views
2
Entering edit mode
3 months ago
Barry Digby ★ 1.0k
0
Entering edit mode

As detailed in the linked reply above, you need to (a) decide at which level to cut the dendrogram and then (b) obtain the names of the members for the nodes. DAve Tang explained the relationship between (p)heatmaps and dendrograms well, if you need a primer on that.