/atomistic-skills:chem-spectrum-matcherfrom Atomistic Skills
Ranks candidate molecules by spectral similarity to an experimental query using predicted or database reference spectra (1H NMR, IR).
Ships in Atomistic Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
To retrieve or generate reference spectra for a set of candidate molecules and rank them by similarity to an experimental query spectrum. The skill abstracts a common three-component pattern:
This pattern applies to any spectral modality: 1H NMR, 13C NMR, IR, mass spectrometry, UV-Vis, Raman. The concrete implementation here covers 1H NMR and IR, with the NMR path fully implemented and IR sketched for extension.
general-query-literature-database first.chem-nmr-analysis (Wasserstein deconvolution) for quantifying component ratios.chem-nmr-predict (SPINUS) covers 1H only. Extension needed.SMILES ──► [Predictor] ──► predicted spectrum (.xy / .jdx)
│
▼
[Local Catalog] ◄── register_spectrum.py
│
[Public DB fallback] ──────────┤ (NMRShiftDB2, NIST WebBook)
│
▼
Experimental query ──► [match_spectrum.py] ──► ranked candidates
| Modality | Predictor skill | Public DB | Similarity metric |
|---|---|---|---|
| 1H NMR | chem-nmr-predict (SPINUS + nmrsim) | NMRShiftDB2 | L2 / Wasserstein |
| IR | chem-db-spectra (NIST) or ORCA DFT | NIST WebBook | Cosine |
| 13C NMR | (not yet implemented) | NMRShiftDB2 | L2 |
| Mass spec | (not yet implemented) | NIST WebBook | Dot product |
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/match_spectrum.py \
--query experimental_spectrum.xy \
--smiles "CCO" \
--names "ethanol" \
--modality nmr_1h \
--catalog_dir research/spectrum_catalog/ \
--output_dir <research_dir>/spectrum_match/ \
--fallback_public_db
Run the appropriate predictor for the modality, then register outputs into the catalog, then match.
1H NMR:
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/../chem-nmr-predict/scripts/predict_nmr.py \
--smiles "CCO" \
--names "ethanol" \
--field_mhz 400 \
--output_dir <research_dir>/nmr_predictions/
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/register_spectrum.py \
--source_dir <research_dir>/nmr_predictions/ \
--modality nmr_1h \
--catalog_dir research/spectrum_catalog/
IR (from NIST WebBook):
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/../chem-db-spectra/scripts/query_spectra.py \
C10H18O <research_dir>/ir_references/ --type IR
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/register_spectrum.py \
--source_dir <research_dir>/ir_references/ \
--modality ir \
--catalog_dir research/spectrum_catalog/
IR (QM-backed, high accuracy):
# Run ORCA frequency calculation → extract IR spectrum → register
# ORCA setup (ORCA_BINARY_PATH, x86_64 only): see the chem-dft-orca-singlepoint skill.
# After ORCA run, convert output with ${CLAUDE_SKILL_DIR}/../../src/utils/dft/orca_utils.py
# then call register_spectrum.py --modality ir
match_spectrum.py retrieves reference spectra (catalog → public DB fallback) and computes similarity scores between the query and each candidate.
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/match_spectrum.py \
--query experimental_spectrum.xy \
--smiles "CCO" \
--names "ethanol" \
--modality nmr_1h \
--metric l2 \
--catalog_dir research/spectrum_catalog/ \
--output_dir <research_dir>/spectrum_match/ \
--plot
Arguments:
--query: experimental spectrum file (two-column, ppm/wavenumber vs intensity; .xy, .csv, .jdx).--smiles: candidate SMILES strings.--names: human-readable labels matching SMILES order.--modality: nmr_1h, nmr_13c, ir. Controls which catalog partition and public DB to query.--metric: similarity metric — l2 (default), cosine, wasserstein. Choose based on modality (see table above).--catalog_dir: local spectrum catalog directory.--fallback_public_db: query NMRShiftDB2 or NIST WebBook for any candidate not in catalog.--field_mhz: spectrometer field (NMR only, default 400). Must match experimental spectrum.--plot: emit overlay plot (match_plot.png) with query and top-3 candidates.--output_dir: directory for outputs.Outputs:
match_results.json — ranked candidates with similarity scores, source (catalog/public_db/predicted), and spectrum paths.match_plot.png — overlay of query vs ranked references (if --plot).input_configs.yaml — all parameters for reproducibility.Read match_results.json. Candidates are ranked by descending similarity score (1.0 = perfect match, 0.0 = no overlap).
If/Then rules:
| Score (L2 / cosine) | Interpretation | Agent action |
|---|---|---|
| > 0.90 | Strong match | Report top candidate with confidence. |
| 0.70–0.90 | Plausible match | Report with caveat; check overlay plot for unmatched peaks. |
| < 0.70 | Poor match | Likely wrong candidate or missing structure. Expand candidate list or re-examine experimental spectrum. |
After reading scores, the agent must:
match_plot.png — verify visual agreement, check for systematic shifts.| Failure | Symptom | Agent action |
|---|---|---|
| Catalog miss, no public DB hit | match_results.json candidate marked missed | Run appropriate predictor then register_spectrum.py. |
| Ppm/wavenumber axis mismatch | Similarity scores all near 0 | Query and reference use different x-axis. Check --field_mhz or unit convention. |
| SMILES canonicalization fails | RDKit error | SMILES invalid. Verify with RDKit before retry. |
| NMRShiftDB2 / NIST timeout | HTTP error during public DB query | Retry once; if persistent, disable --fallback_public_db and predict locally. |
| ORCA IR prediction unavailable | ORCA_BINARY_PATH not set | Set it as described in the chem-dft-orca-singlepoint skill, or fall back to NIST WebBook IR. |
drug-db-pubchem → resolve compound name to SMILES
chem-nmr-predict → 1H NMR prediction (SPINUS + nmrsim)
chem-db-spectra → experimental IR/MS from NIST WebBook
chem-nmr-analysis → mixture deconvolution (Wasserstein)
chem-spectrum-matcher → this skill: catalog + retrieval + similarity ranking
Primary (NMR matching):
Required packages: numpy, scipy, rdkit, requests, matplotlib.
IR prediction via QM (optional):
Requires the ORCA_BINARY_PATH environment variable (see the chem-dft-orca-singlepoint skill); x86_64 only, since SCINE has no aarch64 wheels.
catalog.json keyed by (canonical_smiles, modality). Do not edit manually..xy files are two-column tab-separated (x-axis descending, intensity). .jdx files are parsed via the jcamp package.Author: Magdalena Lederbauer Contact: GitHub @mlederbauer
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub learningmatter-mit/atomisticskills --plugin atomistic-skills133 skills in this plugin
/chem-bond-dissociationCalculate homolytic and heterolytic bond dissociation energies (BDEs) for all single bonds in a molecule using MLIPs with RDKit fragmentation./chem-conformer-searchGenerate molecular conformers with RDKit ETKDG, relax with MLIPs, and rank by energy with Boltzmann weighting./chem-db-mofQuery multiple MOF databases (QMOF via MPContribs; ARC-MOF DB7/Majumdar et al. via Materials Cloud) and download CIF structures with optional element or identifier filters.Other plugins' skills for the same job