Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

HeatmapAnnotation

Constructor Method for HeatmapAnnotation class


Description

Constructor Method for HeatmapAnnotation class

Usage

HeatmapAnnotation(...,
    df, 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)

Arguments

...

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 SingleAnnotation to contruct a single annotation.

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 df or simple annotations defined in .... See SingleAnnotation for how to set colors.

na_col

Color for NA values in simple annotations.

annotation_legend_param

A list which contains parameters for annotation legends. See color_mapping_legend,ColorMapping-method for all possible options.

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 fill parameter ignored).

border

border of single annotations.

gap

Gap between annotations. It can be a single value or a vector of unit objects.

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 unit object. The value can be a vector.

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.

Details

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)).

Value

Author(s)

Zuguang Gu <z.gu@dkfz.de>

See Also

There are two helper functions: rowAnnotation and columnAnnotation.

Examples

# There is no example
NULL

ComplexHeatmap

Make Complex Heatmaps

v2.6.2
MIT + file LICENSE
Authors
Zuguang Gu
Initial release
2020-11-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.