R/heatmaps-varAnnotation.R
anno_var_density.Rd
Use this as an argument to varAnnotation(), which itself is used by cor_heatmap var_anno argument.
function applied to all variables, with apply()
width or height as a grid unit object
Type of graphics to represent density distribution. "lines" for normal density plot; "violine" for violin plot and "heatmap" for heatmap visualization of density distribution.
Range on x-axis.
A vector of colors for interpolating density values.
Relative height of density distribution. A value higher than 1 increases the height of the density distribution and the plot will represented as so-called "joyplot".
Wether draw borders of the annotation region?
Graphic parameters for the boxes. The length of the graphic parameters should be one or the number of observations.
Whether to add axis?
Arguments passed on to ComplexHeatmap::anno_density
axis_param
parameters for controlling axis. See default_axis_param
for all possible settings and default parameters.
OPTIONAL phyloseq or psExtra, only set this to override use of same data as in heatmap
OPTIONAL selection vector of variable names, only set this if providing data argument to override default
OPTIONAL indicating if it is a 'column' or a 'row' annotation, only set this if providing data argument to override default
function or ComplexHeatmap AnnotationFunction object
library(ComplexHeatmap)
set.seed(123)
fakeData <- as.data.frame.matrix(matrix(rnorm(500, 10, 3), ncol = 10))
names(fakeData) <- paste0("var_", 1:10)
# draw the plots without a heatmap, you will never normally do this!
vp <- viewport(width = 0.75, height = 0.75)
grid.newpage()
pushViewport(vp)
draw(
anno_var_density(data = fakeData, vars = names(fakeData), which = "row")
)
grid.newpage()
pushViewport(vp)
draw(
anno_var_density(
data = fakeData, fun = function(x) log(x + 1),
vars = rev(names(fakeData)), type = "heatmap",
which = "column"
)
)