Skip to main content

CSP5

CSP5 is a pip-installable NMR predictor package with:

  • batched 13C, 1H and 19F prediction
  • prediction from precomputed geometries
  • shift matching utilities with dp (default), scipy, and murty (k-best)

Bundled defaults:

  • 13C model: CSP5-13C (model_id: csp5-13c)
  • 1H model: CSP5-1H (model_id: csp5-1h)
  • 19F model: CSP5-19F (model_id: csp5-19f)

Bundled quantile models:

  • 13C quantile model: CSP5q-13C (model_id: csp5q-13c)
  • 1H quantile model: CSP5q-1H (model_id: csp5q-1h)
  • 19F quantile model: CSP5q-19F (model_id: csp5q-19f)

The NMR solvent can be given with --solvent / solvent= (e.g. cdcl3, dmso-d6, cd3od).

Install

Requires Python 3.9 or newer. The current release is supported on Linux. Installing from the source distribution requires working C and C++ compilers for the native matching backends.

pip install CSP5

Prediction CLI

In interactive terminals, csp5 prints status lines to stderr before and after prediction. If a run is slow, it prints an additional note that first invocation can take longer while dependencies and model weights initialize, plus periodic "still working" updates during long runs. Use --no-status to silence them.

From SMILES

csp5 --smiles "CCO" --nucleus 1H
csp5 --smiles "CCO" --nucleus 1H --solvent dmso-d6
csp5 --smiles "FC(F)(F)c1ccccc1" --nucleus 19F --solvent cdcl3
csp5 --smiles "CCO" --nucleus both
csp5 --smiles-file smiles.txt --nucleus 13C --batch-size 64
csp5 --smiles "CCO" --nucleus 13C --num-conformers 8
csp5 --smiles "CCO" --nucleus 13C --random-seed 1234
csp5 --smiles "CCO" --nucleus 13C --random-seed random
csp5 --smiles "CCO" --nucleus both --num-conformers 8 --output-conformers-json cco_conformers.json
csp5 --smiles "CCO" --nucleus 13C --num-conformers 8 --output-conformers-sdf cco_conformers.sdf
csp5 --smiles "CCO" --nucleus 13C --output-svg cco_13c.svg
csp5 --smiles "CCO" --nucleus 13C --output-svg cco_13c.svg --svg-bond-length 72 --svg-shift-font-scale 1.1
csp5 --smiles "CCO" --nucleus 13C --model-name CSP5q-13C --solvent cdcl3
csp5 --smiles "CCO" --nucleus 1H --model-name CSP5q-1H --solvent dmso-d6

From molecule files (molfile or SDF)

By default, molecule-file input uses the coordinates embedded in the file. Add --regenerate-geometry to keep the input atom order/numbering while generating fresh ETKDG + MMFF/UFF coordinates for prediction.

csp5 --molecule-file input.mol --nucleus 13C
csp5 --molecule-file input.sdf --nucleus 1H --regenerate-geometry
csp5 --molecule-file input.sdf --nucleus 1H --regenerate-geometry --random-seed 1234

From precomputed geometries (parquet structures dataset)

Input dataset requirements:

  • required columns: smiles, molblock
  • optional columns: conformer_rank, conformer_id, energy, energy_method

Predict only rank-0 conformers:

csp5 \
  --structures-path /path/to/structures.parquet \
  --conformer-rank 0 \
  --nucleus 1H \
  --batch-size 64

Predict using all conformers in the dataset:

csp5 \
  --structures-path /path/to/structures.parquet \
  --use-all-conformers \
  --nucleus 13C

Prediction Python API

from csp5 import draw_prediction, predict_molecule_file, predict_smiles, predict_structures, predict_sdf

# Standard SMILES mode
res = predict_smiles(["CCO", "c1ccccc1"], nucleus="1H", batch_size=32)
print(res.predictions.head())
svg = draw_prediction(res)

