build_heatmap_annotation: Build HeatmapAnnotation with safe parameter merge

View source: R/heatmap.R

build_heatmap_annotationR Documentation

Build HeatmapAnnotation with safe parameter merge

Description

Build HeatmapAnnotation with safe parameter merge

Usage

build_heatmap_annotation(
  annotations,
  which,
  show_annotation_name = TRUE,
  annotation_name_side = NULL,
  border = NULL,
  params = NULL
)

Arguments

annotations

Named list of annotation components (for example, anno_simple, anno_block, anno_customize).

which

Annotation direction ("row" or "column").

show_annotation_name

Whether to show annotation names.

annotation_name_side

Side for annotation names.

border

Border flag passed to ComplexHeatmap::HeatmapAnnotation.

params

Additional user parameters; duplicated keys are ignored if already set explicitly.

Value

A ComplexHeatmap::HeatmapAnnotation object.

Examples

anno <- list(
  group = ComplexHeatmap::anno_simple(
    x = c("A", "B", "A"),
    col = c(A = "#1b9e77", B = "#d95f02"),
    which = "column"
  )
)
ha <- build_heatmap_annotation(
  annotations = anno,
  which = "column",
  show_annotation_name = TRUE,
  annotation_name_side = "left",
  params = list(gap = grid::unit(1, "mm"))
)
ha

thisplot documentation built on March 7, 2026, 5:07 p.m.