enrich_pathways: Pathway Enrichment Analysis

View source: R/14_enrich_pathways.R

enrich_pathwaysR Documentation

Pathway Enrichment Analysis

Description

This function performs pathway enrichment analysis using metabolic pathway databases. It supports compound and metabolite enrichment based on HMDB or KEGG identifiers.

Usage

enrich_pathways(
  query_id,
  query_type = c("compound", "protein"),
  id_type = c("HMDB", "KEGG"),
  pathway_database,
  only_primary_pathway = FALSE,
  p_cutoff = 0.05,
  p_adjust_method = c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr",
    "none"),
  method = c("hypergeometric", "fisher"),
  threads = 3
)

Arguments

query_id

A vector of compound or metabolite identifiers.

query_type

Character. Type of query, either '"compound"' or '"protein"'. Default: '"compound"'.

id_type

Character. Type of identifier, either '"HMDB"' or '"KEGG"'. Default: '"HMDB"'.

pathway_database

The pathway database object containing pathway information.

only_primary_pathway

Logical. Whether to filter only primary pathways. Default: 'FALSE'.

p_cutoff

Numeric. The significance threshold for pathway enrichment. Default: '0.05'.

p_adjust_method

Character. P-value adjustment method. Options include '"holm"', '"hochberg"', '"hommel"', '"bonferroni"', '"BH"', '"BY"', '"fdr"', '"none"'. Default: '"holm"'.

method

Character. Statistical method used for enrichment analysis. Options: '"hypergeometric"' or '"fisher"'. Default: '"hypergeometric"'.

threads

Integer. Number of threads to use for computation. Default: '3'.

Value

A data frame containing the pathway enrichment results, including pathway ID, pathway name, description, p-values, adjusted p-values, and mapping statistics.

Examples

## Not run: 
  data("sample_pathway_database") # Load example pathway database
  query_metabolites <- c("HMDB0000122", "HMDB0000532", "HMDB0000889")
  enrichment_results <- enrich_pathways(
    query_id = query_metabolites,
    query_type = "compound",
    id_type = "HMDB",
    pathway_database = sample_pathway_database,
    p_cutoff = 0.05,
    method = "fisher"
  )
  print(enrichment_results)

## End(Not run)


tidymass/metpath documentation built on June 1, 2025, 10:05 p.m.