# Solvent and 19F
res_dmso = predict_smiles(["CC(=O)Nc1ccc(O)cc1"], nucleus="1H", solvent="dmso-d6")
print(res_dmso.solvent, res_dmso.solvent_key, res_dmso.warnings)
res_f = predict_smiles(["FC(F)(F)c1ccccc1"], nucleus="19F", solvent="cdcl3")

# Override the default structure-derived geometry seed
seeded = predict_smiles(["CCO"], nucleus="1H", random_seed=1234)
randomized = predict_smiles(["CCO"], nucleus="1H", random_seed="random")
print(randomized.random_seed)  # resolved integer seed, for reproducing this run

# Precomputed-geometry parquet mode
res2 = predict_structures(
    "/path/to/structures.parquet",
    nucleus="1H",
    conformer_rank=0,
    use_all_conformers=False,
)

# Precomputed-geometry SDF mode
res3 = predict_sdf("/path/to/embedded.sdf", nucleus="13C")

# Molfile/SDF mode with fresh generated geometry while preserving atom order
res4 = predict_molecule_file("/path/to/input.mol", nucleus="13C", regenerate_geometry=True)

# Quantile models for uncertainty quantification
res5 = predict_smiles(["CCO"], nucleus="13C", model_name="CSP5q-13C")
print(res5.predictions[["atom_index", "shift_ppm", "shift_q05_ppm", "shift_q50_ppm", "shift_q95_ppm"]])

Matching CLI

csp5-match expects one shift per line in each file.

Default fast path (dp)

csp5-match \
  --predicted-file predicted.txt \
  --experimental-file experimental.txt \
  --solver dp

SciPy Hungarian option

csp5-match \
  --predicted-file predicted.txt \
  --experimental-file experimental.txt \
  --solver scipy

Murty k-best option

csp5-match \
  --predicted-file predicted.txt \
  --experimental-file experimental.txt \
  --solver murty \
  --k-best-policy clip \
  --k-best 25 \
  --temperature 0.5 \
  --mae-delta-threshold 0.2

Matching Python API

from csp5 import match_shifts

pred = [7.35, 7.30, 1.25]
exp = [7.34, 7.31, 1.20]

# DP (default)
r1 = match_shifts(pred, exp, solver="dp")

# SciPy Hungarian
r2 = match_shifts(pred, exp, solver="scipy")

# Murty k-best
r3 = match_shifts(pred, exp, solver="murty", k_best=10, k_best_policy="clip")
print(r3.assignment_entropy, r3.num_competing_assignments)

Solver Notes

  • dp is the default and is intended for the standard 1D shift objective.
  • scipy uses Hungarian assignment on the full padded cost matrix.
  • murty is the k-best solver; use this when you need assignment ambiguity analysis.
  • For murty, k_best_policy="clip" (default) returns all feasible unique assignments when k_best is larger than what exists. Use k_best_policy="strict" to fail instead.
  • dp and scipy are top-1 only (k_best must be 1).

