Learn R Programming

ComplexHeatmap (version 1.10.2)

anno_link: Link annotation with labels

Description

Link annotation with labels

Usage

anno_link(at, labels, which = c("column", "row"), side = ifelse(which == "column", "top", "right"),
    lines_gp = gpar(), labels_gp = gpar(), padding = 0.25, link_width = NULL)

Arguments

at
numeric index in the original matrix
labels
corresponding labels
which
column annotaiton or row annotation
side
side of the labels. If it is a column annotation, permitted values are "top" and "bottom"; If it is a row annotation, permitted values are "left" and "right".
lines_gp
graphic settings for the segments
labels_gp
graphic settings for the labels
padding
padding between labels if they are attached to each other
link_width,
width of the segments.

Value

Details

Sometimes there are many rows or columns in the heatmap and we want to mark some of the rows. This annotation function is used to mark these rows and connect labels and corresponding rows with links.

Examples

Run this code
mat = matrix(rnorm(10000), nr = 1000)
labels = sample(letters, 20, replace = TRUE)
Heatmap(mat, show_row_dend = FALSE, show_column_dend = FALSE) + 
rowAnnotation(link = row_anno_link(at = sample(1000, 20), labels = labels),
    width = unit(1, "cm") + max_text_width(labels))

Run the code above in your browser using DataLab