agentsclimarketplace

Pubchem metadata retrieval

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v2/skills/pubchem-metadata-retrieval

Use when after compound database dereplication (via SIRIUS or MetFrag) has produced per-spectrum candidate annotation lists with putative compound identifiers, and before applying selection criteria to rank and filter candidates.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill pubchem-metadata-retrieval

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

7.2 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

pubchem-metadata-retrieval

Summary

Retrieve molecular properties and chemical validity metadata from PubChem for compound candidates using PubChemPy, enabling downstream filtering and ranking in metabolome annotation workflows. This skill bridges spectral/compound database dereplication results with structural validation by querying PubChem's chemical registry.

When to use

After compound database dereplication (via SIRIUS or MetFrag) has produced per-spectrum candidate annotation lists with putative compound identifiers, and before applying selection criteria to rank and filter candidates. Use this skill when you have CSV or JSON candidate annotations from SIRIUS/MetFrag and need to validate chemical identity and retrieve molecular descriptors (molecular weight, InChI, SMILES, validity flags) to assess annotation confidence.

When NOT to use

  • Candidates already have validated PubChem InChI/SMILES and do not require redundant metadata retrieval.
  • Input compound identifiers are not resolvable in PubChem (e.g., proprietary or novel compounds without PubChem records).
  • The workflow goal is de novo structure elucidation rather than database annotation; PubChem retrieval is not appropriate for unknown structures.

Inputs

  • CSV or JSON candidate annotation table from SIRIUS or MetFrag dereplication
  • Compound identifiers or chemical names (per-candidate)
  • MS1 mass data (for cross-validation)

Outputs

  • Enriched candidate table with PubChem metadata (InChI, SMILES, molecular weight)
  • Molecular fingerprints and structural descriptors (RDKit-computed)
  • Ranked and filtered candidate list with selection scores
  • CSV output of curated candidates sorted by confidence

How to apply

Load candidate annotations from SIRIUS or MetFrag dereplication output (CSV or JSON format), extracting compound identifiers or names. For each candidate, query PubChem via PubChemPy to retrieve molecular properties (molecular weight, InChI, SMILES, validity status). Combine retrieved metadata with RDKit-computed structural descriptors (fingerprints, descriptor ranges). Apply selection criteria based on chemical validity flags, descriptor ranges, and PubChem match confidence scores. Rank and filter candidates by cumulative selection score, retaining only those meeting confidence thresholds before output. This ensures that final candidate annotations are chemically valid and grounded in PubChem's curated registry.

Related tools

Examples

python3.10 Workflow_Python_Script_all_MetFrag.py --msp_file your_file_name/spectral_dereplication/spectral_results.csv --ms1data your_file_name/insilico/MS1DATA.csv --score_thresh 0.75

Evaluation signals

  • All candidate rows in output table contain non-null PubChem metadata fields (InChI, SMILES, molecular weight)
  • Chemical validity flags match expected status (e.g., 'valid' for known compounds, 'invalid' for chemically implausible structures)
  • Molecular weight values retrieved from PubChem agree with MS1 precursor mass within specified tolerance (e.g., ±5 ppm or Da)
  • Candidates are ranked by selection score in descending order, with scores reflecting combined validity and descriptor confidence
  • Output CSV contains all required columns: candidate ID, compound name, InChI, SMILES, molecular weight, RDKit descriptors, and selection score

Limitations

  • PubChem query success depends on internet connectivity and PubChem API availability; rate limiting may slow retrieval for large candidate sets.
  • Candidates without PubChem records (novel, proprietary, or rare compounds) will fail retrieval or return null metadata, excluding them from downstream selection.
  • PubChem InChI/SMILES may differ from de novo structure determination results; conflicts should be flagged for manual review.
  • Molecular weight agreement with MS1 data is approximate and depends on mass accuracy; 5 ppm tolerance may not catch systematic instrument calibration errors.

Evidence

  • [intro] Query PubChem via PubChemPy to retrieve molecular properties and chemical validity for each candidate: "Query PubChem via PubChemPy to retrieve molecular properties and chemical validity for each candidate."
  • [intro] Load candidate annotations from SIRIUS or MetFrag dereplication output (CSV or JSON format): "Load candidate annotations from SIRIUS or MetFrag dereplication output (CSV or JSON format)."
  • [intro] Compute molecular fingerprints and structural descriptors using RDKit for each candidate: "Compute molecular fingerprints and structural descriptors using RDKit for each candidate."
  • [readme] Final candidate selection is done in Python using RDKit and PubChemPy: "Final candidate selection is done in Python using RDKit and PubChemPy."
  • [intro] Apply selection criteria (e.g., chemical validity, descriptor ranges, PubChem match confidence) to filter and rank candidates: "Apply selection criteria (e.g., chemical validity, descriptor ranges, PubChem match confidence) to filter and rank candidates."

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.