View source: R/AnnotationFunction-function.R
anno_simple | R Documentation |
Simple Annotation
anno_simple(x, col, na_col = "grey",
which = c("column", "row"), border = FALSE, gp = gpar(),
pch = NULL, pt_size = unit(1, "snpc")*0.8, pt_gp = gpar(),
simple_anno_size = ht_opt$simple_anno_size,
width = NULL, height = NULL)
x |
The value vector. The value can be a vector or a matrix. The length of the vector or the nrow of the matrix is taken as the number of the observations of the annotation. The value can be numeric or character and NA value is allowed. |
col |
Color that maps to |
na_col |
Color for NA value. |
which |
Whether it is a column annotation or a row annotation? |
border |
Wether draw borders of the annotation region? |
gp |
Graphic parameters for grid borders. The |
pch |
Points/symbols that are added on top of the annotation grids. The value can be numeric or single letters. It can be a vector if |
pt_size |
Size of the points/symbols. It should be a |
pt_gp |
Graphic parameters for points/symbols. The length setting is same as |
simple_anno_size |
size of the simple annotation. |
width |
Width of the annotation. The value should be an absolute unit. Width is not allowed to be set for column annotation. |
height |
Height of the annotation. The value should be an absolute unit. Height is not allowed to be set for row annotation. |
The "simple annotation" is the most widely used annotation type which is heatmap-like, where
the grid colors correspond to the values. anno_simple
also supports to add points/symbols
on top of the grids where the it can be normal point (when pch
is set as numbers) or letters (when
pch
is set as single letters).
An annotation function which can be used in HeatmapAnnotation
.
anno = anno_simple(1:10)
draw(anno, test = "a numeric vector")
anno = anno_simple(cbind(1:10, 10:1))
draw(anno, test = "a matrix")
anno = anno_simple(1:10, pch = c(1:4, NA, 6:8, NA, 10))
draw(anno, test = "pch has NA values")
anno = anno_simple(1:10, pch = c(rep("A", 5), rep(NA, 5)))
draw(anno, test = "pch has NA values")
pch = matrix(1:20, nc = 2)
pch[sample(length(pch), 10)] = NA
anno = anno_simple(cbind(1:10, 10:1), pch = pch)
draw(anno, test = "matrix, pch is a matrix with NA values")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.