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