issue with color coding heatmaps for positive and negative values
2
0
Entering edit mode
@kimpel-mark-w-727
Last seen 9.6 years ago
I would like to "hard code" the colors to be used with certain ranges of values for a heatmap. The issue has occurred because I have discovered than, in a special case of mine, positive numbers are not always yellow and negative numbers are not always blue. Below is an extreme example which demonstrates this behavior. The issue occurs regardless of whether scale="none" or scale="row" is used as an argument. Is there a workaround such that I can use one scale for positive numbers and another scale for negatives? Thanks, Mark a <- c(rep(c(-100, -9, -8, -11), 5), -2, 4) a.mat <- matrix(rep(a, 50), byrow=TRUE, nrow=50) require(RColorBrewer) BlYl <- c('#0061FF', '#0A0780','#9D8F00', '#FFF200') hmcol <- colorRampPalette(BlYl, space = "rgb")(128) heatmap(a.mat, col=hmcol) -- --- Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry Indiana University School of Medicine 15032 Hunter Court, Westfield, IN 46074 (317) 490-5129 Work, & Mobile & VoiceMail (317) 663-0513 Home (no voice mail please)
• 3.1k views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 3 months ago
United States
Mark W Kimpel wrote: > I would like to "hard code" the colors to be used with certain ranges of > values for a heatmap. The issue has occurred because I have discovered > than, in a special case of mine, positive numbers are not always yellow > and negative numbers are not always blue. Below is an extreme example > which demonstrates this behavior. The issue occurs regardless of whether > scale="none" or scale="row" is used as an argument. > > Is there a workaround such that I can use one scale for positive numbers > and another scale for negatives? > > Thanks, > Mark > > a <- c(rep(c(-100, -9, -8, -11), 5), -2, 4) > a.mat <- matrix(rep(a, 50), byrow=TRUE, nrow=50) > require(RColorBrewer) > BlYl <- c('#0061FF', '#0A0780','#9D8F00', '#FFF200') > hmcol <- colorRampPalette(BlYl, space = "rgb")(128) > heatmap(a.mat, col=hmcol) Hi, Mark. You might look at the heatmap.2 function (in package gplots on CRAN) and the breaks argument. Sean
ADD COMMENT
0
Entering edit mode
@wolfgang-huber-3550
Last seen 17 days ago
EMBL European Molecular Biology Laborat…
Dear Mark, Also, the "latticeExtra" package allows to construct very nice heatmaps - see the examples for dendrogramGrob. Best wishes Wolfgang > I would like to "hard code" the colors to be used with certain ranges of > values for a heatmap. The issue has occurred because I have discovered > than, in a special case of mine, positive numbers are not always yellow > and negative numbers are not always blue. Below is an extreme example > which demonstrates this behavior. The issue occurs regardless of whether > scale="none" or scale="row" is used as an argument. > > Is there a workaround such that I can use one scale for positive numbers > and another scale for negatives? > > Thanks, > Mark > > a <- c(rep(c(-100, -9, -8, -11), 5), -2, 4) > a.mat <- matrix(rep(a, 50), byrow=TRUE, nrow=50) > require(RColorBrewer) > BlYl <- c('#0061FF', '#0A0780','#9D8F00', '#FFF200') > hmcol <- colorRampPalette(BlYl, space = "rgb")(128) > heatmap(a.mat, col=hmcol)
ADD COMMENT
0
Entering edit mode
Hello, I am analyzing cDNA microarray data using limma. I generated the GAL file using the program coming with chipwriter, everything looks great. However, when I printed the first batch of chips, after the last dip of pins in the first plates, print, wash, and the pins redipped again in the first plate from the beginning, and print, wash, then stop to change the plate. The company gave us the patch to solve this problem. So this gal file is a little different than the rest batches of chips, the locations of genes, MSP, and controls are different (5%). After hybridization, I used GenePix Pro 6.1 for spotfinding. After reading the data into limma, I want to use MSP and control spots for normalization. I don't know how to label different gal files using readSpotTypes() in all chips. Thanks, Tiandao I am kind of new to R and limma. The following is my setting. > sessionInfo() R version 2.5.1 (2007-06-27) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] "stats" "graphics" "grDevices" "utils" "datasets" "methods" [7] "base" other attached packages: statmod limma "1.3.0" "2.10.5" Codes for analysis library(limma) A <- list(R="F635 Median",G="F532 Median",Rb="B635",Gb="B532") B <- list("Block", "Column", "Row", "Name", "ID", "X", "Y", "Dia.", "F635 Median", "F635 Mean", "F635 SD", "F635 CV", "B635", "B635 Median", "B635 Mean", "B635 SD", "B635 CV", "% > B635+1SD", "% > B635+2SD", "F635 % Sat.", "F532 Median", "F532 Mean", "F532 SD", "F532 CV", "B532", "B532 Median", "B532 Mean", "B532 SD", "B532 CV", "% > B532+1SD", "% > B532+2SD", "F532 % Sat.", "Ratio of Medians (635/532)", "Ratio of Means (635/532)", "Median of Ratios (635/532)", "Mean of Ratios (635/532)", "Ratios SD (635/532)", "Rgn Ratio (635/532)", "Rgn R2 (635/532)", "F Pixels", "B Pixels", "Circularity", "Sum of Medians (635/532)", "Sum of Means (635/532)", "Log Ratio (635/532)", "F635 Median - B635", "F532 Median - B532", "F635 Mean - B635", "F532 Mean - B532", "F635 Total Intensity", "F532 Total Intensity", "SNR 635", "SNR 532", "Flags", "Normalize", "Autoflag") # read 6 test files targets<-readTargets(file="targets.txt", row.name="Name") # 6 test files RG <- read.maimages(targets$FileName,source="genepix",ext="gpr",columns=A,ot her.columns=B) spottypes <- readSpotTypes("spottypes3.txt") # short spot types RG$genes$Status <- controlStatus(spottypes,RG) targets SlideNumber FileName Cy3 Cy5 Name 1 13582917 N0 N1 N0N121 2 13582918 N0 N1 N0N122 3 13590446 N0 N1 N0N123 4 13590420 N1 H1 N1H121 5 13590521 N1 H1 N1H122 6 13591193 N1 H1 N1H123 spottypes3 SpotType ID Color gene * black Calibration Calib* blue Ratio Ratio* red Negative Neg*|Util* brown MSP MSP orange Alexa Alexa* yellow blank NotDefined green
ADD REPLY

Login before adding your answer.

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