Skip to main content

RDKit utilities: placeholder substitution, matching, R-group decomposition, scaffold normalization

Project description

rdkit_buildutils

Utilities built on top of RDKit for constructing, normalizing and decomposing molecules with placeholder substitution.

The package supports workflows involving monomers, R-group decomposition, query matching, and scaffold normalization. All helpers are general-purpose and RDKit-only.

⚠️ Developed in a personal context for scientific support. Not affiliated with RDKit or any specific organization.


✨ Features

Core (rdkit_buildutils/core.py)

  • convert_r_to_atom_map(smiles_r): [R1][*:1].
  • build_molecule_final(base_smiles, **substituents): substitute placeholders (r1="CC", …).

R-group (rdkit_buildutils/rgroup_core.py)

  • to_core, normalize_rgroup_smiles, to_peptidic_scaffold.
  • anchored_smiles, build_code_map.
  • decompose_with_cores, decompose_for_monomer.

Scaffold normalization (rdkit_buildutils/scaffold_normalize.py)

  • canonical_ranks, r_to_atommap, relabel_dummies_canonically.
  • normalize_scaffold_chiral (D/L preserving).

New in 0.3

  • Logging: silence_rdkit, silence_rdkit_all
  • Standardization: standardize_for_matching
  • HELM: helm_to_query_mol
  • Query variants: make_scaffold_variants (strict/nostereo/kekule/dropR/peptidic*)
  • R-group extraction: extract_rgroup_smiles
  • Filters: is_aminoacid_like_scaffold, keep_targets_with_single_aa_core
  • Matching: prepare_targets, find_monomer_matches
  • RGD assign: assign_rgroups_for_matches, build_code_map_from_table
  • Datatypes: MonomerScaffold, MatchRecord, RAssignment

📦 Installation

# pip-only (uses rdkit-pypi)
pip install rdkit_buildutils
# or, if you install RDKit via conda-forge, install rdkit separately and then:
pip install rdkit_buildutils

Optional extras:

pip install rdkit_buildutils[pandas]   # pandas helpers
pip install rdkit_buildutils[db]       # adapters you may write externally

🔬 Examples

from rdkit_buildutils import convert_r_to_atom_map, build_molecule_final
from rdkit import Chem

scaffold = "[R1]NCC(=O)[R2]"
core = convert_r_to_atom_map(scaffold)  # -> [*:1]NCC(=O)[*:2]
mol = build_molecule_final(core, r1="C", r2="OC")
print(Chem.MolToSmiles(mol))

R-group assignment with matching (sketch):

from rdkit_buildutils import (
  helm_to_query_mol, MonomerScaffold, prepare_targets, find_monomer_matches,
  assign_rgroups_for_matches
)
# build MonomerScaffold list...
# prepare targets...
# matches = find_monomer_matches(...)
# assignments = assign_rgroups_for_matches(...)

✅ License

MIT © 2025 Fabio Nelli

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

rdkit_buildutils-0.3.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

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

rdkit_buildutils-0.3.1-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file rdkit_buildutils-0.3.1.tar.gz.

File metadata

  • Download URL: rdkit_buildutils-0.3.1.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for rdkit_buildutils-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b76270e8fda9ac6368ce0b339da8f1687e784c004ecf8cf4147bb184c2681844
MD5 0ad25c7297aa910f78c1e37a22451c19
BLAKE2b-256 e55388ced68bbbb5c8b17dbd48c59e72fd21d17eb93feac2f6681d696f439ba4

See more details on using hashes here.

File details

Details for the file rdkit_buildutils-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rdkit_buildutils-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b52c3f8034a7e043e408c68e268f340554a20f307a10966707031b721a714cd
MD5 1c7a898d9a814a1e5ece1d4464abc44b
BLAKE2b-256 68692af84e794bc871dddacb43b0e1be75c1009c97dc3781d9816167e7daf6e2

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