Extracting ids of a cluster in heatmap
2
0
Entering edit mode
8.2 years ago
pbigbig ▴ 250

Hi everyone,

Sorry for a quite basic question regarding RNAseq analysis.

For the log-transformed FPKM values which made from Cuffdiff output, I have created a gene expression heatmap by pheatmap package in R. Those genes in rows are hierarchical clustered by pheatmap (clustering_distance_rows = "euclidean") to form a dendrogram structure. I wonder that how could I get hundreds of gene ids belonged to an interested branch (that is too many to be possibly read from row names) ? Does pheatmap offer this feature or should I use another R package to get those ids? Please give me suggestion and detail explanation if possible.

Thank you very much.

pheatmap heatmap RNAseq • 8.9k views
ADD COMMENT
3
Entering edit mode
8.2 years ago
igor 13k

You can extract the genes in the clustered order if you save the pheatmap object.

map = pheatmap(x, ... )
x[map$tree_row$order,]
ADD COMMENT
0
Entering edit mode

thanks a lot, however if I cluster with kmean, does it still work?

map <- pheatmap(x, kmean-k= 50, ... )

ADD REPLY
0
Entering edit mode
8.2 years ago
vivekbhr ▴ 700

You can create your own dendrograms, using the hclust function, give this output to pheatmap to make heatmap (cluster_rows option ) . Then cut the clusters of your dendrogram using the cutree function in R to get a vector that tells you which entry belongs to which cluster.

ADD COMMENT
0
Entering edit mode

thank you for your suggestion!

ADD REPLY

Login before adding your answer.

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