Prediction Module

The prediction module generates NMR spectra from molecular structures. Predictions are executed by nmr-cli inside the nmr-converter container using one of two supported engines.

Base path: /latest/predict

Engines

EngineSpectra typesTypical timeNotes
nmrshiftproton, carbon5–10 sFast, local shift prediction
nmrdb.orgproton, carbon, cosy, hsqc, hmbc30–60 sRemote API, supports 2D spectra

TIP

Use curl or Postman for nmrdb.org requests — browser-based Scalar tests may time out on long predictions.

Endpoints

POST /

Predict spectra from a MOL block string.

Request body (nmrshift example):

json
{
  "engine": "nmrshift",
  "structure": "\n  Mrv2311...\nM  END",
  "spectra": ["proton"],
  "options": {
    "solvent": "Chloroform-D1 (CDCl3)",
    "frequency": 400,
    "nbPoints": 1024,
    "lineWidth": 1,
    "peakShape": "lorentzian"
  }
}

Request body (nmrdb.org example):

json
{
  "engine": "nmrdb.org",
  "structure": "\n  Mrv2311...\nM  END",
  "spectra": ["proton", "carbon"],
  "options": {
    "name": "Benzene",
    "frequency": 400,
    "1d": {
      "proton": { "from": -1, "to": 12 },
      "carbon": { "from": -5, "to": 220 },
      "nbPoints": 131072,
      "lineWidth": 1
    },
    "autoExtendRange": true
  }
}

POST /file

Predict from an uploaded MOL file (multipart/form-data).

Form fieldDescription
fileMOL file with molecular structure
requestJSON string with engine, spectra, and options (same schema as POST /)

nmrshift options

OptionDefaultDescription
solventDMSONMR solvent (see API enum for full list)
frequency400Spectrometer frequency (MHz)
from / toSpectrum range in ppm
nbPoints1024Number of data points
lineWidth1Peak linewidth
peakShapelorentziangaussian or lorentzian
tolerance0.001Peak grouping tolerance

nmrdb.org options

OptionDefaultDescription
name""Compound name
frequency400Spectrometer frequency (MHz)
1d.proton-1 to 12 ppm1H range
1d.carbon-5 to 220 ppm13C range
1d.nbPoints1310721D data points
2d.nbPoints1024×10242D data points
autoExtendRangetrueExtend range if signals fall outside

Error codes

StatusMeaning
408Prediction timed out (nmrdb.org: 300 s, nmrshift: 120 s)
422Invalid structure or CLI error
500Docker or container unavailable

Example

bash
curl -X POST "https://dev.nmrkit.nmrxiv.org/latest/predict/" \
  -H "Content-Type: application/json" \
  -d '{
    "engine": "nmrshift",
    "structure": "\n  CDK     09012310592D\n\n  6  6  0  0  0  0  0  0  0  0999 V2000\n    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\nM  END",
    "spectra": ["proton"],
    "options": { "frequency": 400 }
  }'

See also