decorate_dend: Decorate Heatmap Dendrograms

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/decorate.R

Description

Decorate Heatmap Dendrograms

Usage

1
2
decorate_dend(heatmap, code, slice = 1, which = c("column", "row"),
    envir = new.env(parent = parent.frame()))

Arguments

heatmap

Name of the heatmap.

code

Code that adds graphics in the selected heatmap dendrogram.

slice

Index of the row slice or column slice in the heatmap.

which

Is the dendrogram on rows or on columns?

envir

Where to look for variables inside code.

Details

If you know the number of leaves in the dendrogram, it is simple to calculate the position of every leave in the dendrogram. E.g., for the column dendrogram, the i^th leave is located at:

1
2
    # assume nc is the number of columns in the column slice
    unit((i-0.5)/nc, "npc")  

Value

This function returns no value.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

See Also

https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-decoration.html

Examples

1
2
3
4
5
set.seed(123)
Heatmap(matrix(rnorm(100), 10), name = "mat", km = 2)
decorate_dend("mat", {
    grid.rect(gp = gpar(fill = "#FF000080"))
}, which = "row", slice = 2)

Example output

Loading required package: grid

ComplexHeatmap documentation built on Nov. 14, 2020, 2:01 a.m.