Adjusting contrast in a heatmap
2
0
Entering edit mode
@anthony-ferrari-3991
Last seen 9.6 years ago
Hi all, I am working on a gene expression analysis. I want to plot the heatmap resulting from the clustering (for both arrays and genes) I am generating this plot with image() function with a red-black-green color palette but the resulting image has a really poor contrast (because of the extreme expression values most of the image is dark) Is there a known graphical parameter or a simple idea which I can use to obtain an image with good contrast ? (As we usually do in the pixels settings with treeview software ) Best, Tony ps : I don't wanna use existing packages like heatmap or heatmap.plus as I am customizing distances and linkage. thanks ! [[alternative HTML version deleted]]
Clustering Clustering • 2.0k views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 3 months ago
United States
On Tue, Apr 13, 2010 at 8:52 AM, Anthony Ferrari <ferraria at="" gmail.com=""> wrote: > Hi all, > > I am working on a gene expression analysis. > I want to plot the heatmap resulting from the clustering (for both arrays > and genes) > > I am generating this plot with image() function with a red-black- green color > palette but the resulting image has a really poor contrast (because of the > extreme expression values most of the image is dark) > > Is there a known graphical parameter or a simple idea which I can use to > obtain an image with good contrast ? (As we usually do in the pixels > settings with treeview software ) Have a look at the breaks argument. > ps : I don't wanna use existing packages like heatmap or heatmap.plus as I > am customizing distances and linkage. You can also customize these properties in heatmap, heatmap.2, etc. See the help. Sean
ADD COMMENT
0
Entering edit mode
@wolfgang-huber-3550
Last seen 11 days ago
EMBL European Molecular Biology Laborat…
Hi Tony One way of improving contrast (but loosing the quantitative scale) is to rank-transform the image. By definition, this uses the available color range uniformly. Example: library(affydata) data("Dilution") image(Dilution[,1], transfo=function(x) x) image(Dilution[,1], transfo=rank) ## the default for 'transfo' here is 'log') Best wishes Wolfgang Anthony Ferrari ha scritto: > Hi all, > > I am working on a gene expression analysis. > I want to plot the heatmap resulting from the clustering (for both arrays > and genes) > > I am generating this plot with image() function with a red-black- green color > palette but the resulting image has a really poor contrast (because of the > extreme expression values most of the image is dark) > > Is there a known graphical parameter or a simple idea which I can use to > obtain an image with good contrast ? (As we usually do in the pixels > settings with treeview software ) > > Best, > > Tony > > ps : I don't wanna use existing packages like heatmap or heatmap.plus as I > am customizing distances and linkage. > > thanks ! > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Wolfgang Huber EMBL http://www.embl.de/research/units/genome_biology/huber
ADD COMMENT
0
Entering edit mode
Hi Tony >> I am generating this plot with image() function with a red-black- green >> color >> palette but the resulting image has a really poor contrast (because of >> the >> extreme expression values most of the image is dark) A good trick from image processing is the gamma factor: If you plot some numerical data x, just replace it with x^gamma, where gamma is a value around 1. If you use a gamma < 1, e.g. gamma=.5, the contrast will be stretched for the low values and compressed for the high ones, and vice versa for gamma>1. Experiment with the gamma value until you get could contrast at the part of the intensity scale that is of most interest for you. Don't forget to asjust the colour key with the same gamma factor so that your overall information is still correctly displayed. Cheers Simon
ADD REPLY

Login before adding your answer.

Traffic: 748 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6