heatmap colours
3
0
Entering edit mode
@stephen-henderson-71
Last seen 7.6 years ago
I have been using the new heatmap() function of the mva library to look at gene expression data (thanks to D. Murdoch). I can't find a suitable color palette with R or RColorBrewer. So has anyone created a Red-Black- Green, or Red-Black-Blue palette they might like to share? Yours Hopefully Stephen ********************************************************************** This email and any files transmitted with it are confidential an... {{dropped}}
• 5.4k views
ADD COMMENT
0
Entering edit mode
@warnes-gregory-r-43
Last seen 10.2 years ago
Try this: # Red for down regulated, green for upregulated. redgreen <- function(n) { c( hsv(h=0/6, v=seq(1,0,length=n/2) ), hsv(h=2/6, v=seq(0,1,length=n/2) ), ) } Use as: heatmap( datamat, col=redgreen(20) ) -Greg > -----Original Message----- > From: Stephen Henderson [mailto:s.henderson@ucl.ac.uk] > Sent: Monday, May 12, 2003 7:50 AM > To: 'bioconductor@stat.math.ethz.ch' > Subject: [BioC] heatmap colours > > > I have been using the new heatmap() function of the mva > library to look at > gene expression data (thanks to D. Murdoch). I can't find a > suitable color > palette with R or RColorBrewer. So has anyone created a > Red-Black-Green, or > Red-Black-Blue palette they might like to share? > > Yours Hopefully > Stephen > > > ********************************************************************** > This email and any files transmitted with it are confidential > an... {{dropped}} > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor > LEGAL NOTICE\ Unless expressly stated otherwise, this message is... {{dropped}}
ADD COMMENT
0
Entering edit mode
@jean-yee-hwa-yang-104
Last seen 10.2 years ago
Hi Stephen, Try the maPalette function in marrayPlots. You can create many different color palettes by specifying the low, and high end of the color. See help(maPalette) for more details ## Red -- Black -- Green rbg <- maPalette(low="green", high="red", mid="black") heatmap(data, col=rbg) ## Red -- white -- Green rwg <- maPalette(low="green", high="red", mid="white") heatmap(data, col=rwg) ## blue--yellow by <- maPalette(low="blue", high="yellow") heatmap(data, col=by) Cheers Jean ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jean Yee Hwa Yang jean@biostat.ucsf.edu Division of Biostatistics, Tel: (415) 476-3368 University of California, Fax: (415) 476-6014 500 Parnassus Avenue, MU 420-W, San Francisco, CA 94143-0560 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On Mon, 12 May 2003, Stephen Henderson wrote: > I have been using the new heatmap() function of the mva library to look at > gene expression data (thanks to D. Murdoch). I can't find a suitable color > palette with R or RColorBrewer. So has anyone created a Red-Black- Green, or > Red-Black-Blue palette they might like to share? > > Yours Hopefully > Stephen > > > ********************************************************************** > This email and any files transmitted with it are confidential an... {{dropped}} > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor >
ADD COMMENT
0
Entering edit mode
Jean Yee Hwa Yang <jean@biostat.ucsf.edu> [Mon, May 12, 2003 at 07:31:59PM CEST]: [...] > > ## Red -- Black -- Green [...] > ## Red -- white -- Green [...] > ## blue--yellow [...] General discussion about the usefulness of heat maps aside, why is everyone infatuated with the red/green contrast? Just because cDNA chips are marked with red and green dye? We are not looking at a chip image here, so generally we are free wrt choice of colours. Red and green is less than optimal for several reasons: - A non-neglectable proportion of the population, especially the male sector of it, cannot distinguish between those colours. - It makes for poor contrast when transformed to grayscale. The visualization guides I have read don't condone a red/green contrast scale (while Edward Tufte doesn't specifically list it as a deterring example, he doesn't recommend it either). One suggestion is a palet along black -- red -- orange -- yellow -- white, mimicking the appearance of a black body heated up. (That would cause "heat map" to be an apt term at last. ok. I'm feeling better now. Johannes -- Johannes H?sing There is something fascinating about science. One gets hannes@ruhrau.de such wholesale returns of conjecture from such a trifling investment of fact. Mark Twain
ADD REPLY
0
Entering edit mode
It was originally done to mimic the Cy3/Cy5 labels. Everybody else used it because thats what the software did and there wasn't any way to change it. Personally I like Blue->White->Red as fully saturated Blue and Red have roughly the same apparent brightness (as opposed to Blue->White->Yellow... I've never understood that color choice except that Blue and Yellow are, sort of, UCLA's school colors) and the plot background color is generally white, making white seem like the logical choice for "center." They maintain the "heat" paradigm as traditional indicators of hot and cold and unlike blackbody heat maps are more directly comparable in absolute value. No, I don't have a function handy... I just keep a 1025 element vector of color values around in an RDA file. On Monday, May 12, 2003, at 05:47 PM, Johannes H?sing wrote: > Jean Yee Hwa Yang <jean@biostat.ucsf.edu> [Mon, May 12, 2003 at > 07:31:59PM CEST]: > [...] >> >> ## Red -- Black -- Green > [...] >> ## Red -- white -- Green > [...] >> ## blue--yellow > [...] > > General discussion about the usefulness of heat maps aside, why is > everyone infatuated with the red/green contrast? Just because cDNA > chips are marked with red and green dye? We are not looking at a > chip image here, so generally we are free wrt choice of colours. > Red and green is less than optimal for several reasons: > > - A non-neglectable proportion of the population, especially the > male sector of it, cannot distinguish between those colours. > - It makes for poor contrast when transformed to grayscale. > > The visualization guides I have read don't condone a red/green > contrast scale (while Edward Tufte doesn't specifically list it as a > deterring example, he doesn't recommend it either). One suggestion is > a palet along black -- red -- orange -- yellow -- white, mimicking the > appearance of a black body heated up. (That would cause "heat map" to > be an apt term at last. > > ok. I'm feeling better now. > > > Johannes > -- > Johannes H?sing There is something fascinating about science. One > gets > hannes@ruhrau.de such wholesale returns of conjecture from such a > trifling investment of fact. Mark > Twain > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor > Byron Ellis (bellis@hsph.harvard.edu) "Oook" - The Librarian
ADD REPLY
0
Entering edit mode
rgentleman ★ 5.5k
@rgentleman-7725
Last seen 9.6 years ago
United States
If you want to choose good colors please look at Cynthia Brewer's work www.colorbrewer.org) or the R package RColorBrewer and yes there are examples of doing so in Bioconcductor and no we don't force people to make good choices :-) Robert On Mon, May 12, 2003 at 11:47:33PM +0200, Johannes H?sing wrote: > Jean Yee Hwa Yang <jean@biostat.ucsf.edu> [Mon, May 12, 2003 at 07:31:59PM CEST]: > [...] > > > > ## Red -- Black -- Green > [...] > > ## Red -- white -- Green > [...] > > ## blue--yellow > [...] > > General discussion about the usefulness of heat maps aside, why is > everyone infatuated with the red/green contrast? Just because cDNA > chips are marked with red and green dye? We are not looking at a > chip image here, so generally we are free wrt choice of colours. > > Red and green is less than optimal for several reasons: > > - A non-neglectable proportion of the population, especially the > male sector of it, cannot distinguish between those colours. > - It makes for poor contrast when transformed to grayscale. > > The visualization guides I have read don't condone a red/green > contrast scale (while Edward Tufte doesn't specifically list it as a > deterring example, he doesn't recommend it either). One suggestion is > a palet along black -- red -- orange -- yellow -- white, mimicking the > appearance of a black body heated up. (That would cause "heat map" to > be an apt term at last. > > ok. I'm feeling better now. > > > Johannes > -- > Johannes H?sing There is something fascinating about science. One gets > hannes@ruhrau.de such wholesale returns of conjecture from such a > trifling investment of fact. Mark Twain > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor -- +--------------------------------------------------------------------- ------+ | Robert Gentleman phone : (617) 632-5250 | | Associate Professor fax: (617) 632-2444 | | Department of Biostatistics office: M1B20 | | Harvard School of Public Health email: rgentlem@jimmy.harvard.edu | +--------------------------------------------------------------------- ------+
ADD COMMENT
0
Entering edit mode
Robert Gentleman <rgentlem@jimmy.harvard.edu> [Mon, May 12, 2003 at 11:56:15PM CEST]: > If you want to choose good colors please look at Cynthia Brewer's work > www.colorbrewer.org) or the R package RColorBrewer very nice. Thank you for mentioning the package! [...] > don't force people to make good choices :-) Well, maybe not force them, but maybe nudge them, like, have the default be your way rather than the unwashed masses' way? Greetings Johannes -- Johannes H?sing There is something fascinating about science. One gets hannes@ruhrau.de such wholesale returns of conjecture from such a trifling investment of fact. Mark Twain
ADD REPLY

Login before adding your answer.

Traffic: 578 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