Informatics Matters RDKit Utilities
A Python package of RDKit-specific helpers shared by Squonk2 Data Manager Jobs: molecule readers/writers over SDF and delimited-SMILES text formats, fragment selection, and a handful of small molecule-inspection helpers.
This consolidates the rdkit_utils.py module that had been copy-pasted, and had begun to diverge, across several Job repositories (squonk2-desc-rdkit, squonk2-desc-mordred, squonk2-jaqpot and virtual-screening) into a single, tested, authoritative source.
Installation (Python)
The package is published on PyPI and can be installed from there:
pip install im-rdkit-utilities
Once installed, import it as rdkit_utils (matching the module name it replaces, so existing call sites need no changes beyond the import path):
>>> import rdkit_utils
>>> reader = rdkit_utils.create_reader('molecules.smi', delimiter='\t')
Public surface
create_reader() / create_writer() — construct a reader/writer for a .sdf, .sdf.gz or delimited-SMILES file, based on its extension.
SdfReader / SdfWriter / SmilesReader / SmilesWriter — the underlying reader/writer implementations.
generate_headers() — build output headers for a tab/comma separated file, given the ID column configuration.
fragment() — pick the largest fragment of a (typically salted) molecule, by heavy-atom count or molecular weight.
fragmentAndFingerprint() — fragment a stream of molecules and fingerprint the result.
get_num_chiral_centers() / get_num_sp3_centres() — small molecule-inspection helpers.
check_molecules_are_3d() — check whether the molecules in a .sdf file have 3D conformers.
rdk_read_single_mol() / rdk_read_mols() / rdk_read_molecule_files() / rdk_merge_mols() / rdk_mol_supplier() / sdf_record_gen() — molecule-file reading helpers.
updateChargeFlagInAtomBlock() — adds the legacy charge-flag encoding to a full CTAB molblock (counts line included), for tools such as rDock that only understand the old syntax. This is not the same as dm_job_utilities.utils.update_charge_flag_in_atom_block(), which operates on just the atom-block portion of a molblock (one line further in) — the two take different input shapes and are not interchangeable. This RDKit-oriented variant lives here because it’s used directly alongside the readers/writers above; the job-utilities function remains the natural home for pure string manipulation with no RDKit dependency.
Get in touch
Report bugs, suggest features or view the source code on GitHub.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 im_rdkit_utilities-1.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: im_rdkit_utilities-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c98e2a34c9ce8fa97176ceeaa5628148b116dea7dcd752e2dc0290d62e4a568b
|
|
| MD5 |
fe660c4ec6fba677efa09e11b1708d20
|
|
| BLAKE2b-256 |
13e11ccab2b25f6424a150a891a9c05c44e2d6d9f14cd9cf7c2f3421526e232b
|
Provenance
The following attestation bundles were made for im_rdkit_utilities-1.0.0-py2.py3-none-any.whl:
Publisher:
publish.yaml on InformaticsMatters/squonk2-rdkit-utilities
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
im_rdkit_utilities-1.0.0-py2.py3-none-any.whl -
Subject digest:
c98e2a34c9ce8fa97176ceeaa5628148b116dea7dcd752e2dc0290d62e4a568b - Sigstore transparency entry: 2343802535
- Sigstore integration time:
-
Permalink:
InformaticsMatters/squonk2-rdkit-utilities@2b0dc79c216c7d15ac2ecb36dc1701cac095588f -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/InformaticsMatters
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@2b0dc79c216c7d15ac2ecb36dc1701cac095588f -
Trigger Event:
push
-
Statement type: