get_heatmap_data() extracts the heatmap matrix as it appears in the plot along with the row and column dendrograms, all with consistent naming.

get_heatmap_data(.data)

# S4 method for class 'InputHeatmap'
get_heatmap_data(.data)

Source

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

Arguments

.data

A `InputHeatmap` object from tidyHeatmap::heatmap()

Value

A list containing:

  • matrix: The abundance matrix with rows and columns ordered as in the heatmap

  • row_dend: The row dendrogram object

  • column_dend: The column dendrogram object

A list containing the ordered matrix, row dendrogram, and column dendrogram

Details

[Maturing]

This function converts the InputHeatmap to ComplexHeatmap, draws it to perform clustering, then extracts the ordered matrix and dendrograms exactly as they appear in the heatmap plot.

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

# Get heatmap data as plotted
result <- hm |> get_heatmap_data()

ordered_matrix <- result$matrix
row_dendrogram <- result$row_dend
column_dendrogram <- result$column_dend