Module 12: In Silico ADMET & Safety Assessment
Predict whether a molecule can become a drug and whether it will be safe. Start with the physicochemical rules of ADME and oral drug-likeness (Lipinski, Veber), then predict toxicity endpoints (cardiotoxicity, hepatotoxicity, mutagenicity) with machine learning, comparing models with DeLong's test and interpreting alerts using SHAP values.
1. Critical Safety Endpoints in Drug Discovery
Up to 30% of drug candidates fail in clinical trials due to safety and toxicity issues. Discovery toxicology leverages in silico models to predict hazard profiles early, filtering out toxic compounds before they reach animal or human testing. Three primary endpoints dominate chemical safety screening:
Cardiotoxicity (hERG)
Blockade of the potassium voltage-gated channel hERG delays cardiac repolarization, causing QT interval prolongation and potentially fatal arrhythmias. Models predict structural binding affinity to hERG using regression or classification.
Hepatotoxicity (DILI)
Drug-Induced Liver Injury (DILI) is a leading cause of drug withdrawals. Hepatotoxicity arises from metabolic activation (e.g. generating reactive quinone-imines), mitochondrial dysfunction, or bile duct obstruction, modeled using binary classifiers.
Mutagenicity (Ames Test)
Mutagenic compounds react with DNA, causing genetic lesions that lead to carcinogenicity. In silico models identify structural electrophilic alerts (e.g. aromatic nitro groups, alkyl halides) that correlate with a positive bacterial Ames test.
2. ADME & Drug-Likeness: The Physicochemical Gatekeepers
Before toxicity, a candidate must actually reach its target and survive the body. ADME — Absorption, Distribution, Metabolism, Excretion — is governed largely by a few physicochemical properties. Simple rule-based filters flag molecules unlikely to be orally bioavailable long before expensive assays.
Lipophilicity (LogP / LogD)
The octanol/water partition coefficient. LogDaccounts for ionization at a given pH. Too low → poor membrane permeation; too high (>5) → poor solubility, promiscuity, and hERG/off-target risk.
Polar Surface Area (TPSA)
The surface area over polar (N, O) atoms and their attached hydrogens. Predicts passive absorption: <140 Ų for gut absorption, <90 Ų to cross the blood-brain barrier.
Metabolism & Clearance
Hepatic CYP450 enzymes (3A4, 2D6, 2C9) run phase-I oxidation; phase-II conjugation follows. Renal clearance favors small, polar compounds. These set the dose and half-life.
Interactive Playground: Drug-Likeness Scorecard
Load a known drug or drag the sliders to profile a virtual molecule. Watch each Lipinski and Veber criterion flip pass/fail. Note that approved drugs (e.g. Atorvastatin) sometimes break a rule — the guidelines are alerts, not hard cutoffs.
0 violations — within the ≤ 1 tolerance.
TPSA < 90 Ų — good oral absorption; may also cross the blood-brain barrier.
3. Explainable AI: Demystifying Toxicophores with SHAP
Historically, machine learning models in toxicology were viewed as black boxes. Modern regulatory bodies require model predictions to be interpretable. SHAP (SHapley Additive exPlanations), derived from cooperative game theory, provides a solution by assigning each molecular descriptor a value that quantifies its contribution to the final prediction.
In cooperative game theory, Shapley values distribute a total payoff fairly among players based on their marginal contributions. In machine learning, the "payoff" is the model prediction, and the "players" are the individual molecular features. The Shapley value for a feature i is defined as:
Where F is the set of all features, S is a subset of features excluding feature i, and f(S)is the prediction function. This checks every possible permutation of features to isolate the independent effect of a single chemical bit. In chemoinformatics, SHAP analysis maps these values back onto a molecule's 2D structure, highlighting exactly which chemical bits increase the probability of toxicity (toxicophores) and which structural fragments lower the risk.
4. Step-by-Step Toxicology Modeling & SHAP Interpretation
Below is a highly documented Python implementation using RDKit, Scikit-learn, and SHAP to train a toxicity classifier, compute model applicability domains, and extract chemical explanations:
Code Architecture Explained:
- Lines 1–18 (Data Setup & Fingerprints): RDKit parses SMILES strings into connection tables. It calculates circular Morgan Fingerprints (radius=2, equivalent to ECFP4) to represent the structure as a binary array of active substructural bits.
- Lines 20–23 (Random Forest Training): Scikit-learn fits an ensemble classifier containing 100 decision trees. The model learns to establish non-linear relationships between molecular fragments and toxicity.
- Lines 25–29 (Model Explainer): The tree-based explainer analyzes decision trees to compute Shapley values.
- Lines 31–38 (SHAP Value Calculation): Shapley values are calculated. A positive SHAP value indicates a fragment that increases toxicity risk, whereas a negative value indicates a protective or stabilizing fragment.
Interactive Playground: Discovery Toxicology Sandbox
Analyze chemical toxicophores, inspect interactive SHAP feature contributions, and use DeLong's test to ask whether paired ROC-AUC estimates are distinguishable.
1. Interactive SHAP Structural Profiler
Select a compound to analyze the positive (toxic) and negative (safe) Shapley contributions.
CC(C)(C)C1=CC=C(C=C1)C(O)CCCN2CCC(CC2)C(O)(C3=CC=CC=C3)C4=CC=CC=C4Fits the hERG channel electrostatic cavity, triggering severe block risk.
Promotes non-specific membrane accumulation and off-target bindings.
Forms stable hydrophobic interactions with aromatic residues inside the hERG vestibule.
Reduces mutagenicity/DNA-alkylating potential close to zero.
The red bars push the model towards a positive toxic classification. The blue bars pull the probability back down. An active basic tertiary nitrogen (Terfenadine) or a reactive quinone-imine metabolite (Acetaminophen) are massive positive forces pushing the compound into the high-risk region.
2. Paired DeLong ROC Explorer
Compare two models on the same synthetic holdout set. Model A uses a chemical signal; Model B receives an adjustable orthogonal signal representing a possible contribution from Cell Painting. AUCs, covariance, confidence intervals, and the paired DeLong test are calculated from the sample-level scores.
Difference detected in this paired sample
The two-sided paired DeLong p-value is 0.0353. This supports a difference between these two synthetic score vectors; it does not establish that Cell Painting will improve an external dataset.
Simulation boundary: the records and prediction scores are deterministic teaching data, not an experimental Cell Painting benchmark. The statistics are calculated from those paired scores using DeLong placement values and covariance; real claims require a locked external test set and endpoint-specific validation.