Linear Graphlet Models for Accurate and Interpretable Cheminformatics
Introduction and Context of Chemical Property Prediction
Evolution of Chemical Property Prediction:
- Predicting chemical properties from 2D molecular graphs is a long-established discipline in cheminformatics.
- Historically, traditional cheminformatics relied on structural fingerprinting methods that count occurrences of specific substructural patterns (e.g., Daylight-like fingerprints, Extended Connectivity Fingerprints / ECFP, Morgan fingerprints).
- In recent years, machine learning (ML) has shifted toward highly parameterized Deep Learning (DL) architectures, including Graph Neural Networks (GNNs) and message-passing neural networks, to maximize predictive accuracy.
Trade-offs of Deep Learning vs. Interpretable Models:
- While DL models achieve state-of-the-art performance across many tasks, they incur significant drawbacks:
- High computational training costs.
- Decreased model interpretability, creating "black-box" predictions that lack transparency.
- Model interpretability is crucial in scientific domains because:
- It builds trust by helping scientists understand when and why models fail.
- It uncovers underlying physical and chemical trends, driving scientific discovery.
- Intrinsically interpretable models (e.g., linear regression) feature transparent prediction mechanisms where each feature coefficient corresponds directly to a physical or chemical contribution.
Limitations of Post Hoc Interpretability Methods:
- Complex black-box models often rely on post hoc explanation techniques (e.g., local linear surrogates like LIME, SHapley Additive exPlanations / SHAP, integrated gradients, deep Taylor decomposition).
- Major theoretical and empirical flaws exist in post hoc methods:
- Lack of Local Lipschitz Continuity: Extremely small input perturbations can produce large changes in explanations, causing inconsistent output for human observers.
- Susceptibility to Manipulation: Deep Taylor decompositions can be engineered or manipulated to produce arbitrary explanations.
- Entanglement with Absent Features: Methods like SHAP assign non-zero attribution to features absent from a molecule, attempting to explain properties based on what a molecule is not rather than what it is.
- Feature Folding Ambiguities: When applied to folded fingerprints, a one-to-many mapping between fingerprint bit positions and molecular fragments prevents clean interpretation.
The Graphlet Approach:
- An atom-induced molecular subgraph representation—termed the graphlet representation—decomposes molecules into constituent -atom connected subgraphs.
- Inspired by the many-body expansion in physics and chemistry, linear models built on graphlet fingerprints achieve predictive accuracy competitive with nonlinear black-box methods while retaining intrinsic, additive interpretability.
Mathematical Formulation of Molecular Graphlets and Fingerprints
- Graphlet Definition:
- Graphlets are defined as isomorphism classes of connected subgraphs induced by selecting a subset of nodes and all edges connecting those nodes within a molecular graph.
- Unlike path-restricted (Daylight) or radius-restricted (Morgan/ECFP) fingerprints, graphlet fingerprints exhaustively count all connected induced subgraphs up to a maximum atom size .

