calculate_rank_metric: Calculate rank metric for GSEA

View source: R/pathway_gsea.R

calculate_rank_metricR Documentation

Calculate rank metric for GSEA

Description

Calculate rank metric for GSEA

Usage

calculate_rank_metric(
  abundance,
  metadata,
  group,
  method = "signal2noise",
  comparison = NULL
)

Arguments

abundance

A matrix of abundance data

metadata

A data frame of metadata

group

A character string specifying the grouping variable

method

A character string specifying the ranking method

comparison

Optional length-2 character vector c(group1, group2) defining the ranking direction for preranked GSEA. Positive values indicate higher abundance in group1. If NULL, exactly two aligned group levels must be present and factor-level order is used.

Details

The abundance matrix must carry explicit, unique feature row names. The returned ranking vector is validated for unique feature names, finite numeric statistics, and at least two distinct values; a fully tied ranking is not meaningful for preranked GSEA because enrichment would then depend on arbitrary input order.

Value

A named vector of ranking statistics


ggpicrust2 documentation built on Oct. 7, 2026, 1:07 a.m.