[BioC] Scaling color range of heatmap.2 with scaled row option
Yoo, Seungyeul
seungyeul.yoo at mssm.edu
Thu Jun 14 00:25:52 CEST 2012
Hi,
I am trying to draw a heatmap of microarray datasets.
I'm using a heatmap.2 function of gplots as following:
heatmap.2(var_exp,col=greenred,trace="none",scale="row",symkey=TRUE,hclust=function(x) hclust(x,method="complete"),distfun=function(x) as.dist(1-cor(t(x))))
It generates a fine heatmap but the most points are so dark-green or dark-red because the range of z-score generated by the scale option with "row".
The color key histogram is like in the attachment
[cid:7A004996-3CFB-4304-82E4-F5A8C2F4B24D at 1425mad.mssm.edu]
How can I scale the z-score to have more reddish and greenish colors for heatmap?
I actually tried with "breaks" function.
z_5000<-z_function(var_exp)
low_z<-min(z_5000)
lowest<-floor(low_z)
high_z<-max(z_5000)
highest<-ceiling(high_z)
br <- c()
if((abs(lowest))>highest){
br <- c(seq(-(highest),-2.2,by=0.2),seq(-2,-1.1,by=0.1),seq(-1,1,0.05),seq(1.1,2,by=0.1),seq(2.2,highest,by=0.2))
br <- c(lowest,br)
} else if((abs(lowest))<highest){
br <- c(seq(lowest,-2.2,by=0.2),seq(-2,-1.1,by=0.1),seq(-1,1,0.05),seq(1.1,2,by=0.1),seq(2.2,abs(lowest),by=0.2))
br <- c(br,highest)
} else{
br <- seq(lowest,highest,by=0.1)
}
The heatmap became more colorful but then the clustering is done based on z-score not the raw values. Therefore, the results are changed.
Is there anyway I can use more colorful heatmap using the raw dataset with scale="row" option? It should be able to but I can't find it in the archive of this email or googling.
Please help and thank you in advance.
Seungyeul Yoo
Postdoctoral Fellow
Institute of Genomics and Multiscale Biology
Department of Genetics and Genomic Sciences
Mount Sinai School of Medicine
More information about the Bioconductor
mailing list