Skip to contents

This function generates a heatmap of average marker expressions, grouped by a specified metadata column. The heatmap allows customization of clustering distance, color palette, font size, and scaling method.

Usage

plotAvgHeatmap(
  data,
  group_column,
  only_relevant_markers = FALSE,
  clustering_distance = "euclidean",
  colors = rev((grDevices::colorRampPalette(RColorBrewer::brewer.pal(n = 11,
    "RdYlBu")))(100)),
  fontsize = 8,
  scale = "column",
  cluster_rows = FALSE,
  na.rm = TRUE
)

Arguments

data

An object of class CygnusObject containing an expression matrix and metadata.

group_column

Character string specifying the metadata column to group by.

only_relevant_markers

Logical value indicating whether only relevant markers should be plotted.

clustering_distance

Character string specifying the distance metric for clustering columns. Default is "euclidean".

colors

A color palette to use for the heatmap. Default is a reversed "RdYlBu" palette from RColorBrewer.

fontsize

Numeric value specifying the font size for heatmap text. Default is 8.

scale

Character string specifying whether the data should be scaled by 'row', 'column', or 'none'. Default is 'column'.

cluster_rows

Logical value indicating whether to cluster rows in the heatmap. Default is FALSE.

na.rm

Logical value indicating whether to remove NA values before calculating averages. Default is TRUE.

Value

A heatmap plot showing average marker expressions grouped by the specified metadata column.