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.2

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.2
File Size Uploaded Provenance Actions
csp5-0.3.2.tar.gz 102.6 MB Without provenance Details for csp5-0.3.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for csp5 0.3.2
File Actions
csp5-0.3.2-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.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
csp5-0.3.2-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.2-cp313-cp313-macosx_11_0_universal2.whl
csp5-0.3.2-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.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
csp5-0.3.2-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.2-cp312-cp312-macosx_11_0_universal2.whl
csp5-0.3.2-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.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
csp5-0.3.2-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.2-cp311-cp311-macosx_11_0_universal2.whl
csp5-0.3.2-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.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
csp5-0.3.2-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.2-cp310-cp310-macosx_11_0_universal2.whl
csp5-0.3.2-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.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
csp5-0.3.2-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.2-cp39-cp39-macosx_11_0_universal2.whl

Total release size: 1.1 GB

Release files / csp5-0.3.2.tar.gz

Download URL csp5-0.3.2.tar.gz
Size 102.6 MB
Tags Source
SHA-256 checksum
How to use checksums
fbe7eefb2915a634b7b21da91d65ddd73a1ae75d0a14b388d8d366d5c9538dd5
BLAKE2b-256 checksum
How to use checksums
0e88fe5da10813ce8e74fa5b3a97d68e39fd5b1de6b6ba10f4f4474d507e4105
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.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.3.2-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
9c33ddca52fbbf2235807c16acdf86794ad25e6837cb60bca07932ff255665ed
BLAKE2b-256 checksum
How to use checksums
80b5a3875faf9e541632645a60cfb8d39d2fd5339e8b5c95c419565c5d91ba3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.18

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

Download URL csp5-0.3.2-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
5ae849150a937aa9b36a45e5872523e041e91f318d61fd073e488d2b4aaeb36d
BLAKE2b-256 checksum
How to use checksums
8316c03095fdf5591576917e31302acc5e20f35048eabbad3f6d5a3ef46e8b33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.17

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

Download URL csp5-0.3.2-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
cdb3130088a4515ee6c4bd20b7502bbcfa85781b62dfea28947df8d04bba97fa
BLAKE2b-256 checksum
How to use checksums
acb3f551b9cf7d4480febdedb7c531d2da5e218a7e9f347b8ee358d996d4c686
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.16

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

Download URL csp5-0.3.2-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
7bc7edca472442031c54697937042ae1b8e7cd4e67b485ef20cd35ac3a31928a
BLAKE2b-256 checksum
How to use checksums
6118e8efa37395b2c336c019b7130ea5772a6db684018b29e3c4cbe8c44ac1ce
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.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.3.2-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
1593bee7f7702dd106a4d73702de9e45ee2f9d6b27dd273e96c766efff0f676e
BLAKE2b-256 checksum
How to use checksums
52e6d99d0d03bb198d752d99c9e5a5635262a7af267e2e618eda768da61ed5aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

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

Download URL csp5-0.3.2-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
e919731e835e24f646e975491b14af43491670b1d410abb7a2c79013be370fff
BLAKE2b-256 checksum
How to use checksums
4d58ac381d3d76b08b4bc029d0fe0d69b21ece3250c1ca80ebb2293db1ec1f98
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.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.3.2-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
27919439c007dd59f102e4676dfa949a974e5721389ffa117a24898f3b0965ff
BLAKE2b-256 checksum
How to use checksums
cab2093221cc244fba8d6f14f3df4f9821d4167cac162cbef071853d3f9f9866
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.2-cp310-cp310-macosx_11_0_universal2.whl

Download URL csp5-0.3.2-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
47a0e7859b9b5b8b887ec45ff064f8e83d76e30b9b32370c2ab02f862349e7b3
BLAKE2b-256 checksum
How to use checksums
3b5d2bc3b489353c31d6b58db7e5d7896ab73d3b04b5e1abc3ec1af9df95abff
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.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csp5-0.3.2-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
67a35e08aa45cbc10d3e150454974fc0a765f658d23f14707be606d08e3897dd
BLAKE2b-256 checksum
How to use checksums
2046fd36b6c41c1538a50334ed1963bb4bd8b9f8ec5e25d0548aa56abeee49b3
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.2-cp39-cp39-macosx_11_0_universal2.whl

Download URL csp5-0.3.2-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
78d8dc29689600a8a79928812b72d3156bb032e0eaa80144962726e2e4407e5e
BLAKE2b-256 checksum
How to use checksums
20f9005f1a6342fe10075f0a2d496bc7f573d6b8a0e9e315b177a0d5aeac0a6a
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.2

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