Package 'altmem'

Title: Alternative Interface to cytoMEM Marker Enrichment Modeling
Description: Automatically generate and display quantitative labels for cell populations that have been identified from flow cytometry, mass cytometry, and single-cell RNA-seq data.
Authors: Igor Dolgalev [aut, cre]
Maintainer: Igor Dolgalev <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2026-05-15 09:05:19 UTC
Source: https://github.com/igordot/altmem

Help Index


Marker Enrichment Modeling

Description

A wrapper around cytoMEM::MEM() that accepts a matrix, data frame, SummarizedExperiment, or SingleCellExperiment, and supports non-numeric cluster labels.

Usage

altmem(
  x,
  cluster_col,
  assay_name = "exprs",
  markers = "all",
  transform = FALSE,
  cofactor = 1,
  choose.markers = FALSE,
  choose.ref = FALSE,
  zero.ref = FALSE,
  IQR.thresh = NULL
)

Arguments

x

A matrix, data frame, SummarizedExperiment, or SingleCellExperiment.

cluster_col

Name of the column containing cluster labels.

assay_name

Name of the assay to use for the expression matrix. Only used for SummarizedExperiment input. Defaults to "exprs".

markers

Character vector of marker names to include, or "all" to use all markers.

transform, cofactor, choose.markers, choose.ref, zero.ref, IQR.thresh

Passed to cytoMEM::MEM().

Value

A list of matrices (the return value of cytoMEM::MEM()).


Heatmap of MEM scores

Description

Visualizes MEM enrichment scores as a heatmap.

Usage

mem_heatmap(
  x,
  show_mem_labels = FALSE,
  min_label_score = 1,
  max_label_markers = 5,
  show_label_scores = FALSE,
  min_heatmap_score = 0,
  filename = NULL,
  width = 15,
  height = 8,
  cluster_rows = TRUE,
  cluster_columns = TRUE,
  ...
)

Arguments

x

The return value of altmem() or cytoMEM::MEM().

show_mem_labels

Whether to annotate rows with MEM labels. When TRUE, labels are generated via mem_labels() using min_label_score, max_label_markers, and show_label_scores. Defaults to FALSE.

min_label_score

Minimum absolute MEM score for a marker to be included in the label. Defaults to 1.

max_label_markers

Maximum number of markers to include per direction (positive and negative) in each label. Defaults to 5.

show_label_scores

Whether to include MEM scores alongside marker names in the MEM labels. Defaults to FALSE.

min_heatmap_score

Minimum absolute MEM score across any cluster for a marker to be shown as a column in the heatmap. Increase this to remove low variance markers. Defaults to 0 (show all markers).

filename

Optional file path to save the heatmap. The format is inferred from the extension (e.g., ".png", ".pdf", ".svg"). Defaults to NULL (no file saved).

width, height

Plot dimensions in inches. Only used when filename is provided.

cluster_rows

Whether to cluster rows. Defaults to TRUE.

cluster_columns

Whether to cluster columns. Defaults to TRUE.

...

Additional arguments passed to ComplexHeatmap::Heatmap().

Value

A ComplexHeatmap::Heatmap object, invisibly.


MEM-enriched cluster labels

Description

Generates descriptive labels for each cluster that include measured features specifically enriched on the population based on MEM scores, following the cytoMEM format. Markers are ranked by absolute MEM score and separated into positively and negatively enriched groups.

Usage

mem_labels(
  x,
  min_label_score = 1,
  max_label_markers = 5,
  show_label_scores = TRUE
)

Arguments

x

The return value of altmem() or cytoMEM::MEM().

min_label_score

Minimum absolute MEM score for a marker to be included in the label. Defaults to 1.

max_label_markers

Maximum number of markers to include per direction (positive and negative) in each label. Defaults to 5.

show_label_scores

Whether to include MEM scores alongside marker names. Defaults to TRUE.

Value

A named character vector.