Question: How to cluster in heatmap.2
gravatar for Björn
2.3 years ago by
Björn40 wrote:

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))


ADD COMMENTlink modified 2.3 years ago by Kevin Blighe61k • written 2.3 years ago by Björn40
gravatar for Kevin Blighe
2.3 years ago by
Kevin Blighe61k
University College London
Kevin Blighe61k wrote:

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
  distfun = function(x) dist(x, method="euclidean"),
  hclustfun = function(x) hclust(x, method="ward.D2"))

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

et cetera

ADD COMMENTlink modified 11 months ago • written 2.3 years ago by Kevin Blighe61k

@Kevin Blighe, Thanks, It worked

ADD REPLYlink written 2.3 years ago by Björn40
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1174 users visited in the last hour