Closed jamesdalg closed 5 years ago
In general, please provide a reproducible example so that I can run your code myself (e.g. I do not have access to submatrix
so cannot see what the data looks like where the superheat function sets the color to grey).
The problem may also be that you are only providing colors for quantiles (-0.5, 0, 0.5) leaving the ranges outside that undefined (i.e. from -1 to -0.5 and from 0.5 to 1).
You can also try setting extreme.values.na = FALSE
(this will set any values outside the given range to the max/min color rather than NA). You can also play with the heat.lim
argument.
Many of these concepts are discussed in sections 4.2, and 4.3 of the vignette (https://rlbarter.github.io/superheat/heatmap-colormap.html#color-transitions)
superheat(X = submatrix,membership.rows = row_block_ids,membership.cols = col_block_ids,left.label = "cluster",bottom.label = "cluster",force.bottom.label = T,force.left.label = T, grid.hline.col = "white", grid.vline.col = "white", grid.hline.size = 2, grid.vline.size = 2,scale=T,heat.pal = c("green","black","red"),heat.pal.values = c(-0.5,0,0.5))