Search
Question: [heatmap] different distance functions for columns and for rows
0
gravatar for Sean Davis
11.5 years ago by
Sean Davis21k
United States
Sean Davis21k wrote:
On 5/31/06 2:25 AM, "Ron Ophir" <ron.ophir at="" weizmann.ac.il=""> wrote: > I see. I missed it. You mean something like this > > x<-matrix(rnorm(1000,10,2),100,100) > hc<-as.dendrogram(hclust(dist(x,method="euclidean"))) > hr<-as.dendrogram(hclust(as.dist(cor(x,method="pearson")))) > x11();hv <- heatmap(x,Rowv=hr,Colv=hc) Couldn't have (and, indeed, didn't) said it better myself. Sean >>>> Sean Davis <sdavis2 at="" mail.nih.gov=""> 30/05/2006 22:02:16 >>> > > > > On 5/30/06 3:56 PM, "Ron Ophir" <ron.ophir at="" weizmann.ac.il=""> wrote: > >> I would like to run clustering on columns (samples) and rows (genes) > and >> get a plot similar to the output of heatmap(). However I would like > to >> apply euclidean distance to samples and pearson distance to genes. >> Is it possible to do it with heatmap(). If not, is there other > function >> that can do it? > > Ron, > > You can pass Rowv and Colv dendrogram objects, as output by hclust, > for > example. By doing so, you can use different distance functions (or > even > different clustering algorithms) for the rows and columns. > > Sean
ADD COMMENTlink written 11.5 years ago by Sean Davis21k
Please log in to add an answer.

Help
Access

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