CSP5
CSP5 is a pip-installable NMR predictor package with:
- batched
13C,1Hand19Fprediction - prediction from precomputed geometries
- shift matching utilities with
dp(default),scipy, andmurty(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)
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
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)
# 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
dpis the default and is intended for the standard 1D shift objective.scipyuses Hungarian assignment on the full padded cost matrix.murtyis the k-best solver; use this when you need assignment ambiguity analysis.- For
murty,k_best_policy="clip"(default) returns all feasible unique assignments whenk_bestis larger than what exists. Usek_best_policy="strict"to fail instead. dpandscipyare top-1 only (k_bestmust be1).
Output Notes
- Prediction failures are returned explicitly (
failures) with reason tags (for exampleno_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, andmodel_name. - Quantile models are selected explicitly with
model_name="CSP5q-13C"ormodel_name="CSP5q-1H". Theirshift_ppmvalue is the median prediction (shift_q50_ppm) and the output also includesshift_q01_ppmthroughshift_q99_ppm, plusshift_std_ppmestimated 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 bothto write 13C and 1H predictions in one JSON, grouped by nucleus under each molecule'spredictions(19F is requested separately with--nucleus 19F). - In SMILES mode,
--num-conformers Npredicts generated conformers and returns Boltzmann-averaged shifts at 298.15 K (--boltzmann-temperature-kchanges the temperature). The default remains one conformer. - Geometry generation is deterministic from molecular structure by default. Use
--random-seed N(orrandom_seed=Nin the Python API) to override that seed reproducibly for SMILES input or molecule-file geometry regeneration. Use--random-seed random(orrandom_seed="random") to draw a fresh seed from OS entropy on every run; the resolved integer is included in JSON output and available asPredictionResult.random_seed. - In structures mode,
--use-all-conformersalso returns Boltzmann-averaged shifts. Use--output-conformers-jsonto save individual conformer predictions separately. - Use
--output-conformers-sdfto save the exact conformer geometry or geometries used for prediction. - Use
--molecule-file path.molor--molecule-file path.sdffor molfile/SDF input. Add--regenerate-geometryto discard embedded coordinates and create fresh geometry without changing the input atom order used for atom maps. - Use
--output-svg path.svgordraw_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-widthand--svg-heightto 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 example18.35 +/- 1.24.
Metadata
Release files for csp5 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| csp5-0.3.0.tar.gz | 85.2 MB | Details |
Built distributions (wheels)
Total release size: 937.7 MB
Release files / csp5-0.3.0.tar.gz
| Download URL | csp5-0.3.0.tar.gz |
|---|---|
| Size | 85.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b59dd40f15ad98623d2ad86dc35a8c3d83ec285c91aac137f0864ec7d02b599b
|
|
BLAKE2b-256 checksum How to use checksums |
9ee922282db70a7fbe7dd2a263162e6d52f56d41930b0e80cd77adc224460679
|
| 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.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | csp5-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 85.2 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
98a38c141201eec3d00a656a5efb4807550d050a6335633011f97d299d3ca645
|
|
BLAKE2b-256 checksum How to use checksums |
0bf82895ff9866c6d261ae9a54a65510217e9a6e3a807c1578bb6641cac27e88
|
| 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.0-cp313-cp313-macosx_11_0_universal2.whl
| Download URL | csp5-0.3.0-cp313-cp313-macosx_11_0_universal2.whl |
|---|---|
| Size | 85.2 MB |
| Tags | CPython 3.13 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
2855950daac3faf10fb92caff1f03645cccf2c78c53fa9d124ea28942c977fc5
|
|
BLAKE2b-256 checksum How to use checksums |
6b63aa777348f691da444c37bb5e6e605819a4210d3c5b29a1f9eb1d8fc85257
|
| 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.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | csp5-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 85.2 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
16e957480c577a59630dc124542d19092e3b6e2924a8db900aef72f6b5fa95e3
|
|
BLAKE2b-256 checksum How to use checksums |
3f641789a6c0eee08e4bda6743a34c142bae854a6cf12477d918876a93127982
|
| 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.0-cp312-cp312-macosx_11_0_universal2.whl
| Download URL | csp5-0.3.0-cp312-cp312-macosx_11_0_universal2.whl |
|---|---|
| Size | 85.2 MB |
| Tags | CPython 3.12 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
5f2c47546decdf157b8cf7f04d7195adbd22d598522b2298398d7e14e28fefe0
|
|
BLAKE2b-256 checksum How to use checksums |
953310982c230d423226f9db328a22772a4d20af391815d4e814bd28df79c7f5
|
| 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.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | csp5-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 85.2 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
2d9769abe4b12d3af188b0fb00a59fa8dc109f772fcbec9dbdcca93f71ac51fe
|
|
BLAKE2b-256 checksum How to use checksums |
1357f928c9bd0448d99d20622ab864ba40469e873f89b898e5583fb112ccd01e
|
| 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.0-cp311-cp311-macosx_11_0_universal2.whl
| Download URL | csp5-0.3.0-cp311-cp311-macosx_11_0_universal2.whl |
|---|---|
| Size | 85.2 MB |
| Tags | CPython 3.11 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
9ca5541aa974aebd408631b4a5a9f72b06e2694e621b2897d2f746ad47953f98
|
|
BLAKE2b-256 checksum How to use checksums |
bc73d47e631f89e86917236a2d6ec697cb01b63198b57b7be3d479f3f6ef0f07
|
| 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.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | csp5-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 85.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
fe6969bf4c99f321c07b860c2bdafb7e41a4abef14a75eacde1815c86af2d646
|
|
BLAKE2b-256 checksum How to use checksums |
17c0fd2ac2c148197931d16e0dcfc0c6a01021e24934b2d416101133cc04cd40
|
| 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.0-cp310-cp310-macosx_11_0_universal2.whl
| Download URL | csp5-0.3.0-cp310-cp310-macosx_11_0_universal2.whl |
|---|---|
| Size | 85.2 MB |
| Tags | CPython 3.10 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
981b6b3476a7e7529dde284afa487ce3a0b90c7169101a764f468c1df14e19d4
|
|
BLAKE2b-256 checksum How to use checksums |
412250be849e15d60485f5706d413c3f5e4a27ce275b2e984af2dd06a8ff4900
|
| 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.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | csp5-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 85.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
2895d13a6f68a9cdd573a90b27991f042f04f37b8df89d202cbd0df83e416d88
|
|
BLAKE2b-256 checksum How to use checksums |
df33963fb9833a854a6bb2222f5099f6a8c39d75532566a807ebc7eb873c43ad
|
| 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.0-cp39-cp39-macosx_11_0_universal2.whl
| Download URL | csp5-0.3.0-cp39-cp39-macosx_11_0_universal2.whl |
|---|---|
| Size | 85.2 MB |
| Tags | CPython 3.9 macOS 11.0+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
295ff329880d38d1854f98545beedcba6c60e638c6618d6c716fc3745599a594
|
|
BLAKE2b-256 checksum How to use checksums |
49cab1c78fdcc85f51f551f10950cf0afd3103c8bb8b27ec2c6051fbb59b0f7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.9.13
|