
Annotate GSEA results with pathway information
Source:R/gsea_pathway_annotation.R
gsea_pathway_annotation.RdThis function adds pathway annotations to GSEA results, including pathway names, descriptions, and classifications.
Details
The pathway_id column must contain non-empty values without
NA. Unknown but non-empty pathway IDs are retained as their own
display names when no reference annotation is found.
Examples
if (FALSE) { # \dontrun{
# Load example data
data(ko_abundance)
data(metadata)
# Prepare abundance data
abundance_data <- as.data.frame(ko_abundance)
rownames(abundance_data) <- abundance_data[, "#NAME"]
abundance_data <- abundance_data[, -1]
# Run GSEA analysis (using camera method - recommended)
gsea_results <- pathway_gsea(
abundance = abundance_data,
metadata = metadata,
group = "Environment",
pathway_type = "KEGG",
method = "camera"
)
# Annotate results
annotated_results <- gsea_pathway_annotation(
gsea_results = gsea_results,
pathway_type = "KEGG"
)
} # }