How to change heatmap.2 color range in R? -


i'm using gplot produce heatmap showing log2-fold changes of treatment groups versus paired controls. following code:

 heatmap.2(as.matrix(seqcounttable), col=redgreen(75),             density.info="none", trace="none", dendrogram=c("row"),              symm=f,symkey=t,symbreaks=t, scale="none")  

i output heat map real fold change values (i.e., non row-z score) i'm after, in red-black-green color scheme every biologist's favorite!

http://i.stack.imgur.com/uhfbp.jpg

the actual range of log2-fold change -3/+7, many values in -2/-1 , +1/+2 range, appear dark red/green (respectively). makes whole heatmap quite dark , difficult interpret.

  • is there way of skewing color gradient make less linear? is, gradient black quite bright occurs on smaller range?
  • and / or change color range asymmetric, i.e., run -3/+7, data does, rather -7/+7 scale does, black still centered on zero?

i got color range asymmetric changing symkey argument false

symm=f,symkey=f,symbreaks=t, scale="none" 

solved color issue colorramppalette breaks argument specify range of each color, e.g.

colors = c(seq(-3,-2,length=100),seq(-2,0.5,length=100),seq(0.5,6,length=100))  my_palette <- colorramppalette(c("red", "black", "green"))(n = 299) 

altogether

heatmap.2(as.matrix(seqcounttable), col=my_palette,      breaks=colors, density.info="none", trace="none",          dendrogram=c("row"), symm=f,symkey=f,symbreaks=t, scale="none") 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -