Skip to content

About

RDKit + ChEMBL toolkit for compound libraries: standardization, drug-likeness, chemical space, similarity search, target profiles and enrichment

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

chemoinformatics-toolkit

Given a list of compounds — a screening library or a set of hits — what are they, what do they hit, and what else looks like them?

chemtoolkit is a small Python package built on RDKit that covers the everyday cheminformatics of compound screening: cleaning structures, comparing libraries, drug-likeness, fingerprints and similarity search, scaffolds and chemical space, structural alerts and reactive groups, and — for any compound — its ChEMBL protein-target profile.

flowchart LR
    A["SMILES / SDF / CSV"] --> B["1 · standardize<br/>parent, InChIKey, de-duplicate"]
    B --> C["2 · properties & alerts<br/>Ro5, QED, PAINS, warheads"]
    B --> D["3 · chemical space<br/>fingerprints, scaffolds, clusters, t-SNE"]
    B --> E["4 · ChEMBL lookup<br/>InChIKey → name"]
    E --> F["target profiles<br/>median pChEMBL per protein"]
    F --> G["5 · check vs curated targets"]
    D --> H["6 · similarity search<br/>analogues, compounds for genes"]
    F --> I["7 · target enrichment<br/>among hits"]
Loading

What the package covers

Module Use cases
standardize Parse SMILES/SDF; clean-up, keep largest fragment (salt stripping), neutralize, canonical tautomer; InChIKey and stereo-agnostic key; write SDF
library De-duplicate by structure; compare two libraries (exact and ignoring stereochemistry)
properties MW, cLogP, TPSA, HBD/HBA, rotatable bonds, Fsp3, QED; rule of five and Veber flags; all ~200 RDKit descriptors as ML features
fingerprints Morgan/ECFP, feature-Morgan/FCFP, RDKit path, atom-pair, torsion, MACCS; bits or counts; NumPy export
similarity Tanimoto/Dice matrices, k-nearest-neighbour search, cross-library mapping (exact → stereo-agnostic → nearest analogue)
substructure SMARTS search; PAINS/Brenk/NIH alerts; 16 electrophilic warheads (acrylamides, chloroacetamides, vinyl sulfones, epoxides, boronic acids, …)
scaffolds Bemis–Murcko and generic scaffolds, scaffold frequencies, maximum common substructure
space Taylor–Butina clustering, t-SNE maps on Tanimoto (Jaccard) distance
chembl Find compounds in ChEMBL by InChIKey or name (local SQLite or web API, same output); merge salt forms to the parent; per-target potency profiles; targets engaged at a tested concentration; potent compounds for a gene list
enrichment Hypergeometric target enrichment among hits; recall of curated annotations
plots Property panels, chemical-space maps, target-profile heatmaps, hit-rate plots, structure grids with highlighted cores

Demo: the Drug Repurposing Hub

The demo runs the full pipeline on the Broad Drug Repurposing Hub (Corsello et al., 2017), ~6,800 compounds with curated mechanisms of action and targets, which gives a built-in check for the ChEMBL target profiles.

1 · A clean library

13,553 Hub samples (vendors, batches, salt forms) collapse to 6,732 unique parent structures after salt stripping, neutralization and tautomer canonicalization (32 unparsable SMILES reported, not silently dropped). Ignoring stereochemistry leaves 6,636 distinct skeletons, so ~100 compounds are stereoisomers of one another.

2 · Drug-likeness and liabilities

Rule-of-five compliance runs from 84% to 98% depending on clinical phase. 35–59% of compounds trigger at least one PAINS/Brenk alert, a reminder that these filters flag many approved drugs and should be read as prompts for a closer look, not as verdicts. 772 compounds carry an electrophilic warhead (acrylamide, boronic acid, epoxide, …).

properties

3 · Chemical space

4,307 Murcko scaffolds and 5,263 Taylor–Butina clusters at Tanimoto ≥ 0.6 (4,481 singletons): a repurposing library is structurally very diverse. Mechanism classes still form islands on the t-SNE map, e.g. β-lactam antibiotics.

chemical space top scaffolds

4 · ChEMBL target profiles

6,632 of 6,732 compounds (98.5%) were found in ChEMBL 37: 5,877 by exact InChIKey, 671 ignoring stereochemistry, 84 by name. Their 276,388 curated measurements (salt forms merged into the parent; flagged and duplicate values removed) summarize to 52,485 compound–target pairs over 3,078 human proteins.

