Server logic for the ComplexHeatmap module
Source:R/ComplexHeatmap_Heatmap_module_server.R
ComplexHeatmap_HeatmapServer.RdServer logic for the ComplexHeatmap module
Usage
ComplexHeatmap_HeatmapServer(
id,
data,
hide.inputs = NULL,
hide.tabs = NULL,
defaults = NULL
)Arguments
- id
The ID for the Shiny module.
- data
A
reactiveyielding either a data frame (the matrix's columns plus any row-annotation columns, all together — the original, single-table behavior) orlist(matrix = <data.frame>, column_annotations = <data.frame>)to additionally enable column annotations, wherecolumn_annotationsis a per-sample metadata table keyed by a column matching the matrix's selected column names (see the "Column Key" input). ANULLvalue (or a list missingmatrix) is treated as "not ready yet" and the module waits for data.- hide.inputs
A character vector of input IDs to hide. These will still be initialized and their values used, but the user will not be able to see/adjust them in the UI.
- hide.tabs
A character vector of tab names to hide. Inputs in these tabs will still be initialized and used, but not shown in the UI.
- defaults
A named list of default values for the inputs. When the reset button is clicked, inputs are reset to these values rather than hardcoded fallbacks. Typically the same list passed to the UI function. An entry may also be a
shiny::reactive()orshiny::reactiveVal(), in which case the input tracks it as the parent app's state changes; seesetup_reactive_defaults().
Value
The moduleServer function for the ComplexHeatmap module. The
returned reactive yields the source-download bundle (matrix data + inputs).
Details
The incoming data frame is converted to a numeric matrix using the
selected matrix columns (and optional row-name column). Row/column
annotation tracks configured on the "Annotations" tab are built as
ComplexHeatmap::rowAnnotation()/ComplexHeatmap::columnAnnotation() (one
per side) and passed as left_annotation/right_annotation/
top_annotation/bottom_annotation. The heatmap is built
with ComplexHeatmap::Heatmap() and registered for interactivity with
InteractiveComplexHeatmap::makeInteractiveComplexHeatmap(), which draws it
onto its own device to capture the interactive widget.
Both ComplexHeatmap and InteractiveComplexHeatmap are
Bioconductor packages and are only required at runtime for this module; they
are guarded with requireNamespace().