anno_link {ComplexHeatmap} | R Documentation

## 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, extend = 0)

### Arguments

`at` | numeric index in the original matrix
`labels` | corresponding labels
`which` | column annotation 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.
`extend` | by default, the region for the labels has the same width (if it is a column annotation) or same height (if it is a row annotation) as the heatmap. The size can be extended by this options. The value can be a proportion number or a `unit` object. The length can be either one or two.

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

### Value

A graphic function which can be set in `HeatmapAnnotation` constructor method.

### Author(s)

Zuguang Gu <z.gu@dkfz.de>

### Examples

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

[Package ComplexHeatmap version 1.20.0 Index]