Output Notes

  • Prediction failures are returned explicitly (failures) with reason tags (for example no_carbon, no_proton, no_fluorine, geometry_close_contact_...).
  • Molecules with any non-finite prediction, or any prediction outside the plausible window (13C: -50 to 300 ppm, 1H: -5 to 20 ppm, 19F: -350 to 250 ppm), are removed from the results and reported as prediction_out_of_range. With multiple conformers, one implausible conformer removes the whole molecule.
  • Prediction output always includes nucleus, model_id, and model_name.
  • Quantile models are selected explicitly with model_name="CSP5q-13C", "CSP5q-1H" or "CSP5q-19F", and take solvent= like the default models. Their shift_ppm value is the median prediction (shift_q50_ppm) and the output also includes shift_q01_ppm through shift_q99_ppm, plus shift_std_ppm estimated from the calibrated q10-q90 interval. The quantiles are calibrated on held-out literature data. Coverage is not guaranteed for rare or out-of-distribution chemistry, so these intervals should not be interpreted as a general OOD safety bound.
  • For structures-mode predictions, conformer metadata columns are propagated when available.
  • CLI JSON is molecule-oriented, with top-level model metadata, per-molecule prediction lists, and atom-map numbers matching mapped_smiles_explicit_h.
  • Use --nucleus both to write 13C and 1H predictions in one JSON, grouped by nucleus under each molecule's predictions (19F is requested separately with --nucleus 19F).
  • In SMILES mode, --num-conformers N predicts generated conformers and returns Boltzmann-averaged shifts at 298.15 K (--boltzmann-temperature-k changes the temperature). The default remains one conformer.
  • Geometry generation is deterministic from molecular structure by default. Use --random-seed N (or random_seed=N in the Python API) to override that seed reproducibly for SMILES input or molecule-file geometry regeneration. Use --random-seed random (or random_seed="random") to draw a fresh seed from OS entropy on every run; the resolved integer is included in JSON output and available as PredictionResult.random_seed.
  • In structures mode, --use-all-conformers also returns Boltzmann-averaged shifts. Use --output-conformers-json to save individual conformer predictions separately.
  • Use --output-conformers-sdf to save the exact conformer geometry or geometries used for prediction.
  • Use --molecule-file path.mol or --molecule-file path.sdf for molfile/SDF input. Add --regenerate-geometry to discard embedded coordinates and create fresh geometry without changing the input atom order used for atom maps.
  • Use --output-svg path.svg or draw_prediction(result) to create an RDKit-native SVG drawing with atom labels (C4, H9) and shift notes. SVGs auto-size by default. Use both --svg-width and --svg-height to force a fixed canvas; tune with --svg-bond-length, --svg-atom-font-size, --svg-shift-font-scale, and --svg-padding.
  • When drawing quantile-model predictions, each shift note includes the median followed by shift_std_ppm, for example 18.35 +/- 1.24.

Metadata

Release files for csp5 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csp5 0.3.1
File Size Uploaded Provenance Actions
csp5-0.3.1.tar.gz 102.6 MB Without provenance Details for csp5-0.3.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for csp5 0.3.1
File Actions
csp5-0.3.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for csp5-0.3.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
csp5-0.3.1-cp313-cp313-macosx_11_0_universal2.whl CPython 3.13 CPython 3.13 macOS 11.0+ universal2 (ARM64, x86-64) Details for csp5-0.3.1-cp313-cp313-macosx_11_0_universal2.whl
csp5-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for csp5-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
csp5-0.3.1-cp312-cp312-macosx_11_0_universal2.whl CPython 3.12 CPython 3.12 macOS 11.0+ universal2 (ARM64, x86-64) Details for csp5-0.3.1-cp312-cp312-macosx_11_0_universal2.whl
csp5-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for csp5-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
csp5-0.3.1-cp311-cp311-macosx_11_0_universal2.whl CPython 3.11 CPython 3.11 macOS 11.0+ universal2 (ARM64, x86-64) Details for csp5-0.3.1-cp311-cp311-macosx_11_0_universal2.whl
csp5-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for csp5-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
csp5-0.3.1-cp310-cp310-macosx_11_0_universal2.whl CPython 3.10 CPython 3.10 macOS 11.0+ universal2 (ARM64, x86-64) Details for csp5-0.3.1-cp310-cp310-macosx_11_0_universal2.whl
csp5-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for csp5-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
csp5-0.3.1-cp39-cp39-macosx_11_0_universal2.whl CPython 3.9 CPython 3.9 macOS 11.0+ universal2 (ARM64, x86-64) Details for csp5-0.3.1-cp39-cp39-macosx_11_0_universal2.whl

Total release size: 1.1 GB

Release files / csp5-0.3.1.tar.gz

Download URL csp5-0.3.1.tar.gz
Size 102.6 MB
Tags Source
SHA-256 checksum
How to use checksums
d92c7a5be1a3940403e8c96ed77a1a7661399cae73ac84544ff4772625938ee0
BLAKE2b-256 checksum
How to use checksums
1f97052b99571d0029a639c4152468065be9facafbd5f8c15a29b4da4e5619e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / csp5-0.3.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.3.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 102.6 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1f3e6255ac6858056b1445adcdefdfdd0ae92aa1c2b11e954bef2762c0500749
BLAKE2b-256 checksum
How to use checksums
55af385eb6f9d5a822bbddb89b7ab5a9fdf68d42a32dad6fc955fb0ebf306fed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / csp5-0.3.1-cp313-cp313-macosx_11_0_universal2.whl

