Skip to main content

CSP5

CSP5 is a pip-installable NMR predictor package with:

  • batched 13C and 1H 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)

Bundled quantile models:

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

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 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
csp5 --smiles "CCO" --nucleus 1H --model-name CSP5q-1H

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)

# 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.
  • Prediction output always includes nucleus, model_id, and model_name.
  • Quantile models are selected explicitly with model_name="CSP5q-13C" or model_name="CSP5q-1H". 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 bundled scale is calibrated on held-out NMRexp-like 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.
  • 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.

Release files for csp5 0.2.19

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.2.19
File Size Uploaded
csp5-0.2.19.tar.gz 68.0 MB Details

Built distributions (wheels)

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

Total release size: 748.3 MB

Release files / csp5-0.2.19.tar.gz

Download URL csp5-0.2.19.tar.gz
Size 68.0 MB
Tags Source
SHA-256 checksum
How to use checksums
32f72b08b474b0e152f35cf73acd97d593c0da890132ad64baa3c12512accd1f
BLAKE2b-256 checksum
How to use checksums
ce9204edc800016087b9c6ed2819637cdce895ce37474b8606d0cdfafc114afb
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.2.19-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.2.19-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 68.0 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
271424cfbe217b3ff3b987ac895e1a4056c17b3d5f14c3ca1990f6742641f655
BLAKE2b-256 checksum
How to use checksums
ebc5176af49322326620ef156637758c77cbc2b3cae50291c49bad9068ca99fd
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.2.19-cp313-cp313-macosx_11_0_universal2.whl

Download URL csp5-0.2.19-cp313-cp313-macosx_11_0_universal2.whl
Size 68.0 MB
Tags CPython 3.13 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
094892a0f34080af81275de715bd63d69bd1a0cb3377e7e0de01c50951a870fa
BLAKE2b-256 checksum
How to use checksums
f8cb12b956327a4fa8e3550184634bd1afd82d43e387539112be52721ffdb043
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.2.19-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

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

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

Download URL csp5-0.2.19-cp312-cp312-macosx_11_0_universal2.whl
Size 68.0 MB
Tags CPython 3.12 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
c00c55235d31cf518f63a7c99bbaac8576fa4dcdfbbfb4b576316608f340c138
BLAKE2b-256 checksum
How to use checksums
72dd57d51df4438667d476bd27f99b36d47ee0ef72ec7790e9728d9b6681670e
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.2.19-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.2.19-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 68.0 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
96c9398d8fd105c777fd2fbc65157ce0fca395563e5c36a090413e93f4763824
BLAKE2b-256 checksum
How to use checksums
4252679a80e591d8710edfb6e1956ffb77ade9947e1482ccab338c67b1b5d1c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.16

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

Download URL csp5-0.2.19-cp311-cp311-macosx_11_0_universal2.whl
Size 68.0 MB
Tags CPython 3.11 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
5a08ce9dee0bce0ed8dd6f974704f30390ac8f200d4da3e58fa3f4f97e77835b
BLAKE2b-256 checksum
How to use checksums
9d2934c2fee7c436e7d83347435e839210e065b3dd6c83387551db60e042a85b
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.2.19-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.2.19-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 68.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
486a88934e259662528bb45936b34a624dfee2d3f34c1cae50da338c52b18cfe
BLAKE2b-256 checksum
How to use checksums
d5a3327312dd4e3a2913907e2d286784cde14e7209a5f6f34c002eaab48f1710
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.10.21

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

Download URL csp5-0.2.19-cp310-cp310-macosx_11_0_universal2.whl
Size 68.0 MB
Tags CPython 3.10 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
f88e327fbb563113383f69f878c0d6f8d296d9bf73b7f0323b57c3c2d57d7fe5
BLAKE2b-256 checksum
How to use checksums
d2adc2179901e27d3ed6396ef02de4d7b782c178f0cf3587d0b0d4919acd0675
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.2.19-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.2.19-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 68.0 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
36fb0defd306f25dc79a202bf2dfb3e71916a8feef0b306cd85a41e42a16f5fd
BLAKE2b-256 checksum
How to use checksums
0fdc983df9699a789589acbdfc068cd473bbf0e3b3b37b024672b7e05758df43
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.2.19-cp39-cp39-macosx_11_0_universal2.whl

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

Release history Release notifications | RSS feed

This release

0.2.19 This release

11 release files

0.2.9

11 release files

0.2.8

12 release files

0.2.7

11 release files

0.2.6

2 release files

0.2.5

2 release files

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