SKILL.md
Version Compatibility
Reference examples tested with: ReactomePA 1.46+, clusterProfiler 4.10+
Before using code patterns, verify installed versions match. If versions differ:
- R:
packageVersion('<pkg>')then?function_nameto verify parameters
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Metabolomics Pathway Mapping
"Map my metabolites to pathways" → Perform pathway enrichment and topology analysis using KEGG, Reactome, or MetaboAnalyst to interpret metabolomics results in biochemical context.
- R:
MetaboAnalystR::SetMetabolomeFilter()→PerformDetailMatch()→ pathway topology
KEGG Pathway Enrichment
library(MetaboAnalystR)
# Initialize MetaboAnalyst
mSet <- InitDataObjects('conc', 'pathora', FALSE)
# Set organism
mSet <- SetOrganism(mSet, 'hsa') # Human
# Load metabolite list (HMDB IDs or compound names)
metabolites <- c('HMDB0000001', 'HMDB0000005', 'HMDB0000010') # Example HMDB IDs
# Or use names: c('Glucose', 'Lactate', 'Pyruvate')
mSet <- Setup.MapData(mSet, metabolites)
mSet <- CrossReferencing(mSet, 'hmdb') # Or 'name', 'kegg', 'pubchem'
# Pathway analysis
mSet <- SetKEGG.PathLib(mSet, 'hsa', 'current')
mSet <- SetMetabolomeFilter(mSet, FALSE)
mSet <- CalculateOraScore(mSet, 'rbc', 'hyperg') # Over-representation
# Get results
pathway_results <- mSet$analSet$ora.mat
print(pathway_results)
Quantitative Enrichment Analysis (QEA)
# For continuous data (fold changes or concentrations)
mSet <- InitDataObjects('conc', 'pathqea', FALSE)
mSet <- SetOrganism(mSet, 'hsa')
# Load data with values
metabolite_data <- data.frame(
compound = c('Glucose', 'Lactate', 'Pyruvate'),
fc = c(1.5, 2.3, 0.7) # Fold changes
)
mSet <- Setup.MapData(mSet, metabolite_data)
mSet <- CrossReferencing(mSet, 'name')
# QEA analysis
mSet <- SetKEGG.PathLib(mSet, 'hsa', 'current')
mSet <- CalculateQeaScore(mSet, 'rbc', 'gt')
# Results
qea_results <- mSet$analSet$qea.mat
