View Single Post
Old 08-23-2013, 04:12 AM   #3
Senior Member
Location: Gainesville

Join Date: Apr 2012
Posts: 140

Originally Posted by jmw86069 View Post
Use the 'breaks' parameter of the heatmap.2() function. Set it to a vector of values representing where the color breaks should be. I think you need n+1 breaks for colors, but in this rare case the error message will guide you. Just be sure to use a color vector one fewer length than the breaks. Not too hard once you get it working, and it's much more powerful that way.
my code:
bk = c(seq(-0.1,0, length=100), seq(0,0.4,length=100),seq(0.4,13,length=100))
hmcols<- colorRampPalette(c("white","red","red4"))(length(bk)-1)

heatmap.2(m1, col=hmcols, breaks = bk, Colv=FALSE, dendrogram="row", symkey=FALSE, symm=F, symbreaks=T, scale="none", trace="none", labRow=NA, labCol=NA)

Error in heatmap.2(m1, col = hmcols, breaks = bk, Colv = FALSE, dendrogram = "row", :
lazy-load database 'P' is corrupt
In addition: Warning messages:
1: In heatmap.2(m1, col = hmcols, breaks = bk, Colv = FALSE, dendrogram = "row", :
restarting interrupted promise evaluation
2: In heatmap.2(m1, col = hmcols, breaks = bk, Colv = FALSE, dendrogram = "row", :
internal error -3 in R_decompress1ols<- colorRampPalette(c("white","red","red4"))(length(bk)-1)
if I use pheatmap to plot

pheatmap(m1, color=hmcols, breaks= bk, cluster_rows=TRUE, cluster_cols=FALSE, legend=FALSE, show_rownames=FALSE, show_colnames=FALSE)
Error in cut.default(x, breaks = breaks, include.lowest = T) :
'breaks' are not unique

it complains breaks are not unique...
what's wrong with my code?

Last edited by crazyhottommy; 08-23-2013 at 04:16 AM.
crazyhottommy is offline   Reply With Quote