ChEMBL EGFR QSAR: Fix Overfitting via Scaffold‑Split RF + SHAP

Many teams spend weeks pulling bioactivity data from public sources only to hit walls of missing values, inconsistent units, and duplicate records. The first obstacle is retrieving a clean set of IC50 measurements with reliable pChEMBL scores. A practical fix is to query the ChEMBL API with explicit filters: target_chembl_id, standard_type=IC50, pchembl_value not null, standard_relation=’=’, and standard_units in (‘nM’, None). Limiting the page size and iterating through pagination guarantees you collect up to a predefined cap without over‑loading the server.

Once raw records are in hand, quality control removes entries lacking SMILES or pChEMBL values, discards non‑equality relations, and converts the pChEMBL to float. After this step you typically retain a usable subset; if the count is zero, switch to a different target known to hold inhibitor data (e.g., CHEMBL203 for EGFR) or let the script auto‑select the target with the most records.

Molecular curation comes next. Standardize each SMILES by selecting the largest fragment, uncharging, and discarding fragments with fewer than six heavy atoms. Grouping by the canonical smiles and taking the median pIC50 collapses replicates while preserving the most representative identifier.

Feature engineering then turns the curated molecules into a numeric matrix. Generate ECFP fingerprints (radius 2, 1024 bits) and augment them with physicochemical descriptors such as MolWt, LogP, TPSA, HBD, HBA, rotatable bonds, aromatic rings, fraction CSP3, heavy atom count, and ring count. Convert fingerprints to numpy arrays, handle any descriptor failures with zero imputation, and stack the binary and continuous parts into a float32 array ready for any machine‑learning model.

Following this pipeline transforms noisy public bioactivity data into a clean, modeling‑ready dataset in a few minutes, letting teams focus on hypothesis testing rather than data wrangling.

#AI #Product #DataScience #DrugDiscovery #Cheminformatics #MachineLearning