Rich Typing Scheme:
- Nodes (atoms) are labeled by atomic species, formal charge, and aromaticity. This ensures every node type has a constant degree across all molecular graphs.
- Edges (bonds) are labeled as single, double, triple, or aromatic.
- Valence-Based Typing Advantage: Rich typing captures subtle chemical differences at smaller graphlet sizes. For example, a neutral nitrogen atom () with 3 bonds is distinguished from a positively charged nitrogen () with 4 bonds at graphlet size . Species-only typing cannot resolve this difference until graphlet size
Formal Mathematical Description:
- Let a molecular graph be , where is the set of atoms and is the set of bonds.
- An induced molecular subgraph formed by atom subset and all internal bonds is denoted .
- The family of all atom subsets that induce connected subgraphs is defined as:
- The subset restricted to graphlets of size at most atoms is:
- Let denote the set of graph isomorphism classes and represent the Iverson bracket indicator function. The graphlet fingerprint histogram vector has components:
Recursive Graphlet Hashing Algorithm:
- To efficiently categorize isomorphism classes , a recursive integer-labeling hashing function is defined using predefined base atom labels and bond labels :
- Here, constructs a label by sorting the histogram of constituent -size subgraphs and pairing them with their counts.
- Triplets () are hashed in terms of their atoms and bonds; quadruplets () are hashed via their constituent triplets, bonds, and atoms.
- This recursive structure allows memoization during subgraph enumeration, greatly speeding up fingerprint generation.
Hierarchical Regression Framework
Decomposition of Graphlet Feature Space:
- The graphlet histogram space for graphlets up to size decomposes as a direct sum of vector spaces:
- The components of vector correspond specifically to counts of graphlets containing exactly atoms.
Hierarchical Model Formulation:
- An order- hierarchical linear model predicts property as:
- Training proceeds sequentially from up to :
- Level (Atoms): Model is fit directly to target .
- Level (Substructures): Model is fit to the residual target from the previous order: where .
- Each constituent function minimizes loss .
- Physical Rationale: Fits lower-order terms (1-body atom terms) first, followed by 2-body bond terms, 3-body terms, etc., directly implementing a many-body expansion. Hierarchical fitting eliminates feature correlation caused by the inclusion of smaller graphlets inside larger ones.
Interpretation Projections and Model Explainability
- Substructure Directed Acyclic Graph (DAG):
- Inclusion relationships between graphlets in a molecule form an -partite Directed Acyclic Graph (DAG) denoted G_{S S'}(M) = \llbracket S \supset S' \rrbracket$.\n - Adjacent levels n+1nG_n:\n (G_n){S S'} = G{\llbracket |S|=n \rrbracket, \llbracket |S'|=n+1 \rrbracket}\n\n\n\n- **Downward Projections (Atom-Level Explanations):**\n - To preserve additivity (ensuring projected contributions sum exactly to predicted property \hat{y}\hat{G}n are constructed:\n \hat{g}{n}^{S'} = \frac{1}{\mathbf{1}^T g_n^{S'}} g_n^{S'}\n - Model coefficients \vec{\beta}nn\vec{a}_n:\n \vec{a}_n = \vec{\beta}_n + \hat{G}_n \vec{a}{n+1}\n with base case \vec{a}N = \vec{\beta}_N\n - Evaluating \vec{a}_1 yields atom-centered contributions in molecular context.\n\n- **Upward Projections (Bond-Level Explanations):**\n - To project coefficients onto bonds (n = 2K, where matrix elements represent shared electron pairs or bond orders:\n K{S' S} = \llbracket S' \subset S \rrbracket \sum_{b \in B} w_b \frac{\llbracket b \in M[S] \rrbracket}{\llbracket b \in M[S'] \rrbracket}\n - Column-normalizing K_n\hat{K}n\vec{u}_n:\n \vec{u}_n = \hat{K}_n (\vec{u}{n-1} + \vec{\beta}{n-1})\n with base case \vec{u}_1 = \mathbf{0}\n\n- **Combined Additive Explanations:**\n - The total local explanation vector at level n is:\n \vec{c}^n = \vec{a}_n + \vec{u}_n\n - **Exact Additivity Property:**\n \hat{y} = \mathbf{1}^T \vec{c}^n\n - For n = 1\vec{c}^1\hat{y}n = 2\vec{c}^2\hat{y} into individual bond terms.\n\n\n# Handling Unseen Fragments: Prediction Adjustment and Uncertainty Quantification\n\n- **Prediction Bias from Unseen Graphlets:**\n - When evaluating trained models on new out-of-distribution molecules, unobserved graphlet types lack fitted coefficients \beta. Omitting these terms introduces systematic prediction bias, especially for extensive properties like energy.\n\n- **Bias Adjustment Formulation:**\n - Let \bar{\beta}_ss = 1, \dots, N across the training set.\n - Let d_N^ss present in a test molecule.\n - The adjusted prediction \hat{y}{\text{adj}} corrects for missing terms:\n \hat{y}{\text{adj}} = \vec{\beta} \cdot c_N + \bar{\vec{\beta}} \cdot d_N\n\n- **Uncertainty Quantification (UQ) Metrics:**\n - Three metrics quantify prediction uncertainty based on unseen fragments:\n 1. **Unseen Graphlet Count (n{\text{unseen}}):** Total number of unseen fragments present in the test molecule.\n 2. **Unseen Graphlet Fraction (\text{Fraction}_{\text{unseen}}):** Ratio of unseen graphlets to total graphlets in the molecule.\n 3. **Calibrated UQ Regression Model:** A non-negative least squares (NNLS) model mapping unseen fragment counts per size s to absolute prediction residuals.\n\n\n# Empirical Benchmarking and Predictive Performance\n\n- **QM9 Benchmark Setup:**\n - Evaluated on \sim 130\,000\Delta H_{\text{at}}) calculated via Density Functional Theory (DFT) from the QM9 dataset.\n - Data split: 0.64 / 0.16 / 0.20 (train/validation/test).\n - Evaluated Ridge regression (L_2s = 19.\n\n\n\n- **QM9 Atomization Energy Performance Summary:**\n - **Best Model:** Hierarchical linear model built on graphlet fingerprints achieved a test Mean Absolute Error (MAE) of **1.74\,\text{kcal/mol}**.\n - **DFT Reference Benchmark:** The underlying DFT calculation error relative to experimental atomization energies is **2.3\,\text{kcal/mol}**. The graphlet linear model achieves error *lower* than the DFT calculations that generated the training labels.\n - **Comparison with Other Fingerprints:**\n - RDKit Fingerprints (hierarchical linear): Test MAE of 2.15\,\text{kcal/mol}.\n - Morgan Fingerprints: Substantially higher error due to less informative radial features.\n - Faber et al. Fingerprint Benchmark: Previous best fingerprint model achieved an MAE of **84.2\,\text{kcal/mol}** (using binary ECFP4 folded to 1024 bits). Unfolded graphlets outperform this by nearly two orders of magnitude.\n - **Hierarchical vs. Non-Hierarchical Performance:**\n - Non-hierarchical LightGBM models degrade rapidly as fragment count increases due to severe feature correlation among overlapping subgraphs.\n - Hierarchical training prevents degradation and stabilizes nonlinear tree models.\n\n\n# Interpretation Validation: Experimental and Theoretical Bond Energies\n\n- **Experimental Bond Dissociation Energies (BDEs):**\n - Projected bond explanation values \vec{c}^2 from a size-7 graphlet QM9 energy model were compared against experimental BDE values for ethane, ethene, and ethyne.\n\n\n\n - **Ethane (\text{C}2\text{H}_6):**\n - \text{C-H}101.1\,\text{kcal/mol}\vec{c}^2101.8\,\text{kcal/mol}\n - \text{C-C}90.1\,\text{kcal/mol}\vec{c}^266.5\,\text{kcal/mol}\n - **Ethene (\text{C}_2\text{H}_4):**\n - \text{C-H}110.7\,\text{kcal/mol}\vec{c}^2102.2\,\text{kcal/mol}\n - \text{C=C}174.1\,\text{kcal/mol}\vec{c}^2153.5\,\text{kcal/mol}\n - **Ethyne (\text{C}_2\text{H}_2):**\n - \text{C-H}133.32\,\text{kcal/mol}\vec{c}^2102.18\,\text{kcal/mol}\n - \text{C}\equiv\text{C}230.7\,\text{kcal/mol}\vec{c}^2199.9\,\text{kcal/mol}\n\n- **Theoretical BDE Large-Scale Validation:**\n - Evaluated on \sim 50\,0005\,000 QM9 molecules (from the dataset by John et al.).\n - A holdout evaluation (training on \sim 128\,0002\,500r = 0.4198\vec{c}^2 projections and DFT single-bond BDEs.\n\n\n\n - **Element-Pair Correlation Breakdown (Holdout Set):**\n - \text{C-C}n = 4\,699r = 0.4968p < 10^{-12})\n - \text{C-N}n = 1\,064r = 0.3043p < 10^{-12})\n - \text{C-O}n = 1\,440r = 0.2266p < 10^{-12})\n - \text{H-N}n = 990r = 0.2298p < 10^{-12})\n - \text{C-H}n = 15\,980r = 0.1414p < 10^{-12})\n - \text{H-O}n = 522r = -0.0584p > 0.05, not significant)\n\n\n# Solubility Modeling and Atom-Centered Interpretations\n\n- **Solubility Benchmarks:**\n - Evaluated experimental log solubilities (\log S\sim 400900 molecules.\n - Tested three water solubility tasks: "Water" (-4 < \log S < -1-122-4 < \log S < -1).\n\n\n\n- **Comparative Performance:**\n - Graphlet linear models achieve Test Root Mean Squared Errors (RMSE in \log S) competitive with or superior to complex models (MLR, PLS, ANN, SVM, GP, RF, ET, Bagging) that rely on expensive quantum chemical (DFT) and experimental descriptors.\n - Linear graphlet models showed unique robustness in the "wide-narrow" task: while external black-box models degraded when given extra training range data, graphlet linear models improved strictly with additional training data.\n\n- **Atom-Level Projections (\vec{c}^1) vs. Chemical Intuition:**\n - Atom projections \vec{c}^1 from aqueous solubility models match classical chemical solubility rules:\n\n\n\n - Polar functional groups (hydroxyl -\text{OH}-\text{NH}_2\vec{c}^1 contributions, increasing predicted aqueous solubility.\n - Halogen substituents (chloro -\text{Cl}\vec{c}^1 attributions, decreasing aqueous solubility.\n\n\n# ADMET Property Prediction on Benchmark Datasets\n\n- **Therapeutics Data Commons (TDC) Evaluation:**\n - Evaluated on 9 benchmark ADMET (Absorption, Distribution, Metabolism, Excretion, and Toxicity) regression tasks using scaffold-split cross-validation across 5 random splits.\n\n- **TDC Leaderboard Results Summary:**\n - Models incorporating graphlet fingerprints with LightGBM ranked in the **upper half** of the official TDC leaderboards for 7 out of 9 tasks:\n - **LD50 (Acute Toxicity):** MAE = 0.603 (Rank: 3 / 19)\n - **AqSol (Aqueous Solubility):** MAE = 0.803 (Rank: 5 / 16)\n - **Lipo (Lipophilicity):** MAE = 0.519 (Rank: 5 / 17)\n - **PPBR (Plasma Protein Binding Rate):** MAE = 8.729 (Rank: 6 / 17)\n - **Caco2 (Gut Permeability):** MAE = 0.316 (Rank: 7 / 19)\n - **VDss (Volume of Distribution at Steady State):** Spearman r = 0.500 (Rank: 8 / 17)\n - **Half Life:** Spearman r = 0.217 (Rank: 12 / 18)\n - **CL-Hepa (Hepatocyte Clearance):** Spearman r = 0.341 (Rank: 13 / 16)\n - **CL-Micro (Microsomal Clearance):** Spearman r = 0.525 (Rank: 14 / 18)\n - Ridge regression performed well on simple physical properties (Lipo, Caco2) but underperformed on complex biological clearance targets, where non-linear tree models excel.\n\n\n# Prediction Adjustment and Uncertainty Analysis\n\n- **Fragment Holdout Experiment:**\n - Held out 22 small graphlets (|S| \le 21\,000100\,000 QM9 molecules to simulate missing structural knowledge.\n\n\n\n - **Raw Unadjusted Model:** MAE = **90.27\,\text{kcal/mol}R^2 = 0.6708.\n - **Adjusted Model (\hat{y}{\text{adj}}43.24\,\text{kcal/mol}R^2 = 0.9296.\n - Applying mean-coefficient bias adjustment reduced prediction error by **52%** and improved R^2n_{\text{unseen}}r = 0.5809\rho = 0.4214\n - Unseen fraction (\text{Fraction}_{\text{unseen}}r = 0.7144\rho = 0.4579\n - Calibrated UQ Regression: Pearson r = 0.6891\rho = 0.4358\n\n- **Confidence Curve Efficiency (\text{CC}_{\text{eff}}):**\n - To measure how effectively UQ metrics filter out high-error predictions, Confidence Curve Efficiency is defined relative to Area Under the Confidence Oracle (AUCO) and Area Between Anti-oracle and Oracle (ABAO):\n \text{CC}{\text{eff}} = 1 - \frac{\text{AUCO}}{\text{ABAO}}\n where \text{CC}{\text{eff}} = 1\text{CC}{\text{eff}} = 0 represents random point removal.\n\n\n\n - **Efficiency Scores:**\n - Fraction metric (\text{Fraction}_{\text{unseen}}\text{CC}{\text{eff}} = 0.63**\n - Count metric (n_{\text{unseen}}\text{CC}{\text{eff}} = 0.61**\n - Calibrated UQ Regression: **\text{CC}{\text{eff}} = 0.55$$**
- The unseen fraction metric provides the strongest overall error correlation and filtering efficiency.
Implementation Software Details
- Software Library (
minervachem):- Open-source Python package hosted at
http://www.github.com/lanl/minervachem/. - Uses RDKit and NetworkX for molecular representation, subgraph enumeration, and graphlet hashing.
- Stores graphlet counts as SciPy sparse matrices.
- Integrates scikit-learn for hierarchical ridge regression, LightGBM for boosted trees, FLAML for automated hyperparameter tuning, and implements the PADRE (Pairwise Difference Regression) meta-algorithm.
- Open-source Python package hosted at