[BioC] Fine tuning heatmap.2 graphics

Wittner, Ben, Ph.D. Wittner.Ben at mgh.harvard.edu
Thu Mar 9 15:22:53 CET 2006


> -----Original Message-----
> From: bioconductor-bounces at stat.math.ethz.ch [mailto:bioconductor-
> bounces at stat.math.ethz.ch] On Behalf Of Marc Saric
> Sent: Thursday, March 09, 2006 6:41 AM
> To: bioconductor at stat.math.ethz.ch
> Subject: [BioC] Fine tuning heatmap.2 graphics
> 
> Dear all,
> 
> I like to use heatmap.2 from the gplots library package to automatically
> plot heatmaps from microarray data.
> 
> Things work fine so far, but two problems remain:
> 
> 1. Depending on the amount of data to be displayed, the fontsize of the
> labels changes dynamically (as it should) and with that, the
> margin-space required to print the labels changes also (leading to
> truncated labels sometimes).
> 
> This can be set manually with
> 
> margin <- c(x,y);
> 
> for both x and y axis labels margins.
> 
> Is there an easy way to compute the required margin size dynamically
> from -say- the lenght of the longest label-string?

I have used the following code for setting margins for heatmap() (not
heatmap2()):

margin.factor <- 12
marg <- max(5, min(20, ceiling(margin.factor*max.nchar/ncol(expr3))))
margins <- c(marg, marg)

where max.nchar is the max length of column label and expr3 is the
matrix being displayed. It worked okay but not completely satisfactorily.

BTW, what is the advantage of heatmap2() over heatmap()?
Does anyone know of a heatmap()-like function that can add multiple rows of
column colors (each row corresponding, say, to various phenotypic parameters)
such as can be done with dChip?

Thanks.

-Ben



More information about the Bioconductor mailing list