Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Map metabolites to biological pathways using KEGG, Reactome, and MetaboAnalyst. Perform pathway enrichment and topology analysis. Use when interpreting metabolomics results in the context of biochemical pathways.
.claude/skills/bio-metabolomics-pathway-mapping/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-08 | ✗→✓ | ▲ Improved | — | — |
| case-21 | ✗→✓ | ▲ Improved | — | — |
| case-02 | ✗→✓ | ▲ Improved | — | — |
| case-12 | ✗→✓ | ▲ Improved | — | — |
| case-06 | ✗→✓ | ▲ Improved | — | — |
Reference examples tested with: ReactomePA 1.46+, clusterProfiler 4.10+
Before using code patterns, verify installed versions match. If versions differ:
packageVersion('<pkg>') then ?function_name to verify parametersIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"Map my metabolites to pathways" → Perform pathway enrichment and topology analysis using KEGG, Reactome, or MetaboAnalyst to interpret metabolomics results in biochemical context.
MetaboAnalystR::SetMetabolomeFilter() → PerformDetailMatch() → pathway topologyrlibrary(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)
r# 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
r# Considers pathway structure (betweenness, degree) mSet <- InitDataObjects('conc', 'pathinteg', FALSE) mSet <- SetOrganism(mSet, 'hsa') mSet <- Setup.MapData(mSet, metabolites) mSet <- CrossReferencing(mSet, 'hmdb') # Topology analysis mSet <- SetKEGG.PathLib(mSet, 'hsa', 'current') mSet <- SetMetabolomeFilter(mSet, FALSE) mSet <- CalculateHyperScore(mSet) # Combined ORA + topology topo_results <- mSet$analSet$topo.mat
rlibrary(ReactomePA) library(clusterProfiler) # Convert to Reactome IDs (if available) reactome_ids <- c('R-HSA-70171', 'R-HSA-1428517') # Example # Enrichment enriched <- enrichPathway(gene = reactome_ids, organism = 'human', pvalueCutoff = 0.05) print(enriched)
rlibrary(KEGGREST) # Get pathway information pathway_info <- keggGet('hsa00010') # Glycolysis # Map compounds to pathways kegg_ids <- c('C00031', 'C00186', 'C00022') # Glucose, Lactate, Pyruvate # Find pathways containing these compounds find_pathways <- function(kegg_id) { pathways <- keggLink('pathway', kegg_id) return(pathways) } all_pathways <- lapply(kegg_ids, find_pathways)
rlibrary(pathview) # Visualize KEGG pathway with metabolite data metabolite_data <- c('C00031' = 1.5, 'C00186' = 2.3, 'C00022' = 0.7) pathview(cpd.data = metabolite_data, pathway.id = '00010', # Glycolysis species = 'hsa', cpd.idtype = 'kegg', out.suffix = 'glycolysis_mapped') # Output: hsa00010.glycolysis_mapped.png
Goal: Visualize metabolite-pathway relationships as a bipartite network for identifying pathway crosstalk and hub metabolites.
Approach: Extract metabolite-pathway edges from enrichment results, build an igraph network, and annotate nodes by type for interactive visualization.
rlibrary(igraph) # Build metabolite-pathway network build_network <- function(pathway_results) { edges <- data.frame() for (i in 1:nrow(pathway_results)) { pathway <- rownames(pathway_results)[i] metabolites <- strsplit(pathway_results$Metabolites[i], '; ')[[1]] for (met in metabolites) { edges <- rbind(edges, data.frame(from = met, to = pathway)) } } g <- graph_from_data_frame(edges, directed = FALSE) # Add attributes V(g)$type <- ifelse(V(g)$name %in% edges$from, 'metabolite', 'pathway') return(g) } network <- build_network(pathway_results) plot(network, vertex.size = ifelse(V(network)$type == 'pathway', 15, 5))
r# MSEA using predefined metabolite sets mSet <- InitDataObjects('conc', 'msetora', FALSE) # Use SMPDB (Small Molecule Pathway Database) mSet <- SetMetaboliteFilter(mSet, FALSE) mSet <- SetCurrentMsetLib(mSet, 'smpdb_pathway', 2) mSet <- Setup.MapData(mSet, metabolites) mSet <- CrossReferencing(mSet, 'hmdb') mSet <- CalculateHyperScore(mSet) msea_results <- mSet$analSet$ora.mat
r# Integrated pathway analysis (metabolites + genes) library(IMPaLA) # Prepare gene list genes <- c('HK1', 'PFKM', 'ALDOA') # Glycolysis enzymes # Prepare metabolite list metabolites <- c('HMDB0000122', 'HMDB0000190') # Glucose, Lactate # Joint pathway analysis # (Use MetaboAnalyst joint pathway analysis or custom integration)
r# Format for publication export_pathways <- function(results, output_file) { results_df <- as.data.frame(results) results_df$pathway <- rownames(results) # Select relevant columns results_df <- results_df[, c('pathway', 'Total', 'Expected', 'Hits', 'Raw p', 'Holm adjust', 'FDR', 'Impact')] # Sort by FDR results_df <- results_df[order(results_df$FDR), ] write.csv(results_df, output_file, row.names = FALSE) return(results_df) } export_pathways(pathway_results, 'pathway_enrichment.csv')
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-24 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +33 percentage points is the difference between those two pass rates over the 24 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.