decorate_annotation: Decorate the heatmap annotation

Description Usage Arguments Details Value Author(s) Examples

Description

Decorate the heatmap annotation

Usage

1
decorate_annotation(annotation, code, slice, envir = new.env(parent = parent.frame()))

Arguments

annotation

name of the annotation

code

code that adds graphics in the selected heatmap body

slice

index of row slices in the heatmap

envir

where to look for variables inside code

Details

There is a viewport for every column annotation and row annotation. This function contructs the name of the viewport, goes to the viewport by seekViewport and applies code to that viewport.

Value

The function returns no value.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
set.seed(123)
ha1 = HeatmapAnnotation(df = data.frame(type = rep(letters[1:2], 5)))
ha2 = rowAnnotation(point = anno_points(runif(10), which = "row"))
Heatmap(matrix(rnorm(100), 10), name = "mat", km = 2,
    top_annotation = ha1) + ha2
decorate_annotation("type", {
    grid.circle(x = unit(c(0.2, 0.4, 0.6, 0.8), "npc"), 
        gp = gpar(fill = "#FF000080"))
})
decorate_annotation("point", {
    grid.rect(gp = gpar(fill = "#FF000080"))
}, slice = 2)

eilslabs/ComplexHeatmap documentation built on May 16, 2019, 1:21 a.m.