Skip to course content
Learn CADD

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.


Learning outcomes

  • Profile oral drug-likeness with Lipinski and Veber, treating both as alerts not gates.
  • Explain the mechanisms behind hERG, DILI, and Ames liabilities.
  • Build and validate a toxicity classifier for an imbalanced dataset.
  • Interpret SHAP attributions on a toxicophore and state their limits.
  • Say what a structure-derived safety prediction cannot tell you about exposure.

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.

Lipinski's Rule of Five (Pfizer, 1997): poor absorption is more likely when MW > 500, LogP > 5, H-bond donors > 5, or H-bond acceptors > 10. A drug-like molecule violates at most one. Veber's rules add rotatable bonds ≤ 10 and TPSA ≤ 140 Ų for oral bioavailability.

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.

Molecular Weight180 Da
LogP1.2
H-Bond Donors1
H-Bond Acceptors4
TPSA64 Ų
Rotatable Bonds3
Lipinski Ro5 Pass
MW ≤ 500180 Da
LogP ≤ 51.2
HBD ≤ 51
HBA ≤ 104

0 violationswithin the ≤ 1 tolerance.

Veber (oral bioavailability)
Rotatable bonds ≤ 103
TPSA ≤ 140 Ų64 Ų

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:

φ_i = Σ [ (|S|! × (|F| - |S| - 1)!) / |F|! ] × [ f(S ∪ {i}) - f(S) ]

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.
Python Toxicity Prediction & SHAP Explainability Script

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.

SMILESCC(C)(C)C1=CC=C(C=C1)C(O)CCCN2CCC(CC2)C(O)(C3=CC=CC=C3)C4=CC=CC=C4
MW471.7
LogP6.2
Basic N1
Predicted Safety Probabilities
hERG Cardiotox:94%
DILI Hepatotox:58%
Ames Mutagenicity:5%
SHAP Contribution Analysis (Toxicity Driving Forces)
Basic Tertiary Amine+0.45

Fits the hERG channel electrostatic cavity, triggering severe block risk.

High Lipophilicity (LogP > 5)+0.25

Promotes non-specific membrane accumulation and off-target bindings.

Hydrophobic Phenyl Rings+0.15

Forms stable hydrophobic interactions with aromatic residues inside the hERG vestibule.

No Electrophilic Alerts-0.10

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.

+0.08
n = 160
40 positives and 120 negatives, evaluated by both models on exactly the same records.
Model A AUC (2D Morgan):0.713
Model B AUC (Morgan+Bio):0.765
Difference in AUC:+0.053
Paired DeLong z / p:2.10 / 0.0353
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.

Model A 95% CI: [0.621, 0.805]Model B 95% CI: [0.674, 0.857]

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.

5. What These Predictions Cannot Tell You

ADMET models are the most over-trusted tools in computational chemistry, because they return a clean probability for a question — is this compound safe? — that no model can actually answer. Four limits are worth carrying forward.

A rule is an alert, not a verdict

Lipinski and Veber describe tendencies in oral drugs, not requirements. Plenty of approved drugs violate them, and entire modalities — PROTACs, macrocycles, peptides — sit far outside that space by design. Use the rules to raise questions, never to close them.

Toxicity models inherit their training sets

A hERG or DILI classifier learned from historical compounds knows historical chemistry. Present it a novel chemotype and it will answer confidently from outside its applicability domain (Module 9). Check the domain before believing the probability.

SHAP explains the model, not the biology

A Shapley value tells you which features drove this model's output. If the model learned a dataset artefact, SHAP will explain the artefact fluently and persuasively. Attribution is not mechanism.

Structure is not exposure

Everything in this module is computed from a structure. Whether a compound reaches a harmful concentration at a sensitive tissue depends on dose, clearance, protein binding, and route — which is where Module 15 picks up.

Used well, these models reorder your synthesis queue and catch liabilities while they are still cheap to fix. Used as a pass/fail gate, they discard good compounds and wave through bad ones with equal confidence.


Knowledge check

Self-Assessment ChallengeQuestion 1 of 3

Why is a basic tertiary nitrogen frequently flagged with a high positive SHAP value in predictive cardiotoxicity models?