View source: R/HeatmapAnnotation-class.R
HeatmapAnnotation | R Documentation |
Constructor Method for HeatmapAnnotation class
HeatmapAnnotation(...,
df = NULL, name, col, na_col = "grey",
annotation_legend_param = list(),
show_legend = TRUE,
which = c("column", "row"),
gp = gpar(col = NA),
border = FALSE,
gap = unit(1, "points"),
show_annotation_name = TRUE,
annotation_label = NULL,
annotation_name_gp = gpar(),
annotation_name_offset = NULL,
annotation_name_side = ifelse(which == "column", "right", "bottom"),
annotation_name_rot = NULL,
annotation_name_align = FALSE,
annotation_height = NULL,
annotation_width = NULL,
height = NULL,
width = NULL,
simple_anno_size = ht_opt$simple_anno_size,
simple_anno_size_adjust = FALSE)
... |
Name-value pairs where the names correspond to annotation names and values can be a vector, a matrix and an annotation function. Each pair is sent to |
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 contain color mapping to |
na_col |
Color for |
annotation_legend_param |
A list which contains parameters for annotation legends. See |
show_legend |
Whether show annotation legends. The value can be one single value or a vector. |
which |
Are these row annotations or column annotations? |
gp |
Graphic parameters for simple annotations (with |
border |
border of single annotations. |
gap |
Gap between annotations. It can be a single value or a vector of |
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 or at the bottom. The value can be a vector. |
annotation_label |
Labels for the annotations. By default it is the same as individual annotation names. |
annotation_name_gp |
Graphic parameters for anntation names. Graphic paramters can be vectors. |
annotation_name_offset |
Offset to the annotation names, a |
annotation_name_side |
Side of the annotation names. |
annotation_name_rot |
Rotation of the annotation names. The value can be a vector. |
annotation_name_align |
Whether to align the annotation names. |
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 whole column annotations. |
width |
Width of the whole heatmap annotations. |
simple_anno_size |
Size of the simple annotation. |
simple_anno_size_adjust |
Whether also adjust the size of simple annotations when adjusting the whole heatmap annotation. |
For arguments show_legend
, border
, annotation_name_offset
, annotation_name_side
, annotation_name_rot
,
show_annotation_name
, they can be set as named vectors to modify values for some of the annotations,
e.g. assuming you have an annotation with name foo
, you can specify border = c(foo = TRUE)
in HeatmapAnnotation
.
There are three ways to specify heatmap annotations:
1. If the annotation is simply a vector or a matrix, it can be specified like HeatmapAnnotation(foo = 1:10)
.
2. If the annotations are already stored as a data frame, it can be specified like HeatmapAnnotation(df = df)
.
3. For complex annotations, users can use the pre-defined annotation functions such as anno_points
: HeatmapAnnotation(foo = anno_points(1:10))
.
For more details and examples, please check https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html.
A HeatmapAnnotation-class
object.
Zuguang Gu <z.gu@dkfz.de>
There are two helper functions: rowAnnotation
and columnAnnotation
.
# There is no example
NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.