annotation_numeric-method: Adds a numeric annotation layer to an 'InputHeatmap', that on...

annotation_numericR Documentation

Adds a numeric annotation layer to an 'InputHeatmap', that on evaluation creates a 'ComplexHeatmap'

Description

'annotation_numeric()' from an 'InputHeatmap' object adds a numeric annotation layer.

Usage

annotation_numeric(
  .data,
  .column,
  palette = NULL,
  size = NULL,
  labels_format = function(x) sprintf("%.1f", x),
  ...
)

## S4 method for signature 'InputHeatmap'
annotation_numeric(
  .data,
  .column,
  palette = NULL,
  size = NULL,
  labels_format = function(x) sprintf("%.1f", x),
  ...
)

Arguments

.data

A 'tbl_df' formatted as | <ELEMENT> | <FEATURE> | <VALUE> | <...> |

.column

Vector of quotes

palette

A character vector of colours, or a function such as colorRamp2 (see examples).

size

A grid::unit object, e.g. unit(2, "cm"). This is the height or width of the annotation depending on the orientation.

labels_format

A function to format the numeric labels. By default, it formats numbers to two decimal places using 'sprintf(" supply any function that takes a numeric vector and returns a character vector for customised formatting.

...

The arguments that will be passed to anno_numeric and HeatmapAnnotation if you want to fine tune the aesthetics.

Details

\lifecycle

maturing

It uses 'ComplexHeatmap' as the visualisation tool.

Value

An 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'.

An 'InputHeatmap' object that gets evaluated to a 'ComplexHeatmap'.

Source

[Mangiola and Papenfuss, 2020](https://joss.theoj.org/papers/10.21105/joss.02472)

References

Mangiola, S. and Papenfuss, A.T., 2020. "tidyHeatmap: an R package for modular heatmap production based on tidy principles." Journal of Open Source Software. doi:10.21105/joss.02472.

Examples


hm = 
  tidyHeatmap::N52 |>
  tidyHeatmap::heatmap(
    .row = symbol_ct,
    .column = UBR,
    .value = `read count normalised log`
)

hm |> annotation_numeric(inflection)

# Align to the right 
hm |> annotation_numeric(inflection, align_to = "right")


stemangiola/tidyHeatmap documentation built on Jan. 27, 2025, 5:52 p.m.