heatmap_plus and distances
3
0
Entering edit mode
John Lande ▴ 280
@john-lande-2357
Last seen 10.2 years ago
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioconductor/attachments/20071013/ 421d3449/attachment.pl
• 1.1k views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 3 months ago
United States
John Lande wrote: > Dear BioC, > > I need to apply the function heatmap_plus to my matrices and I need to use > distance which are not euclidean, but something like pearson, or cosine. > It seems that the field distfun can be fitted with different metrics, but > none of my needs. do you know any other way to apply these distance in this > environment? > Hi, John. I'm not sure what you mean by "none of my needs" for distfun. Here is a simple example using cor(). > m=matrix(rnorm(1000),nc=20) > heatmap_plus(m) > heatmap_plus(m,distfun=function(x) {as.dist(1-cor(t(x)))}) Two points require attention. First, the distfun must return a distance-like object. as.dist() will often do the trick. Also, some functions will require a t() to get the correct results. Hope this helps. Sean
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 3 months ago
United States
John Lande wrote: > thank you I will try out this, > > by this sentence "none of my needs" I mean that I didn't find cosine > correlation in the help pages for the function heatmap Ah. I see your point. Try: RSiteSearch('cosine correlation') The first and second hits mention the hopach package, which includes the function disscosangle(). This might be what you want, though I am not sure. Sean
ADD COMMENT
0
Entering edit mode
Hello, I've implemented correlation distances - including cosine correlation - in function "corDist" in R package SLmisc, which can be found on CRAN. hth Matthias > John Lande wrote: > >> thank you I will try out this, >> >> by this sentence "none of my needs" I mean that I didn't find cosine >> correlation in the help pages for the function heatmap >> > > Ah. I see your point. Try: > > RSiteSearch('cosine correlation') > > The first and second hits mention the hopach package, which includes the > function disscosangle(). This might be what you want, though I am not sure. > > Sean > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > -- Dr. rer. nat. Matthias Kohl E-Mail: matthias.kohl at stamats.de Home: www.stamats.de
ADD REPLY
0
Entering edit mode
Aedin Culhane ▴ 510
@aedin-culhane-1526
Last seen 5.2 years ago
United States
Hi John The function heaplot in the made4 package will do this for you. We also added additional functionality to the function in the new release of made4. If you provide heatplot with a character vector representing grouping in your samples, it will add a colour bar beneath the dendrogram so you can easily see if your samples cluster. The function pretty.dend is an extension to this and will add multiple colour bars for each of your sample covariates. Regards Aedin > Date: Sat, 13 Oct 2007 14:50:04 +0200 > From: "John Lande" <john.lande77 at="" gmail.com=""> > Subject: [BioC] heatmap_plus and distances > To: bioconductor at stat.math.ethz.ch > Message-ID: > <c2ebc3880710130550q1bbe72e9gaf85bb55853ec82f at="" mail.gmail.com=""> > Content-Type: text/plain > > Dear BioC, > > I need to apply the function heatmap_plus to my matrices and I need to use > distance which are not euclidean, but something like pearson, or cosine. > It seems that the field distfun can be fitted with different metrics, but > none of my needs. do you know any other way to apply these distance in this > environment? > > > best regards > > > John > >
ADD COMMENT

Login before adding your answer.

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