Skip to main content

CSP5: pip-installable NMR predictor for 13C and 1H.

Project description

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)

Install

Requires Python 3.9 or newer.

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-file smiles.txt --nucleus 13C --batch-size 64

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 predict_smiles, predict_structures, predict_sdf

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

# 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")

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.
  • For structures-mode predictions, conformer metadata columns are propagated when available.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

csp5-0.2.7.tar.gz (33.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

csp5-0.2.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

csp5-0.2.7-cp313-cp313-macosx_11_0_universal2.whl (34.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ universal2 (ARM64, x86-64)

csp5-0.2.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

csp5-0.2.7-cp312-cp312-macosx_11_0_universal2.whl (34.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ universal2 (ARM64, x86-64)

csp5-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

csp5-0.2.7-cp311-cp311-macosx_11_0_universal2.whl (34.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ universal2 (ARM64, x86-64)

csp5-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

csp5-0.2.7-cp310-cp310-macosx_11_0_universal2.whl (34.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ universal2 (ARM64, x86-64)

csp5-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

csp5-0.2.7-cp39-cp39-macosx_11_0_universal2.whl (34.0 MB view details)

Uploaded CPython 3.9macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file csp5-0.2.7.tar.gz.

File metadata

  • Download URL: csp5-0.2.7.tar.gz
  • Upload date:
  • Size: 33.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for csp5-0.2.7.tar.gz
Algorithm Hash digest
SHA256 f8948c631c60cad384d57958e360f437f1d758429929f1e657e012189b02a915
MD5 a9418ac92803780a1e8193d4b94a830a
BLAKE2b-256 501bf37841be8bd89c870881bfbd92ddc9842bc2ef93cc23e82acfd724635320

See more details on using hashes here.

File details

Details for the file csp5-0.2.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for csp5-0.2.7-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ee17236609186b5a8bb6ff4d6a382cb2bbc9098d0d9058b7e4f7cb654836dba
MD5 ee9851cbca7cfcb40f8f470fda3b7590
BLAKE2b-256 71d277049f5dfca4a721cdf0bb0bd333e41e97b6b1923155defd34d977e54993

See more details on using hashes here.

File details

Details for the file csp5-0.2.7-cp313-cp313-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for csp5-0.2.7-cp313-cp313-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 48dba5408f60b9c7b2cb2a05b17a6e03515c81202863dac3f683812710fa8c1b
MD5 5504b932f1a6882be30c331479d5af11
BLAKE2b-256 be8ca148f0cebed2c73592aa25714bfded6bda09d230cf8a501ceb51263f9bf6

See more details on using hashes here.

File details

Details for the file csp5-0.2.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for csp5-0.2.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5deed083ff2af2b2dd99466051cec3a1e41bc9782ad449349afc5583d4ce8a44
MD5 0db44beb94aa17996b3611d5f52eadd1
BLAKE2b-256 1e9b53642e92ecf8aa53c5d919e839676746a5a70bad762e0bce5a2e2085f8f9

See more details on using hashes here.

File details

Details for the file csp5-0.2.7-cp312-cp312-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for csp5-0.2.7-cp312-cp312-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 0fb1669d3b4ec6c843a66cfc02eca985a73df95c8064370f0f6b067fe4b18e63
MD5 ca19f6637fe16de047c286c98c2f0626
BLAKE2b-256 fe218809b7073b75969b07b1956641d60e69e2344ff4a50c1973fdd4277cb59a

See more details on using hashes here.

File details

Details for the file csp5-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for csp5-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b117643b3f909234d5555b5c9df4537616852b439303fa0d7574b55462fcd084
MD5 1e150259557373cbc55e22135fc4576b
BLAKE2b-256 3e413556121e97c0437c62bf2f08a99cefd9c2e144c9a335ebd55ea1ae341dc9

See more details on using hashes here.

File details

Details for the file csp5-0.2.7-cp311-cp311-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for csp5-0.2.7-cp311-cp311-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 120cad2a1131c5a1dfaecd48596c3082e233119718fa0b5d1cfa0064dd3bbe78
MD5 9ebed7e6147d7cbdbb78d1ff7285d7f5
BLAKE2b-256 7c3a18a0e091ef1ed5a407cb6cdbb453fc67fd43a7a4a086448fa24eb24b6e57

See more details on using hashes here.

File details

Details for the file csp5-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for csp5-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ed752512666b700ed30cb58302c6e6654f3da87cec80e7bb0a4eefc09da99ac5
MD5 953459a726396990f6940d6bfea90837
BLAKE2b-256 d30b07879bbc1e831fc72588d6141f912a6b79ce6d4febdfca31183db7184cc8

See more details on using hashes here.

File details

Details for the file csp5-0.2.7-cp310-cp310-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for csp5-0.2.7-cp310-cp310-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 f02ac0f8eeb3ffc0c025f174c8f7007943ee7efee615d7952f397f9ff0ced159
MD5 53ba3d6c7060733e47e0966cdc69eac1
BLAKE2b-256 f352a557b1ffabdb1667fe4e6d623d43122a4238cfd9add5d5c8699ed60efec6

See more details on using hashes here.

File details

Details for the file csp5-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for csp5-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be5ccc799c1fd519ccd31efc1cc46b1b13a62f2ba3ccc9dcd9e71fdc60ca13c5
MD5 49c9b49c50484db41dcad71f3d2fe6db
BLAKE2b-256 fc44a3933222d103089f50eb1a17c825e78c8b12da08938c92026ad6310b0bee

See more details on using hashes here.

File details

Details for the file csp5-0.2.7-cp39-cp39-macosx_11_0_universal2.whl.

File metadata

  • Download URL: csp5-0.2.7-cp39-cp39-macosx_11_0_universal2.whl
  • Upload date:
  • Size: 34.0 MB
  • Tags: CPython 3.9, macOS 11.0+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for csp5-0.2.7-cp39-cp39-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 d353843681f4efd9fe223238cd1c411cdc5582ccfb0cf5cad0fe1146d7686b2c
MD5 d1bfaf8bff41f95ab92e6f9c4a818308
BLAKE2b-256 82af5c413525996acfc0ed3df9f223483b7be874af2bbd22ce1d96fdb6f71813

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page