How to cluster in heatmap.2
1
0
Entering edit mode
3.6 years ago
Björn ▴ 100

How to cluster heatmap using different distance matrix (Manhattan or Euclidean) and split column or row-wise in following command

heatmap.2(lcpm, Colv=FALSE, dendrogram="row",labRow = y2$genes$genes, Rowv = TRUE,  col=rev(morecols(20)),trace="none",tracecol = "black",main="Top 20 variable genes across samples",cex.main=0.6, ColSideColors=group.col,scale="row",margins=c(10,9))

Thanks

heatmap.2 edgeR Manhattan euclidean • 14k views
ADD COMMENT
6
Entering edit mode
3.6 years ago

I give an answer here, that indirectly answers your question: A: Heatmap based with FPKM values

In a nutshell, just add the following as parameters to heatmap.2():

#Euclidean distance with Ward's linkage
heatmap.2(
  ...,
  distfun = function(x) dist(x, method="euclidean"),
  hclustfun = function(x) hclust(x, method="ward.D2"))

#1 minus Pearson correlation distance with average linkage
heatmap.2(
  ...,
  distfun = function(x) as.dist(1-cor(t(x))),
  hclustfun = function(x) hclust(x, method="average"))

et cetera

ADD COMMENT
1
Entering edit mode

@Kevin Blighe, Thanks, It worked

ADD REPLY

Login before adding your answer.

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