Hi,
now I am drawing a heatmap using heatmap3 package in R.
I have a question in drawing heatmap.
My read count datas are ranged from about [-8,8], but I want to make the colors presented in [-1,1].
For example, if my read count data is bigger than 1 (e.g. 4), than it should be represented in the color of 1.
I thought I can do this by using "range" options in heamap3, but it doesn't really work...
Is there anyone who can help me to figure out this...?
I would be very grateful.. Thank you!
My code is :
ColSideAnn <- wholeSampleName_with_false
RowSideColors<-colorRampPalette(c("green", "black", "red"))(34)
result<-heatmap3(logCPM_with_immune,ColSideCut=1.2,ColSideAnn=ColSideAnn,ColSideFun=function(x) showAnn(x),RowSideColors=RowSideColors,
col=colorRampPalette(c("green","black", "red"))(1024),RowAxisColors=1,verbose=TRUE,labCol = "", balanceColor = T)
I thought this might work, but it doesn't help :
col <- colByValue(logCPM_with_immune, range = c(-1, 1), col = colorRampPalette(c("green","black", "red"))(1024))
result<-heatmap3(logCPM_with_immune,ColSideCut=1.2,ColSideAnn=ColSideAnn,ColSideFun=function(x) showAnn(x),RowSideColors=RowSideColors,
RowAxisColors=1,verbose=TRUE,labCol = "", col=col)