/atomistic-skills:chem-nmr-analysisfrom Atomistic Skills
Analyzes 1H NMR mixture spectra using Wasserstein deconvolution against reference spectra, predicts reaction products via ReactionT5, and tracks time-series kinetics with spectral plotting.
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.
The agent should use this skill's scripts when:
reaction-to-nmr-quantification.md or nmr-reaction-kinetics.md) calls for deconvolution, product prediction, kinetics analysis, or spectral plotting.For end-to-end workflows that chain this skill with other skills, see: .agents/workflows/reaction-to-nmr-quantification.md and .agents/workflows/nmr-reaction-kinetics.md.
general-plot-digitizer skill for that step.chem-nmr-predict skill for that step.drug-db-pubchem skill for that step.| Script | Purpose | Key Inputs | Key Outputs |
|---|---|---|---|
predict_products.py | Predict reaction products via ReactionT5 (HuggingFace API) | --reactant_smiles, --reagent_smiles | JSON with predicted product SMILES |
deconvolve.py | Wasserstein deconvolution of mixture against references | mixture file + reference files + --protons | proportions, Wasserstein distance, plot |
kinetics.py | Time-series deconvolution across multiple time points | --refs, --timepoints, --times | kinetics.csv + kinetics_plot.png |
plot.py | Overlay or stack NMR spectra for visual comparison | spectrum files + --labels | plot image |
spectra.py | I/O utilities (imported by other scripts, not called directly) | -- | -- |
The agent should use this script to predict reaction products from reactant and reagent SMILES via the ReactionT5 model.
export HF_TOKEN=<token>
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/predict_products.py \
--reactant_smiles "C1CCC(=O)C1" \
--reagent_smiles "[BH3-]" \
--output <research_dir>/predicted_products.json
The agent should use this script to determine mole fractions of known components in a mixture spectrum via Wasserstein-distance deconvolution.
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/deconvolve.py \
mixture.csv ref_borneol.xy ref_isoborneol.xy \
--protons 18 18 \
--names "borneol" "isoborneol" \
--baseline-window 3.70 3.94 \
--ppm-range 3.50 4.10 \
--range-protons 1 1 \
--plot <research_dir>/deconvolution_result.png \
--json
Choose --baseline-window from the overlay plot: a stretch with no signal in the
mixture or any reference, preferably close to the peaks being quantified. Add
--baseline-stat max when the baseline is a one-sided floor rather than noise (e.g.
digitized spectra, whose traced flat line leaves a small positive residue). Use
--ppm-range to fit only a region where each component has an isolated diagnostic
signal; omit it to fit the full spectrum. A restricted fit only sees the protons whose
signals lie in the range, so give their number per component with --range-protons
(here 1 1: one H2 proton in each isomer). Without it, each --protons count is scaled
by the fraction of the reference's area inside the range, which is only as reliable as
the reference spectrum's full-range integrals.
The agent should use this script when the user has crude NMR spectra recorded at multiple time points during a reaction.
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/kinetics.py \
--refs ref1.xy ref2.xy \
--timepoints t0.csv t10.csv t20.csv \
--times 0 10 20 \
--time_unit min \
--protons 18 18 \
--names "reactant" "product" \
--baseline_window 2.40 3.40 \
--output_dir <research_dir>/kinetics/
kinetics.py takes the same baseline and range options as deconvolve.py, spelled
with underscores (--baseline_window, --baseline_stat, --ppm_range, --range_protons).
kinetics.csv also records the noise fraction and the subtracted baseline of every
time point.
The agent should use this script to overlay or stack spectra for visual inspection before or after deconvolution.
${CLAUDE_SKILL_DIR}/../../venv/run cpu python ${CLAUDE_SKILL_DIR}/scripts/plot.py \
mixture.csv ref_borneol.xy ref_isoborneol.xy \
--labels "Mixture" "borneol" "isoborneol" \
--title "Mixture vs References" \
--output <research_dir>/spectra_overview.png
kinetics.py accepts the same baseline and range options with underscores
(--baseline_window, --baseline_stat, --ppm_range, --range_protons, --baseline_correct).
| Argument | Required | Description |
|---|---|---|
--protons | Yes | Number of 1H protons per molecule for each reference component. Critical for converting area fractions to mole fractions. The agent must look this up from the molecular formula or count from the SMILES. |
--names | No | Human-readable labels matching the order of reference files. The agent should always provide these for interpretable output. |
--baseline-window LO HI | Recommended | Signal-free ppm window. Its --baseline-stat is subtracted from the mixture and every reference, and negatives are clipped to 0. If a spectrum has no samples in the window (dropped zero runs), the points bounding the gap are used. The agent should use this for any spectrum with noise or a baseline offset. |
--baseline-stat | No | median (default) for noisy or offset baselines; max for one-sided floors such as the residue of a digitized flat line, which a median only half removes. max subtracts about 3σ from every peak of a noisy spectrum, so do not use it there. |
--ppm-range LO HI | No | Deconvolve only this range, applied after the baseline step. Use it to fit isolated diagnostic signals. |
--range-protons | With --ppm-range | Protons of each component whose signals lie inside --ppm-range, used for the proton correction instead of --protons. The agent should give it whenever the range is restricted and the counts are known (e.g. 1 1 for one diagnostic CH each). If omitted, each --protons count is scaled by the fraction of the full reference's area inside the range. |
--baseline-correct | No | Legacy: shifts each spectrum so its minimum is 0. Exact only for noise-free spectra with a constant offset. On noisy spectra the minimum is several σ below the baseline, which leaves a positive pedestal and pulls fractions toward an even mixture; on a reference floor with a zero-valued minimum it removes nothing. Mutually exclusive with --baseline-window. |
--kappa | No | Denoising penalty (default 0.25). The agent should not change this unless instructed. |
--plot | No | Output plot path. The agent should always generate a plot. |
--json | No | Emit machine-readable JSON output. The agent should always use this. |
The deconvolution output contains proportions, a Wasserstein distance (WD) indicating fit quality, and the unexplained ("noise") signal fraction, the share of the mixture signal not assigned to any reference (printed, and "noise" in the JSON; the noise_fraction column in kinetics.csv).
Check the noise fraction as well as WD. A baseline error can give a WD in the "acceptable" band while biasing the proportions badly. In the bundled examples, legacy minimum subtraction gave WD 0.11–0.14 with noise fractions of 0.36–0.43 and fractions off by up to 23 points. If the noise fraction exceeds about 0.2, the agent should inspect the residual panel, revisit the baseline (--baseline-window, --baseline-stat), and consider --ppm-range before reporting proportions.
If/Then rules for Wasserstein distance:
The reported proportions are renormalized to sum to 1 over the supplied references. The "noise" fraction is reported separately; the agent should state it and explain what the unmatched signal might be (a missing component, residual baseline, distorted lineshapes).
Verification: After deconvolution, the agent must inspect the deconvolution plot, check the residual panel for large residuals, and verify that proportions are chemically reasonable. If results contradict known chemistry, the agent should flag this to the user rather than silently accepting.
All spectrum files must be two-column numeric data (ppm, intensity):
.csv -- comma-delimited (auto-detected).xy -- tab-delimited (auto-detected).tsv -- tab-delimitedIf the user provides a Mnova export -- the agent should add --mnova flag to deconvolve.py.
All scripts in this skill use the cpu environment (created on first use by venv/run; no separate install).
Required packages: numpy, scipy (>= 1.7), matplotlib, rdkit, requests, nmrsim, scikit-learn.
HF_TOKEN (for ReactionT5 product prediction): the agent should check if HF_TOKEN is set before attempting product prediction. If not set, the agent should ask the user to provide it or provide product SMILES directly.
| Failure | Symptom | Agent Action |
|---|---|---|
| SPINUS returns no atoms | chem-nmr-predict prints FAILED for a compound | The SMILES may be invalid or the molecule too large. The agent should verify the SMILES and retry, or ask the user for a measured reference spectrum. |
| ReactionT5 returns no products | predict_products.py returns empty products list | The agent should use its own chemistry knowledge to suggest products and ask the user to confirm. |
| Wasserstein distance very high (> 0.15) | Deconvolution result unreliable | Missing component, ppm offset, or baseline issue. The agent should investigate and not report proportions as reliable. |
| High noise fraction (> ~0.2) with an "acceptable" WD | Proportions biased toward an even mixture or toward one component | Usually a baseline problem: legacy --baseline-correct on noisy spectra, or a positive floor on the references. The agent should rerun with --baseline-window (and --baseline-stat max for digitized floors), and restrict --ppm-range to diagnostic signals if the rest of the spectrum is distorted. |
| Proportions are all near zero except one | One component dominates | May be correct (e.g., >95% product), or may indicate missing starting material reference. The agent should check. |
| nmrsim simulation fails | Warning in chem-nmr-predict output | Falls back to stick spectrum (shifts only, no multiplet structure). The agent should note reduced accuracy of that reference. |
| kinetics curves are non-monotonic | Composition jumps up and down over time | Likely a mislabeled time point, phasing issue, or missing component. The agent should investigate individual spectra. |
deconvolve.py --baseline-window --ppm-range gives 13:87 (direct integral 12.6:87.4; 17:83 reported by Lopansri et al. 2022); legacy --baseline-correct gives 6:94.kinetics.py --baseline_window on a synthetic series recovers the reference-free first-order k within 5 % (0.9σ); legacy --baseline_correct is 13 % low.Author: Jesus Diaz Sanchez Contact: GitHub @jdsanc
examples/deconvolution/README.md (opens in a new tab)examples/deconvolution/borneol.csv (opens in a new tab)examples/deconvolution/crude.csv (opens in a new tab)examples/deconvolution/isoborneol.csv (opens in a new tab)examples/deconvolution/output/full_range/deconvolution_result_fit.png (opens in a new tab)examples/deconvolution/output/full_range/deconvolve_result.json (opens in a new tab)examples/deconvolution/output/full_range/input_configs.yaml (opens in a new tab)examples/deconvolution/output/h2_window/deconvolution_result.png (opens in a new tab)examples/deconvolution/output/h2_window/deconvolution_result_fit.png (opens in a new tab)examples/deconvolution/output/h2_window/deconvolve_result.json (opens in a new tab)examples/deconvolution/output/h2_window/input_configs.yaml (opens in a new tab)examples/deconvolution/output/legacy_min/deconvolution_result_fit.png (opens in a new tab)examples/deconvolution/output/legacy_min/deconvolve_result.json (opens in a new tab)examples/deconvolution/output/legacy_min/input_configs.yaml (opens in a new tab)examples/deconvolution/output/overlay/input_configs.yaml (opens in a new tab)examples/deconvolution/output/overlay/spectra_overview.png (opens in a new tab)examples/kinetics/README.md (opens in a new tab)examples/kinetics/output/legacy_min/input_configs.yaml (opens in a new tab)examples/kinetics/output/legacy_min/kinetics.csv (opens in a new tab)examples/kinetics/output/legacy_min/kinetics_plot.png (opens in a new tab)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./chem-db-qmofQuery the Quantum MOF (QMOF) database via Materials Project's MPContribs platform for DFT-computed properties (bandgap) and optimized crystal structures of Metal-Organic Frameworks./chem-db-spectraSearch and download experimental InfraRed (IR), Mass spectra, and UV-Vis spectra data (JCAMP-DX format) for molecules./chem-dft-orca-advanced-calculationWrite and run custom ORCA input files for advanced electronic structure methods or settings not available through the SCINE wrapper, including multi-reference methods, excited states, relativistic effects, advanced SCF, NMR/EPR, and more.Other plugins' skills for the same job