Internal function that runs Gene Set Variation Analysis
(gsva) on expression data using the cached CTD
chemical gene sets. Unlike ORA/GSEA/CAMERA — which return a single
p-value per chemical (group-level inference) — GSVA produces
per-sample enrichment scores: one row per chemical, one column
per sample. These scores are suitable for downstream clustering,
association tests against phenotypes, survival analysis, or heatmap
visualization.
A SummarizedExperiment is handed to GSVA unchanged rather than
reduced to its assay, because GSVA is itself SE-in/SE-out: the scores
then come back in a container that still carries colData, which
is what makes per-sample scores interpretable.
Arguments
- expr
Numeric expression matrix (genes x samples) or a
SummarizedExperiment.rownames(expr)must be Entrez IDs or HGNC symbols matching the cached CTD gene sets.- id_type
Either
"entrez","symbol", orNULLfor auto-detection fromrownames(expr).- cache_dir
Directory holding the cached CTD
.rdafiles.- interaction_types
Character vector of CTD
InteractionActionsvalues to retain when building gene sets, orNULLfor all.- assay
Assay name or index to use when
expris aSummarizedExperiment;NULL(default) takes the first. Ignored for a matrix.- ...
Forwarded to
gsvaParam(e.g.kcdf,minSize,maxSize,tau,maxDiff).