Download URL csp5-0.3.1-cp313-cp313-macosx_11_0_universal2.whl
Size 102.6 MB
Tags CPython 3.13 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
031126688d6ccdc33007bd2fa561ec4a6f5d00ea2a73b2dccd2d811bb68cf389
BLAKE2b-256 checksum
How to use checksums
c721fed5d191b137697d901f65de95696e96fe146208f6e84e01dac9fe25a1cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / csp5-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 102.6 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b406a71752230c70b4e943bdd639b0a88a16792890ce6ff412c80822c6fb9316
BLAKE2b-256 checksum
How to use checksums
d329a76c518e46fda8b883147a3c150aed87e0c78aafa9950fbedd787da2ba15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / csp5-0.3.1-cp312-cp312-macosx_11_0_universal2.whl

Download URL csp5-0.3.1-cp312-cp312-macosx_11_0_universal2.whl
Size 102.6 MB
Tags CPython 3.12 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
d1c060a1d38b0f3d2882e0a72e0d40b05eb207e0f21565461865f88032bd4362
BLAKE2b-256 checksum
How to use checksums
d961e104e593c17fda43533f59ff47ff4eeb5f59c243aac0a129534847028438
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / csp5-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 102.6 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
759947ea75c1f1e695409edf57a0044a3e9577f4bb16b0ca9bf90614f87cae49
BLAKE2b-256 checksum
How to use checksums
06555590c35c1f76139afd1e4aea9a6e53c06d3b4d0aec3aec097776ee7ff72f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / csp5-0.3.1-cp311-cp311-macosx_11_0_universal2.whl

Download URL csp5-0.3.1-cp311-cp311-macosx_11_0_universal2.whl
Size 102.6 MB
Tags CPython 3.11 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
2e760ff336449e74563051879cdc787c31c0a2c4d186c37a118ef302b4d5fb74
BLAKE2b-256 checksum
How to use checksums
7179084b4abd8243a6482b5abab5cdcc0c6bfa3748ca2f4bb651e804c7344af4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / csp5-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 102.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
ef67a0b0550176998aad80c4763c758d8d93f405ebda1f33d2ef5f12f91a44d7
BLAKE2b-256 checksum
How to use checksums
4c6d04d06a87168a3ffd8b4e6f3972dae84e0fc475b658b3f6070f82057b2296
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / csp5-0.3.1-cp310-cp310-macosx_11_0_universal2.whl

Download URL csp5-0.3.1-cp310-cp310-macosx_11_0_universal2.whl
Size 102.6 MB
Tags CPython 3.10 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
9d4ac6642ccf1249df4be0c1b9a2e9280c860919e4555d295dcc81a48d843e2d
BLAKE2b-256 checksum
How to use checksums
1b7013a1d8650b92528397a420619001885475615599e8ec753c8fd0d0dce94c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / csp5-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 102.6 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
efc14d0d17e60ec91155afcf6d3880005dd83dbc52f0a3a8967610cf39b0cf5e
BLAKE2b-256 checksum
How to use checksums
f1d42ba0e5e5ca4d0c927a0fd39d5a3c31384271b708a53c7cedb68d22fb371e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / csp5-0.3.1-cp39-cp39-macosx_11_0_universal2.whl

Download URL csp5-0.3.1-cp39-cp39-macosx_11_0_universal2.whl
Size 102.6 MB
Tags CPython 3.9 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
4b4c7be2d5b096e6b84d07188dc80323b614c6765ee498b94593852fac02d6c4
BLAKE2b-256 checksum
How to use checksums
3c66bcd591d191ba653f85cea6c857cd893a8cb6e46b331ade434eb58c99013e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.9.13

Security for csp5 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page