Description Usage Arguments Details Value Author(s) See Also Examples
Constructor method for HeatmapAnnotation class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | HeatmapAnnotation(df, name, col, na_col = "grey",
annotation_legend_param = list(),
show_legend = TRUE,
...,
which = c("column", "row"),
annotation_height = 1,
annotation_width = 1,
height = calc_anno_size(),
width = calc_anno_size(),
gp = gpar(col = NA),
gap = unit(0, "mm"),
show_annotation_name = FALSE,
annotation_name_gp = gpar(),
annotation_name_offset = unit(2, "mm"),
annotation_name_side = ifelse(which == "column", "right", "bottom"),
annotation_name_rot = ifelse(which == "column", 0, 90))
|
df |
a data frame. Each column will be treated as a simple annotation. The data frame must have column names. |
name |
name of the heatmap annotation, optional. |
col |
a list of colors which contains color mapping to columns in |
na_col |
color for |
annotation_legend_param |
a list which contains parameters for annotation legends |
show_legend |
whether show legend for each column in |
... |
functions which define complex annotations or vectors of simple annotation. Values should be named arguments. |
which |
are the annotations row annotations or column annotations? |
annotation_height |
height of each annotation if annotations are column annotations. |
annotation_width |
width of each annotation if annotations are row annotations. |
height |
height of the column annotations, basically it is identical to |
width |
width of the whole heatmap annotations, only used for row annotation when appending to the list of heatmaps. |
gp |
graphic parameters for simple annotations. |
gap |
gap between each annotation |
show_annotation_name |
whether show annotation names. For column annotation, annotation names are drawn either on the left or the right, and for row annotations, names are draw either on top to at bottom. The value can be a vector. |
annotation_name_gp |
graphic parameters for anntation names. Graphic paramters can be vectors. |
annotation_name_offset |
offset to the annotations, |
annotation_name_side |
side of the annotation names. |
annotation_name_rot |
rotation of the annotation names, can only take values in |
The simple annotations are defined by df
and col
arguments. Complex annotations are
defined by the function list. So you need to at least to define df
or a annotation function.
A HeatmapAnnotation-class
object.
Zuguang Gu <z.gu@dkfz.de>
There are two shortcut functions: rowAnnotation
and columnAnnotation
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | df = data.frame(type = c("a", "a", "a", "b", "b", "b"))
ha = HeatmapAnnotation(df = df)
ha = HeatmapAnnotation(df = df, col = list(type = c("a" = "red", "b" = "blue")))
ha = HeatmapAnnotation(type = c("a", "a", "a", "b", "b", "b"),
col = list(type = c("a" = "red", "b" = "blue")))
ha = HeatmapAnnotation(df = df, col = list(type = c("a" = "red", "b" = "blue")),
which = "row")
ha = HeatmapAnnotation(points = anno_points(1:6))
ha = HeatmapAnnotation(histogram = anno_points(1:6))
mat = matrix(rnorm(36), 6)
ha = HeatmapAnnotation(boxplot = anno_boxplot(mat))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.