Learn R Programming

dtGAP (version 0.0.2)

generate_legend_bundle: Generate a Bundle of Legends for Heatmap Components

Description

Creates and packs multiple legends (feature types, class labels, membership proportions, raw values, and proximity metrics) into a single legend bundle for ComplexHeatmap.

Usage

generate_legend_bundle(
  sorted_dat,
  task = c("classification", "regression"),
  show = c("all", "train", "test"),
  type_cols = NULL,
  label_cols,
  prop_cols = NULL,
  col_mat,
  col_Col_Proximity = NULL,
  col_Row_Proximity = NULL,
  direction = c("vertical", "horizontal")
)

Value

A ComplexHeatmap packed Legend object containing all specified legends.

Arguments

sorted_dat

List. Output of sorted_mat(), containing sorted_test_matrix and row_pro_mat_sorted.

task

Character. Type of task: "classification" or "regression".

show

Character. Which subset: "all", "train" or "test".

type_cols

Named vector of colors for feature type categories.

label_cols

Named vector or function of colors for class label categories.

prop_cols

Function. Color mapping function for membership proportion.

col_mat

Function. Color mapping function for raw data values.

col_Col_Proximity

Function. Color mapping function for column proximity.

col_Row_Proximity

Function. Color mapping function for row proximity.

direction

Character. Layout direction of packed legends, either "vertical" or "horizontal".