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.8.tar.gz (34.0 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.8-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.8-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.8-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.8-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.8-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.8-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.8-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.8-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.8-cp39-cp39-manylinux_2_24_x86_64.whl (34.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.24+ x86-64

csp5-0.2.8-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.8-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.8.tar.gz.

File metadata

  • Download URL: csp5-0.2.8.tar.gz
  • Upload date:
  • Size: 34.0 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.8.tar.gz
Algorithm Hash digest
SHA256 aa7a0ab8ae919d62d52da5c48267ccecb0aa2fa1df280079af4fbb5998d49595
MD5 02be3c99cdf0194ad8ec012139f20b31
BLAKE2b-256 1dd27eb83bcb201abcfdb06711273db5a21adff0c41d9833275d7442b7ef8cf5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp5-0.2.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ece61d43522a8ef8604f07b5d73ab83e5d59b38c59e5f9c21f266847388c7b73
MD5 8e80a56ad8f043a10736087e5f86a04a
BLAKE2b-256 e65951eb13fd9ccdbe2b118745f20867607c0060247a7762f8abd5c2b9aee63d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp5-0.2.8-cp313-cp313-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 21bf26401f7a1dc61b1b550e7262b8b205e2c994f82311f2ab92cd5c64081b59
MD5 cb07c101ae234e1833a1ac3fcd381695
BLAKE2b-256 64e6dcebf2a1bc8dc6718cb455397cc9e67e6fba7a1abfca33b3c59925e8b451

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp5-0.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e642b10e5c674eb9148405b489de9d589569028e71c490a1c643f80ee3ef2b78
MD5 1b19b8af0cc3d7317ad3fe16395d7257
BLAKE2b-256 6391fec6293772272c65a1c4e65dfde87ebf4eef19c9a51aa42c4a7e2c1108cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp5-0.2.8-cp312-cp312-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 003698c1eb7395493627370e633e714bec1145d14afb80945d44118801f7cba9
MD5 64630f077f5645d80dea7492f8d0f2f4
BLAKE2b-256 a5fad3b00d08366522ead35c96e274a9c298431115ad8904cbfd0d0911301b6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp5-0.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4ec025d1f1752df01cab131d170b3d23f5fddd40e11aae0684d1030a193c1be2
MD5 31063f508046ab6ea8d61b82148a89f4
BLAKE2b-256 07872ede7f7dc73037a44fba7165ec2a8b0d605c369299b3966a3d065edd9e76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp5-0.2.8-cp311-cp311-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 e1ad09f49de65a1375a6c315ceba19656100a67305def20f521fbdf27ff3b343
MD5 469c44bdb6b667e2b74f91bd475b53ef
BLAKE2b-256 38591e9e9f87f2d7307212728a8a8d1cbb605a6b34786434ca2d69f285af9afb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp5-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 48f0ed376bf2fc9fd6e6385b39ce4af9a0f49a68b2048fcbcb79732d037cc7e7
MD5 0d5cce9ff2e1941abc2041a9d778ce3e
BLAKE2b-256 44f320c6840573e59e61e6ba6e97fba145f92c2636ae3c2ae8b67723ab34598a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp5-0.2.8-cp310-cp310-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 4d6825025557d659c75a26311dbbee4e312846eaee6e83f1a37020fe92850e29
MD5 22296b6889a29caebda63abd5844badb
BLAKE2b-256 77de7c741c90dc97277601731fc8398b1f99024ddf622aaabe8638d4fd89956c

See more details on using hashes here.

File details

Details for the file csp5-0.2.8-cp39-cp39-manylinux_2_24_x86_64.whl.

File metadata

  • Download URL: csp5-0.2.8-cp39-cp39-manylinux_2_24_x86_64.whl
  • Upload date:
  • Size: 34.0 MB
  • Tags: CPython 3.9, manylinux: glibc 2.24+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for csp5-0.2.8-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 142980b007e98f7722161aa6078d25034eeae091ecc60c401d5f0d323ddc7d35
MD5 7e654d3ec7b2dec5baf4cc700a962247
BLAKE2b-256 a38cd065a34dc9b3917227964c59d7f18c1078f046c73efc9dfd28fefea60dbf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for csp5-0.2.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 859a264b1fe27ed15d334973d1b5430d4993455f670b034f38601eb418e3beb4
MD5 b6d1c1c64361521d14f10a7061183bf4
BLAKE2b-256 a570ecbbef45a3edc4c9961dd4f9a3a1ad6dece4a5280804ea81afed53ac3e74

See more details on using hashes here.

File details

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

File metadata

  • Download URL: csp5-0.2.8-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.12.4

File hashes

Hashes for csp5-0.2.8-cp39-cp39-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 6d997c5647f104c292959ad40f22b5849aaed986eb1edbc73f97f47f28287f8b
MD5 18c57a638b0bf562fde191150200ddc7
BLAKE2b-256 77d039a2ec428ffb18f3f717c63675d28018d45fd37e6d642796ff5950101632

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