[R] coloring dendrgram in heatmap?

Martin Maechler maechler at stat.math.ethz.ch
Mon Sep 29 17:12:33 CEST 2003


>>>>> "AndyL" == Liaw, Andy <andy_liaw at merck.com>
>>>>>     on Mon, 29 Sep 2003 08:28:03 -0400 writes:

    >> From: Xiao-Jun Ma [mailto:xma at arcturusag.com]
    >> 
    >> No, I meant coloring the edges of the dendrogram on the
    >> left or top of the image plot.
 
    AndyL> I'm not sure if this can be done with the current
    AndyL> plot.dendrogram() (which heatmap() calls to draw the
    AndyL> trees).  You may want to experiment with the edgePar
    AndyL> argument and see if that can give you trees with
    AndyL> different colors in the branches.  If not, you'll
    AndyL> need to hack into plot.dendrogram() and DIY.  (Martin
    AndyL> would know this for sure...)

yes, you are completely right, Andy.
To make this work with  heatmap() :

1) give a *dendrogram* object as `Rowv' and `Colv' argument to heatmap()

2) When constructing these 2 dendrograms, make sure that every
   node to which a non-standard edge should be drawn
   has an "edgePar" attribute, a list such as list(col = "green").

I agree that "2)" is somewhat tedious at the moment, but
unfortunately we are past feature freeze for R 1.8.0
{I had quite a few more proposed additional features that didn't
 make it...}

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><

    >> -----Original Message----- From: kjetil brinchmann
    >> halvorsen To: 'R-help at stat.math.ethz.ch '; 'Martin
    >> Maechler ' Sent: 9/27/03 1:24 PM Subject: Re: [R]
    >> coloring dendrgram in heatmap?
    >> 
    >> On 27 Sep 2003 at 11:56, Xiao-Jun Ma wrote:
    >> 
    >> What about trying RColorBrewer, as mentioned in the docs
    >> of heatmap. I had good results with that!
    >> 
    >> Kjetil Halvorsen
    >> 
    >> > Using the heatmap function in mva, it seems to be hard
    >> to use different > colors in the edges leading to
    >> different groups of objects, as commonly done > in many
    >> heatmaps in the microarray graphics. Any suggestions?
    >> Thanks.
    >> > 
    >> > max
    >> >




More information about the R-help mailing list