target profiles

5 · Do the profiles agree with curated targets?

For 3,644 compounds with both curated Hub targets and ChEMBL data, half of each compound's curated targets are measured at ≤ 1 µM (pChEMBL ≥ 6), and at least one is recovered for 61%. Agreement is lower for launched drugs, likely because curation lists every subtype and weaker secondary target, than for recent clinical compounds whose primary target is the one everybody measures.

target recall

6 · Similarity search

Nearest neighbours of imatinib: masitinib (0.75), flumatinib, bafetinib, nilotinib, all Abl/KIT/PDGFR inhibitors, plus the HDAC inhibitor mocetinostat, which shares the pyridinyl-pyrimidine and benzamide but not the target. Each analogue is drawn with the substructure it shares with the query. Gene queries return the potent compounds ChEMBL knows for a target (BRD4: 3,270 at pChEMBL ≥ 7, 18 in the library; MTOR: 2,984, 34 in the library).

analogues of imatinib

7 · Target enrichment among hits

Treating the 98 warhead-bearing compounds as "hits", the enrichment test recovers the covalent target space without being told any chemistry: EGFR, ERBB2, BTK and its TEC-family relatives BMX and TEC, JAK3 (cysteine-reactive acrylamides) and the proteasome subunits PSMB5/8/9/10 (boronic acids, epoxyketones). Adjusted p down to 3 × 10⁻¹².

target enrichment

Quick start

git clone https://github.com/Lily-Li-chembio/chemoinformatics-toolkit.git
cd chemoinformatics-toolkit
conda env create -f environment.yml && conda activate chemtoolkit    # or: pip install -e ".[dev]"
pip install -e .
pytest -q
cd pipeline
python 0_download_data.py                          # Drug Repurposing Hub tables
python 1_prepare_library.py                        # standardize + de-duplicate
python 2_properties_and_alerts.py
python 3_chemical_space.py
python 4_chembl_target_profiles.py --chembl path/to/chembl_37.db   # omit --chembl to use the web API
python 5_validate_targets.py
python 6_similarity_search.py --query imatinib --genes MTOR BRD4 --chembl path/to/chembl_37.db
python 7_target_enrichment.py

Your own library: python 1_prepare_library.py --input my_compounds.csv --smiles-col SMILES --name-col Name, then the same steps.

As a library

from chemtoolkit.standardize import standardize_table, mol_from_smiles
from chemtoolkit.fingerprints import fingerprints
from chemtoolkit.similarity import nearest_neighbors
from chemtoolkit.chembl import ChEMBLSQLite, target_profile, active_at_concentration

lib = standardize_table(df, smiles_col="SMILES")                   # parent SMILES + InChIKey
fps = fingerprints([mol_from_smiles(s) for s in lib["std_smiles"]])
nn  = nearest_neighbors(fps[:1], fps, k=5, exclude_self=True)      # analogues of compound 0

db   = ChEMBLSQLite("chembl_37.db")
hits = db.lookup(lib["inchikey"])                                  # which are in ChEMBL?
prof = target_profile(db.activities(hits["parent_chembl_id"]))     # compound x target potency
on_target = active_at_concentration(prof, 10)                      # engaged at 10 µM

Repository layout

src/chemtoolkit/   standardize · library · properties · fingerprints · similarity
                   substructure · scaffolds · space · chembl · enrichment · plots
pipeline/          numbered demo scripts 0–7
tests/             unit tests (a miniature ChEMBL database; RDKit chemistry checks)
docs/figures/      demo figures
data/              inputs you download (not committed)

References

  • Corsello S.M. et al. The Drug Repurposing Hub: a next-generation drug library and information resource. Nat. Med. (2017). https://doi.org/10.1038/nm.4306
  • Zdrazil B. et al. The ChEMBL Database in 2023. Nucleic Acids Res. (2024). https://doi.org/10.1093/nar/gkad1004
  • Landrum G. et al. RDKit: open-source cheminformatics. https://www.rdkit.org
  • Baell J.B. & Holloway G.A. New substructure filters for removal of pan assay interference compounds (PAINS). J. Med. Chem. (2010).

Li Li · Google Scholar · LinkedIn

About

RDKit + ChEMBL toolkit for compound libraries: standardization, drug-likeness, chemical space, similarity search, target profiles and enrichment

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages