An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101008/d719c53b/attachment.pl>
Heatmap/Color Selection(Key)
3 messages · rashid kazmi, Eik Vettorazzi
2 days later
Hi Rashid,
you may have a look at the colorRampPalette-function, along with the
"at" argument oh heatmap.2
x<-matrix(runif(100,-6,6),nrow=10)
heatmap.2(x,col=colorRampPalette(c("blue","lightblue","darkgray","darkgray","yellow","red"),space="Lab"),at=c(-6.01,6.01,51))
# or just using the colors you posted
heatmap.2(x,col=c("blue","lightblue","darkgray","black","darkgray","yellow","red"),at=-3:3*2)
hth.
Am 08.10.2010 17:03, schrieb rashid kazmi:
Hi I made heatmap of QTL based on Lod score. Where I have traits in columns and marker data (rows). I can not cluster both column and rows as I need the right order for marker data. Can someone suggest me better way of generating heatmaps especially the colour key I want to select to visualize the results which are more interesting to look at.
library(gplots)
sample=read.csv(file.choose())
sample.names<-sample[,1]
sample.set<-sample[,-1]
sample.map <- as.matrix(sample.set)
### have to order as i have markers on rows so just want denrogram on triats(column)
ord <- order(rowSums(abs(sample.map)),decreasing=T)
heatmap.2(sample.map[ord,],Rowv=F,dendrogram="column",trace="none",col=greenred(10))
But I want to give colours more specifically as I want to show the QTL hotspots starting as fallow 1) -6 to -4 (blue) 2) -4 to -2 (light blue) 3) -2 to 0 (dark grey or black) 4) 0 to 2 (dark grey or black) 5) 2 to 4 (yellow) 6) 4 to 6 (red) Any help or some addition to the above mentioned R code would be appreciated. R Kazmi PhD The Netheralnd [[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Eik Vettorazzi Institut f?r Medizinische Biometrie und Epidemiologie Universit?tsklinikum Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790
sorry, typo:
heatmap.2(x,col=colorRampPalette(c("blue","lightblue","darkgray","darkgray","yellow","red"),space="Lab"),at=c(-6.01,6.01,51))
heatmap.2(x,col=c("blue","lightblue","darkgray","black","darkgray","yellow","red"),at=-3:3*2)
should be read as
heatmap.2(x,col=colorRampPalette(c("blue","lightblue","darkgray","darkgray","yellow","red")),breaks=seq(-6.01,6.01,length.out=51))
heatmap.2(x,col=c("blue","lightblue","darkgray","darkgray","yellow","red"),breaks=-3:3*2)
"at" from stats:heatmap became "breaks" in gplots:heatmap.2