[BioC] How to use distance functions from hopach package in a heatmap?

Stefano Calza stecalza at tiscali.it
Wed Jun 22 10:34:35 CEST 2005


Hi,

assuming cols of probExp are samples, you can do something like this:

ydist = as.dist(disscosangle(probesExp))
yclust = as.dendrogram(hclust(ydist,...))

heatmap(probesExp,...,Colv=yclust)

HIH

Stefano

On Tue, Jun 21, 2005 at 04:18:32PM -0400, Lourdes Peña Castillo wrote:
<Lourdes>Hello,
<Lourdes>
<Lourdes>I am trying to get a heatmap from gene expression data using a
<Lourdes>different distance function rather than the default (dist with
<Lourdes>euclidean distance).
<Lourdes>
<Lourdes>Specifically,  I was trying to use disscosangle available in the
<Lourdes>hopach package setting distfun as follows:
<Lourdes>
<Lourdes>>heatmap(t(probesExp), col = mypalette, distfun = disscosangle, labCol
<Lourdes>= "", scale = "none");
<Lourdes>
<Lourdes>but I get this error:
<Lourdes>
<Lourdes>Error in if (n < 2) stop("must have n >= 2 objects to cluster") : 
<Lourdes>        argument is of length zero
<Lourdes>
<Lourdes>I checked whether disscosangle could be used at all using:
<Lourdes>as.dist(disscosangle(probesExp))
<Lourdes>and it works fine.
<Lourdes>However, I could not find the right way to give it as a parameter to
<Lourdes>heatmap.  Somebody knows how to do this?
<Lourdes>
<Lourdes>In addition,  how can I  add to the image of the heatmap a map between
<Lourdes>the colors used and the values of the data? I mean how to have the
<Lourdes>color palette in one side of the image with the corresponding value
<Lourdes>each color represents.
<Lourdes>
<Lourdes>Thanks!
<Lourdes>
<Lourdes>Lourdes
<Lourdes>
<Lourdes>_______________________________________________
<Lourdes>Bioconductor mailing list
<Lourdes>Bioconductor at stat.math.ethz.ch
<Lourdes>https://stat.ethz.ch/mailman/listinfo/bioconductor

-- 
Stefano Calza, PhD
Sezione di Statistica Medica e Biometria
Dip. di Scienze Biomediche e Biotecnologie
Università degli Studi di Brescia - Italia
Viale Europa, 11 25123 Brescia
email: calza at med.unibs.it
Telefono/Phone: +390303717532
Fax: +390303717488

Section of Medical Statistics and Biometry
Dept. Biomedical Sciences and Biotechnology
University of Brescia - Italy



More information about the Bioconductor mailing list