[R] clustering problem

From: Maxim <deeepersound_at_googlemail.com>
Date: Wed, 02 Mar 2011 22:07:53 +0100


I have a gene expression experiment with 20 samples and 25000 genes each. I'd like to perform clustering on these. It turned out to become much faster when I transform the underlying matrix with t(matrix). Unfortunately then I'm not anymore able to use cutree to access individual clusters. In general I do something like this:

hc <- hclust(dist(USArrests), "ave")

cols<-rainbow(clrno, alpha = 1)
clstrs <- cutree(hc, k=clrno)
ccols <- cols[as.vector(clstrs)]
heatcol<-colorRampPalette(c(3,1,2), bias = 1.0)(32) heatmap.2(as.matrix(USArrests), Rowv=as.dendrogram(hc),col=heatcol, trace="none",RowSideColors=ccols)

Nice, I can access 3 main clusters with cutree. But what about a situation when I perform hclust like

hc <- hclust(dist(t(USArrests)), "ave")

which I have to do in order to speed up the clustering process. This I can plot with:

heatmap.2(as.matrix(USArrests), Colv=as.dendrogram(hc),col=heatcol, trace="none")

But where do I find information about the clustering that was applied to the rows?
cutree(hc, k=clrno) delivers the clustering on the columns, so what can I do to access the levels for the rows?
I guess the solution is easy, but after ours of playing around I thought it might be a good time to contact the mailing list!


        [[alternative HTML version deleted]]

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 02 Mar 2011 - 21:10:29 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 02 Mar 2011 - 21:40:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive