[BioC] How to adjust the Heatmap.2 color key

Benjamin Otto b.otto at uke.uni-hamburg.de
Wed Jul 9 13:33:44 CEST 2008

Hi Martin,

I would define my own color sequence. For example if your maximum logratio
in your table is 5 and the minimum is -8 then you will have to decide how
much color steps you like. Let me assume you use RColorBrewer for choosing a
color palette. You can check the range of your data with
range(#whatyoutableiscalled#). Then you could do:

> mycol <- c(brewer.pal(8,"Greens"),"black",brewer.pal(5,"Reds")[5:1])
> heatmap.2(mytable, col=mycol)



-----Ursprüngliche Nachricht-----
Von: bioconductor-bounces at stat.math.ethz.ch
[mailto:bioconductor-bounces at stat.math.ethz.ch] Im Auftrag von Martin Bonke
Gesendet: Wednesday, July 09, 2008 12:21 PM
An: bioconductor at stat.math.ethz.ch
Betreff: [BioC] How to adjust the Heatmap.2 color key

Dear all,


I'm a postdoc at the University of Helsinki and currently I'm in the middle
of the analyses of a huge data set of microarray data. A couple of months
ago I made the jump from Genespring to using R and although the learning
curve has been somewhat steep, I'm quite happy that I have done so.


Right now I'm making heatmaps with the gene lists that I've generated using
heatmap.2. In general I'm quite happy with the results, but in several of
them I'm having some trouble with the color coding of the heatmap. My data
has been normalized towards control experiments, to get a factor of up or
down regulation (experiment values are divided by control values) and in
general I see that genes are somewhat stronger down regulated compared to
upregulated. To give an example, the strongest downregulated gene could be
at -8 fold, while the strongest upregulated could be at +5 fold. So the
distributon is then from -8 to +5, which puts the middle at -1.5 in the
color key that heatmap.2 automatically assigns. As a result, those genes
that are not really affected by my experiments (and thus have 0 fold
difference towards the control experiment) fall in a slightly green zone in
the color key that heatmap.2 assigns. This makes visual identification of
interesting gene clusters a lot more difficult. 


So my question to you all is whether there is a way to tell heatmap.2 which
colors should be assigned to a certain level of expression? I've thought
about checking each matrix for the strongest up and down regulated values
and then forcing the data to max out on whichever of the two is lowest, but
that will be a lot of work, and it'll mean that I have to duplicate all data
in order to conserve the original values as well. So if there is a better
way, I'll gladly hear it.


My thanks in advance.


Martin Bonke

	[[alternative HTML version deleted]]

Bioconductor mailing list
Bioconductor at stat.math.ethz.ch
Search the archives:

Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG):

Universitätsklinikum Hamburg-Eppendorf
Körperschaft des öffentlichen Rechts
Gerichtsstand: Hamburg

Prof. Dr. Jörg F. Debatin (Vorsitzender)
Dr. Alexander Kirstein
Ricarda Klein
Prof. Dr. Dr. Uwe Koch-Gromus

More information about the Bioconductor mailing list