Predict 1H NMR spectra from SMILES strings via NMRdb.org SPINUS neural network prediction and nmrsim quantum mechanical spin simulation.
The agent should use this skill when:
chem-nmr-analysis skill).drug-db-pubchem skill, then call this skill.chem-nmr-analysis instead, which calls this skill internally.If the user provides compound names instead of SMILES, the agent should first resolve them:
# Env: base-agent
python .agents/skills/drug-db-pubchem/scripts/query_pubchem.py \
--name "camphor" --outdir <research_dir>/pubchem/
The agent should extract CanonicalSMILES from the JSON output.
If PubChem returns no results, the agent should try alternate names or ask the user to provide the SMILES directly.
# Env: nmr-agent
python .agents/skills/chem-nmr-predict/scripts/predict_nmr.py \
--smiles "<smiles_1>" "<smiles_2>" \
--names "compound1" "compound2" \
--field_mhz 400 \
--output_dir <research_dir>/nmr_predictions/
Arguments:
--smiles (required): one or more SMILES strings.--names: human-readable labels for filenames. If omitted, defaults to comp0, comp1, etc. The agent should always provide meaningful names.--field_mhz: spectrometer frequency in MHz (default: 400). The agent should match the field strength of the user's experimental spectrum if known.--linewidth: Lorentzian FWHM in Hz (default: 1.0). The agent should increase this (e.g., 2.0–5.0) if the user's experimental spectrum has broad lines.--n_points: spectrum resolution (default: 8192). The agent should not change this unless the user requests higher resolution.--output_dir: where to save results.Outputs per compound:
<name>.xy — two-column tab-separated file (ppm, intensity), descending ppm. Compatible with all NMR processing tools and the chem-nmr-analysis deconvolution scripts.<name>_signals.csv — signal table with columns: shift_ppm, multiplicity, J_Hz, nH.predictions.json — manifest listing all found/failed compounds and parameters.After prediction, the agent must:
predictions.json) for any failed compounds._signals.csv) and verify it is chemically reasonable:
chem-nmr-analysis's plot.py for visual comparison.If SPINUS returns no atoms for a SMILES → the SMILES may be invalid, the molecule may lack hydrogen atoms (e.g., CCl4), or the molecule may be too complex. The agent should:
If nmrsim simulation fails → the script falls back to a stick spectrum (chemical shifts only, no multiplet structure). The agent should note this in its response — the predicted spectrum will lack splitting patterns but chemical shifts will still be approximate.
--field_mhz 300. Second-order effects are more pronounced at lower field, and nmrsim handles these correctly.--field_mhz 600. Peaks will be better resolved.--linewidth 1.0.--linewidth 3.0 or higher.--linewidth 1.0 (digitized spectra typically have natural linewidths).| Failure | Symptom | Agent Action |
|---|---|---|
| Invalid SMILES | Script prints FAILED with "Invalid SMILES" | The agent should verify the SMILES with RDKit and correct it. |
| SPINUS returns no atoms | "SPINUS returned no atoms" error | Molecule may lack H atoms or be too complex. The agent should check and inform the user. |
| SPINUS network timeout | HTTP timeout error | The agent should retry once. If it fails again, NMRdb.org may be down. The agent should inform the user. |
| nmrsim QM simulation fails | WARNING in output, falls back to stick spectrum | Spin system too large (>11 spins) or numerical issue. The agent should note reduced accuracy. |
| Total nH in signals does not match molecular formula | Signal table has wrong proton count | Grouping heuristic may have failed. The agent should flag this to the user. |
mamba activate nmr-agent
Install: conda-envs/nmr-agent/install.sh
Required packages: numpy, rdkit, requests, nmrsim.