omgkit
What is it?
omgkit is a cheminformatics toolkit written in Rust, with Python bindings. It is built around a columnar molecule representation so that large batches stay cheap to traverse, split across threads, and hand off to numpy or Arrow without a copy.
- BSD-3-Clause license
- Core data structures and algorithms in Rust, no
unsafe - Python 3.9+ wrapper built with PyO3 and maturin — one abi3 wheel covers every supported version, and there are no system dependencies
- SMILES parsing and writing, including tetrahedral chirality, double-bond geometry, dative bonds and explicit hydrogens
- Canonical SMILES
- A sanitization pipeline: valence, implicit hydrogens, ring perception, kekulization, aromaticity, conjugation, hybridization
- SMARTS parsing, substructure matching (VF2++, optionally stereo-aware), and SMARTS writing for both molecules and reactions
- Reaction templates and product generation, with optional atom-atom mapping
- Reconstruction of the fragments a template discards (the water an esterification drops) into balanced byproduct molecules — or an explicit "cannot tell" when the record itself does not balance
- Columnar batches (
MolBatch) with zero-copy per-molecule views
Status: under development. The API still changes between commits. Every layer is checked against an external reference implementation record by record (see Documentation), but the surface is not yet stable enough for production use. Bug reports are welcome.
Installation
Python
Requires maturin:
$ maturin build --release -m crates/omgkit-py/Cargo.toml --out dist
$ pip install dist/omgkit-*.whl
Rust
[dependencies]
omgkit-core = "0.0.1" # data structures
omgkit-io = "0.0.1" # SMILES / SMARTS
omgkit-chem = "0.0.1" # sanitization
omgkit-match = "0.0.1" # matching, reactions
Take only the layers you need; each depends only on the ones below it.
Getting started
import omgkit
m = omgkit.parse_smiles("OC(=O)c1ccccc1N")
m.sanitize()
m.to_canonical_smiles()
q = omgkit.parse_smarts("[C](=[O])[OH]")
q.match(m) # molecule atom indices, in query atom order
rxn = omgkit.parse_reaction("[C:1][OH:2]>>[C:1][Cl:2]")
for outcome in rxn.run([m], atom_mapping=True):
outcome.products, outcome.reactants
The Rust equivalents live in omgkit_io::smiles, omgkit_chem::sanitize and
omgkit_match; see the crate documentation for runnable examples.
Documentation
docs/design.md— what each layer does, why it is built that way, and how each design choice was validatedharness/README.md— the differential-testing setup: how the oracles are generated and how a test is kept from passing vacuouslycargo doc --workspace --no-deps --open— API documentation
Contributing
Issues and pull requests are welcome. Five gates have to pass, and they are the same five that CI runs:
$ cargo fmt --all --check
$ cargo clippy --workspace --all-targets -- -D warnings
$ cargo test --release
$ cargo test --workspace
$ cargo doc --workspace --no-deps --document-private-items
cargo test is green on a fresh clone: the smoke oracles are committed. The
large-corpus tier is marked #[ignore] and needs oracles you generate yourself
— see harness/README.md.
License
Code released under the BSD-3-Clause license.
Test corpora and the element table are redistributed from other projects and
carry their own terms; each file is traced to its origin in
THIRD-PARTY-NOTICES.md.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omgkit-0.0.1.tar.gz.
File metadata
- Download URL: omgkit-0.0.1.tar.gz
- Upload date:
- Size: 931.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
749324f7d425afb5247de7d4ba503bf117427b2ac30b79b9dab2e1d0d93778bb
|
|
| MD5 |
720aea4a1180d062caa4999c885b09ff
|
|
| BLAKE2b-256 |
422bbee595584a8966868a776c0dd70b7f1c473bfa32b5ff1bcf895b16e962b9
|
File details
Details for the file omgkit-0.0.1-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: omgkit-0.0.1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 887.4 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21da764a53c9583a498a3760c631faa7c53339bb4e959e0cd3082df0fcbf597a
|
|
| MD5 |
b3e826300e97cba8d7521e67650b9b9a
|
|
| BLAKE2b-256 |
e57adae5d8120bda9a6f004bfd3c69abdd758c7278ae4653a23fdb69fbd93a67
|