Hello,
well, it's about heatmap colors, again ... .
Does anybody know a package to create a non-symmetric color map with
user-choosen mir point and satuaration? I've a fold-change matrix,
with values from -3 fold (ratio 1/3) to +7 fold. I'd like to go from
0.5 (green) to 1 (black) to 3 (red).
I think maPallete just assigns the lowest FC to the first color and
the highest FC to the last color, i.e. an evenly distributed color
list, right?
Any hints are welcome,
Arne
Look at using the breaks argument. If you do breaks=seq(-3,3,0.1) and
use 59 colors (this is important because the number of breaks and
colors have to match--see documentation for heatmap), you get "black"
centered on zero and red and green symmetrically set around zero (if
using red/green colors, obviously).
Sean
On Feb 2, 2005, at 12:10 PM, <arne.muller@sanofi-aventis.com> wrote:
> Hello,
>
> well, it's about heatmap colors, again ... .
>
> Does anybody know a package to create a non-symmetric color map with
> user-choosen mir point and satuaration? I've a fold-change matrix,
> with values from -3 fold (ratio 1/3) to +7 fold. I'd like to go from
> 0.5 (green) to 1 (black) to 3 (red).
>
> I think maPallete just assigns the lowest FC to the first color and
> the highest FC to the last color, i.e. an evenly distributed color
> list, right?
>
> Any hints are welcome,
>
> Arne
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
Hi Arne,
try the following:
library(RColorBrewer)
library(geneplotter)
f = colorRamp(brewer.pal(11, "RdBu"))
then f is a functions that takes numbers between 0 and 1 and maps them
to colors between red and blue.
And
g = function(x) f( (x-x0)/(x1-x0) )
maps numbers between x0 and x1 to these colors.
Best wishes
Wolfgang
Arne.Muller@sanofi-aventis.com wrote:
> Hello,
>
> well, it's about heatmap colors, again ... .
>
> Does anybody know a package to create a non-symmetric color map with
user-choosen mir point and satuaration? I've a fold-change matrix,
with values from -3 fold (ratio 1/3) to +7 fold. I'd like to go from
0.5 (green) to 1 (black) to 3 (red).
>
> I think maPallete just assigns the lowest FC to the first color and
the highest FC to the last color, i.e. an evenly distributed color
list, right?
>
> Any hints are welcome,
>
> Arne
-------------------------------------
Wolfgang Huber
European Bioinformatics Institute
European Molecular Biology Laboratory
Cambridge CB10 1SD
England
Phone: +44 1223 494642
Fax: +44 1223 494486
Http: www.ebi.ac.uk/huber
Wolfgang and Sean,
thanks for your hints. The "breaks" argument (described in ?image),
did what I wanted. I just had to set all fold change values < -3 to
-3 and > 3 to 3 to get a saturation at these limits, otherwise the
color beyond these "extreme" values would just be white.
kind regards,
Arne
> -----Original Message-----
> From: bioconductor-bounces@stat.math.ethz.ch
> [mailto:bioconductor-bounces@stat.math.ethz.ch]On Behalf Of Wolfgang
> Huber
> Sent: 03 February 2005 04:49
> Cc: bioconductor@stat.math.ethz.ch
> Subject: Re: [BioC] non-symmetric heatmap colors
>
>
> Hi Arne,
>
> try the following:
>
> library(RColorBrewer)
> library(geneplotter)
> f = colorRamp(brewer.pal(11, "RdBu"))
>
> then f is a functions that takes numbers between 0 and 1 and maps
them
> to colors between red and blue.
>
> And
>
> g = function(x) f( (x-x0)/(x1-x0) )
>
> maps numbers between x0 and x1 to these colors.
>
> Best wishes
> Wolfgang
>
>
> Arne.Muller@sanofi-aventis.com wrote:
> > Hello,
> >
> > well, it's about heatmap colors, again ... .
> >
> > Does anybody know a package to create a non-symmetric color
> map with user-choosen mir point and satuaration? I've a
> fold-change matrix, with values from -3 fold (ratio 1/3) to
> +7 fold. I'd like to go from 0.5 (green) to 1 (black) to 3 (red).
> >
> > I think maPallete just assigns the lowest FC to the first
> color and the highest FC to the last color, i.e. an evenly
> distributed color list, right?
> >
> > Any hints are welcome,
> >
> > Arne
>
> -------------------------------------
> Wolfgang Huber
> European Bioinformatics Institute
> European Molecular Biology Laboratory
> Cambridge CB10 1SD
> England
> Phone: +44 1223 494642
> Fax: +44 1223 494486
> Http: www.ebi.ac.uk/huber
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
>
On Feb 3, 2005, at 4:30 AM, <arne.muller@sanofi-aventis.com> wrote:
> Wolfgang and Sean,
>
> thanks for your hints. The "breaks" argument (described in ?image),
> did what I wanted. I just had to set all fold change values < -3 to
> -3 and > 3 to 3 to get a saturation at these limits, otherwise the
> color beyond these "extreme" values would just be white.
>
If you use the heatmap.2 function in the gplots package (part of the
gregmisc bundle), it deals with the saturation issue automatically and
assigns all values above (below) the top (bottom) break to the most
extreme color--no more white! It also adds some other very nice
bells-and-whistles to the standard heatmap function. I now use
heatmap.2 exclusively.
Sean