enrich_metabolic_pathway: Metabolic Pathway Enrichment Analysis

View source: R/14_enrich_pathways.R

enrich_metabolic_pathwayR Documentation

Metabolic Pathway Enrichment Analysis

Description

Performs enrichment analysis for metabolic pathways using HMDB or KEGG identifiers. The function applies statistical tests to assess the overrepresentation of queried compounds or proteins in metabolic pathways.

Usage

enrich_metabolic_pathway(
  query_id,
  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 protein identifiers.

id_type

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

pathway_database

The pathway database object containing metabolic pathway information.

only_primary_pathway

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

p_cutoff

Numeric. P-value cutoff for statistical significance. Default: '0.05'.

p_adjust_method

Character. Method to adjust p-values. Options include '"holm"', '"hochberg"', '"hommel"', '"bonferroni"', '"BH"', '"BY"', '"fdr"', '"none"'. Default: '"holm"'.

method

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

threads

Integer. Number of computational threads. Default: '3'.

Value

A list containing pathway enrichment results, including pathway ID, pathway name, pathway description, and enrichment statistics.

Examples

## Not run: 
  data("sample_pathway_database")
  query_compounds <- c("HMDB0000122", "HMDB0000532")
  metabolic_enrichment <- enrich_metabolic_pathway(
    query_id = query_compounds,
    id_type = "HMDB",
    pathway_database = sample_pathway_database,
    p_cutoff = 0.05,
    method = "fisher"
  )
  print(metabolic_enrichment)

## End(Not run)


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