metabolomics-workbench-database
Query Metabolomics Workbench REST API (4,200+ NIH studies) for metabolite ID, study discovery, RefMet standardization, m/z precursor searches, and gene/protein annotations. Quirks: compound input_item rejects `name` (use pubchem_cid/kegg_id/inchi_key/etc.); free-text → compound is a two-step refmet/match→refmet/name flow; moverz endpoint returns TSV text, not JSON. Use hmdb-database for local XML; pubchem-compound-search for general compound lookup.
npx skills add BioTender-max/awesome-bio-agent-skills --skill metabolomics-workbench-database --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Guides an AI agent to interact with the Metabolomics Workbench REST API to look up metabolite IDs, discover studies, standardise names to RefMet, perform m/z precursor searches, and fetch gene/protein annotations. It specifies input-item constraints (e.g., compound inputs must avoid the name input and use alternatives), and outlines workflows for converting free text to a canonical RefMet name and then to full records.
How it works
- Use the REST base URL https://www.metabolomicsworkbench.org/rest for requests.
- For compounds, the agent should perform a two-step process: (1) call /refmet/match/{user_text} to obtain a refmet_name, then (2) call /refmet/name/{refmet_name}/all to fetch the full record that includes IDs like pubchem_cid and inchi_key. If available, optionally fetch compound details via /compound/pubchem_cid/{cid}/all/json.
- For exact compound retrieval, query /compound/{input_item}/{input_value}/all/json with input_item from allowed list (regno, formula, inchi_key, lm_id, pubchem_cid, hmdb_id, kegg_id, SMILES, abbrev).
- To normalise a name to RefMet and then fetch the full record, use /refmet/match/{user_text} followed by /refmet/name/{refmet_name}/all.
- Use /study/study_id/{id}/summary for single-study summaries and /study/refmet_name/{name}/summary to list studies by RefMet name, then traverse to full summaries as needed.
- For RefMet-based annotation of MS hits, call /moverz/{REFMET|LIPIDS|MB}/{mz}/{ion}/{tol}/txt and parse the returned TSV (no JSON).
- If filtering studies via metstat endpoints, switch to study/... with client-side filtering, assembling summaries with /study/study_id/{id}/summary.
- The workflow examples show code patterns for Python requests, including error handling, JSON parsing, and CSV/TSV parsing.
When to use it
- When searching metabolite records by PubChem CID, KEGG ID, InChIKey, HMDB ID, formula, or SMILES.
- When discovering studies by species, disease, institute, analysis_type, or polarity.
- When standardising metabolite names to RefMet nomenclature for cross-study integration.
- When identifying unknown compounds from MS m/z values with adduct-aware matching (moverz).
- When retrieving experimental metabolite tables from published studies.
- When querying gene/protein annotations linked to metabolomics pathways.
- When downloading raw mwTab files for local analysis.
What it can touch
- Uses the base URL https://www.metabolomicsworkbench.org/rest.
- Calls to /refmet/match, /refmet/name, /compound, /study, /moverz, /gene, and /protein endpoints.
- No authentication is required; the description notes public access.
Caveats
- The moverz endpoint returns TSV text, not JSON.
- The compound/name input is rejected; use alternative input_item values (e.g., pubchem_cid, kegg_id, inchi_key, etc.).
- The refmet/name endpoint requires the canonical RefMet name; for fuzzy matching, use refmet/match first.
- Some older endpoints (metstat/filter/…) are deprecated in favor of study/{context}/{value}/summary with client-side filtering.
- The description recommends using hmdb-database for local XML and pubchem-compound-search for general compound lookups.
# Metabolomics Workbench Database — REST API Access ## Overview The Metabolomics Workbench (MW) REST API at `https://www.metabolomicsworkbench.org/rest/` exposes 4,200+ metabolomics studies hosted at UCSD under NIH Common Fund sponsorship. URL pattern is `/{context}/{input_item}/{input_value}/{output_item}/{format}`. Contexts include `compound`, `refmet`, `moverz`, `study`, `analysis`, `metabolite`, `gene`, `protein`. Notable quirks discovered live: - `compound/name/{x}` is **rejected** — `name` is not an allowed input_item. Use `pubchem_cid`, `kegg_id`, `inchi_key`, `hmdb_id`, `regno`, `lm_id`, `formula`, `smiles`, or `abbrev`. For free-text input, go through `refmet/match/{x}` first. - `refmet/name/{x}/all` requires the **exact** RefMet name (e.g. `Glucose`, not `D-glucose`); use `refmet/match/{x}` for fuzzy normalisation first. - `moverz/{REFMET|LIPIDS|MB}/{mz}/{ion}/{tol}/txt` returns **TSV text** (no JSON variant). - The `metstat/filter/...` endpoint shown in older examples returns `[]` — replace with `study/{context}/{value}/summary` (or `/metabolites`) + client-side filtering. No authentication required. ## When to Use - Searching metabolite records by PubChem CID, KEGG ID,
- Overview
- When to Use
- Prerequisites
- Quick Start
- Core API
- Module 1: Compound Queries
- Module 2: Study Discovery
- Module 3: RefMet Standardisation
- Module 4: Study Filtering (replaces broken metstat)
- Module 5: m/z Precursor Search (moverz)
- Module 6: Genes and Proteins
- Key Concepts
- Allowed inputitem Values per Context
- Output Type Conventions
pip install requests pandas
What does the metabolomics-workbench-database skill do?
Query Metabolomics Workbench REST API (4,200+ NIH studies) for metabolite ID, study discovery, RefMet standardization, m/z precursor searches, and gene/protein annotations. Quirks: compound input_item rejects `name` (use pubchem_cid/kegg_id/inchi_key/etc.); free-text → compound is a two-step refmet/match→refmet/name flow; moverz endpoint returns TSV text, not JSON. Use hmdb-database for local XML; pubchem-compound-search for general compound lookup.
How do I install it?
Run `npx skills add BioTender-max/awesome-bio-agent-skills --skill metabolomics-workbench-database --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From BioTender-max/awesome-bio-agent-skills, a repository with 135 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
