
Compute Pathway and Transcription Factor Activities with decoupleR
compute_activities.RdComputes pathway or transcription factor activities from a SpatialExperiment
using methods provided by the decoupleR package.
Arguments
- spe
SpatialExperimentcontaining expression data.- reference
A data frame with
source(gene set or regulator),target(gene identifier), andweightormor(weight or regulatory direction). Custom tables can be supplied directly; built-in references are retrieved withget_decoupleR_reference(). If both weight columns are present,moris used. The activity scoring methods AUCell, FGSEA, GSVA, and ORA do not use weights. Gene identifiers must match the expression assay row names and organism. At least five matching genes per set are required. Each source-target pair should occur only once. Custom tables withweightand no database-specific metadata use thedecoupleR_column prefix.- method
Activity method (e.g.,
"wmean","viper","gsva"); seedecoupleRdocs for options.- assay
Assay to use for calculations.
- statistic
If multiple statistics are produced, select one to store.
- ...
Further arguments passed to the selected method.
Examples
# Illustrative genes only; use a biologically justified reference for analysis.
ref <- data.frame(
source = rep("my_signature", 5),
target = c("STAT1", "IRF1", "CXCL9", "CXCL10", "IDO1"),
weight = rep(1, 5)
)
# Use known regulatory weights instead of 1 when available.
if (FALSE) { # \dontrun{
# spe must contain a normalized expression assay named "cpm".
spe <- compute_activities(spe, reference = ref, method = "ulm", assay = "cpm")
} # }