Gene Expression Data Hierarchical Clustering, Plot Heat Map With Ggplot
1
1
Entering edit mode
10.9 years ago
k.nirmalraman ★ 1.1k

I have expression data, filtered based on DE analysis.

I would like to do hierachical clustering.

y<-ExpressionMatrix_filtered   # n*4 matrix with rownames=genenames
hr <- hclust(as.dist(1-cor(t(y), method="pearson")), method="centroid"); 
hc <- hclust(as.dist(1-cor(y, method="spearman")), method="centroid")  
# Cuts the tree and creates color vector for clusters.
mycl <- cutree(hr,k=4, h=max(hr$height)/1.5); 
mycolhc <- rainbow(length(unique(mycl)), start=0.1, end=0.9); mycolhc <- mycolhc[as.vector(mycl)] ; myheatcol <- bluered(75)

One can ofcourse plot the clusters as follows,

`heatmap.2(y, Rowv=as.dendrogram(hr), Colv=as.dendrogram(hc), col=myheatcol, scale="row", density.info="none", trace="none", RowSideColors=mycolhc,margins=c(10,10))'

however, I'd like ggplot package geom_tile type of visualization. I have two questions in this regard.

  1. How can I plot the clusters? I know the order of the genes are in hr$order. How can I get this to the same order for ggplot?
  2. Is it also possible to get the dendogram for rowV and colV

Any help would be really great. Thanks!

heatmap clustering • 11k views
ADD COMMENT
3
Entering edit mode
ADD COMMENT

Login before adding your answer.

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