Skip to contents

This function performs input validation, optional gene ID conversion, log2 transformation (if needed), and single-sample gene set enrichment analysis (ssGSEA) on a gene expression matrix, then returns the pathway-level enrichment score matrix. It exposes the intermediate output that is normally consumed internally by classifyHNSC().

Usage

pathway_scores(input_expr = NULL, idType = "SYMBOL")

Arguments

input_expr

A numeric gene expression matrix (or data frame) with genes in rows and samples in columns. Row and column names are mandatory. Expression values must be non-negative (e.g. TPM, FPKM, or normalised counts). If the data are not on a log2 scale, they will be automatically log2-transformed via log2(x + 1) internally.

idType

Character string specifying the gene identifier type used in the rownames of input_expr. One of "SYMBOL" (default), "ENSEMBL", "ENTREZID", or "REFSEQ". If not "SYMBOL", the function converts rownames to gene symbols via org.Hs.eg.db.

Value

A numeric matrix with pathway gene sets in rows and samples in columns. Each value is the ssGSEA enrichment score for that pathway–sample pair. The pathway names correspond to the internal required.sets gene set collection curated for HNSCC subtype classification.

Details

Useful for downstream analyses such as pathway-level differential expression, gene set enrichment analysis (GSEA), clustering, or custom machine learning experiments using the same pathway representation that the classifier is built upon.

See also

classifyHNSC for the full classification pipeline, including the random forest step applied downstream of these scores.

Examples

if (FALSE) { # \dontrun{
data(TCGA_LUSC)
pw <- pathway_scores(TCGA_LUSC)
head(pw[, 1:5])            # first 5 samples, all pathways

# With Ensembl IDs
pw_ens <- pathway_scores(TCGA_LUSC_ENSEMBL, idType = "ENSEMBL")
} # }