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 nn-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 NN.

Illustration of graphlet featurization and linear model construction

  • 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 (N\text{N}) with 3 bonds is distinguished from a positively charged nitrogen (N+\text{N}^+) with 4 bonds at graphlet size N=1N = 1. Species-only typing cannot resolve this difference until graphlet size N=5N = 5
  • Formal Mathematical Description:

    • Let a molecular graph be M=(A,B)M = (A, B), where AA is the set of atoms and BB is the set of bonds.
    • An induced molecular subgraph formed by atom subset S×AS \times A and all internal bonds is denoted M[S]M[S].
    • The family of all atom subsets that induce connected subgraphs is defined as:     P(M)={S⊆A:M[S] is connected}\mathcal{P}(M) = \{S \subseteq A : M[S] \text{ is connected}\}
    • The subset restricted to graphlets of size at most NN atoms is:     PN(M)={S⊆A:∣S∣≤N,M[S] is connected}\mathcal{P}_N(M) = \{S \subseteq A : |S| \le N, M[S] \text{ is connected}\}
    • Let H\mathcal{H} denote the set of graph isomorphism classes and ⟦⋅⟧\llbracket \cdot \rrbracket represent the Iverson bracket indicator function. The graphlet fingerprint histogram vector CNC_N has components:     CHN(M)=∑S∈PN(M)⟦M[S]∈H⟧C_{\mathcal{H}}^N(M) = \sum_{S \in \mathcal{P}_N(M)} \llbracket M[S] \in \mathcal{H} \rrbracket
  • Recursive Graphlet Hashing Algorithm:

    • To efficiently categorize isomorphism classes H(M[S])H(M[S]), a recursive integer-labeling hashing function is defined using predefined base atom labels hatomh_{\text{atom}} and bond labels hbondh_{\text{bond}}:     H(M[S])={hatom(M[S]),∣S∣=1hbond(M[S]),∣S∣=2hrec(c∣S∣−1(M[S])),∣S∣≥3H(M[S]) = \begin{cases} h_{\text{atom}}(M[S]), & |S| = 1 \\ h_{\text{bond}}(M[S]), & |S| = 2 \\ h_{\text{rec}}(c_{|S|-1}(M[S])), & |S| \ge 3 \end{cases}
    • Here, hrech_{\text{rec}} constructs a label by sorting the histogram of constituent (∣S∣−1)(|S|-1)-size subgraphs and pairing them with their counts.
    • Triplets (∣S∣=3|S|=3) are hashed in terms of their atoms and bonds; quadruplets (∣S∣=4|S|=4) 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 CN\mathcal{C}^N for graphlets up to size NN decomposes as a direct sum of vector spaces:     CN=⨁n=1NVn\mathcal{C}^N = \bigoplus_{n=1}^N \mathcal{V}^n
    • The components of vector vn∈Vn\mathbf{v}_n \in \mathcal{V}^n correspond specifically to counts of graphlets containing exactly nn atoms.
  • Hierarchical Model Formulation:

    • An order-NN hierarchical linear model predicts property yy as:     y^=FN(cN)=∑n=1Nfn(vn)\hat{y} = F_N(c_N) = \sum_{n=1}^N f_n(\mathbf{v}_n)
    • Training proceeds sequentially from n=1n = 1 up to NN:
    • Level n=1n = 1 (Atoms): Model f1(v1)f_1(\mathbf{v}_1) is fit directly to target y1=yy_1 = y.
    • Level n>1n > 1 (Substructures): Model fn(vn)f_n(\mathbf{v}_n) is fit to the residual target from the previous order:       yn=y−Y^n−1y_n = y - \hat{Y}_{n-1}       where Y^n−1=Fn−1(cn−1)\hat{Y}_{n-1} = F_{n-1}(c_{n-1}).
    • Each constituent function fnf_n minimizes loss L(yn,fn(vn))\mathcal{L}(y_n, f_n(\mathbf{v}_n)).
    • 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 MM form an NN-partite Directed Acyclic Graph (DAG) denoted G_{S S'}(M) = \llbracket S \supset S' \rrbracket$.\n - Adjacent levels n+1andandnareconnectedbysub−matricesare connected by sub-matricesG_n:\n    (G_n){S S'} = G{\llbracket |S|=n \rrbracket, \llbracket |S'|=n+1 \rrbracket}\n\n![Illustration of interpretability scheme based on substructure graphs](https://assets.knowt.com/pdf-flow-prod/f81235e7-21fc-4f96-9549-934e225480e2-figures/1.jpg)\n\n- **Downward Projections (Atom-Level Explanations):**\n - To preserve additivity (ensuring projected contributions sum exactly to predicted property \hat{y}),column−normalizedmatrices), column-normalized matrices\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}nassociatedwithlevelassociated with levelngraphletsareprojectedrecursivelydownwardtoyieldlocalatomattributionsgraphlets are projected recursively downward to yield local atom attributions\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 = 2),reverseupwardprojectionsaredefinedusingedge−valenceweightmatrix), reverse upward projections are defined using edge-valence weight matrixK, 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_ngivesgives\hat{K}n,leadingtoupwardprojectionvectors, leading to upward projection vectors\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}^1decomposestotalpredictiondecomposes total prediction\hat{y}intoindividualatomterms.Forinto individual atom terms. Forn = 2,,\vec{c}^2decomposesdecomposes\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}_sdenotethemeanlinearcoefficientforgraphletsofsizedenote the mean linear coefficient for graphlets of sizes = 1, \dots, N across the training set.\n - Let d_N^sbethehistogramcountofallunseengraphletsofsizebe the histogram count of all unseen graphlets of sizes 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\,000atomizationenergies(atomization energies (\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_2regularized)andLightGBMacrossgraphlets,Morgancircularfingerprints,andRDKitpathfingerprintsforsizesregularized) and LightGBM across graphlets, Morgan circular fingerprints, and RDKit path fingerprints for sizess = 1toto9.\n\n![Test set performance vs. fragment count on the QM9 DHat task](https://assets.knowt.com/pdf-flow-prod/f81235e7-21fc-4f96-9549-934e225480e2-figures/2.png)\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![Bond-level model interpretability vs experimental BDE](https://assets.knowt.com/pdf-flow-prod/f81235e7-21fc-4f96-9549-934e225480e2-figures/3.png)\n\n - **Ethane (\text{C}2\text{H}_6):**\n - \text{C-H}experimentalBDE=experimental BDE =101.1\,\text{kcal/mol}∣|\vec{c}^2projection=projection =101.8\,\text{kcal/mol}\n - \text{C-C}experimentalBDE=experimental BDE =90.1\,\text{kcal/mol}∣|\vec{c}^2projection=projection =66.5\,\text{kcal/mol}\n - **Ethene (\text{C}_2\text{H}_4):**\n - \text{C-H}experimentalBDE=experimental BDE =110.7\,\text{kcal/mol}∣|\vec{c}^2projection=projection =102.2\,\text{kcal/mol}\n - \text{C=C}experimentalBDE=experimental BDE =174.1\,\text{kcal/mol}∣|\vec{c}^2projection=projection =153.5\,\text{kcal/mol}\n - **Ethyne (\text{C}_2\text{H}_2):**\n - \text{C-H}experimentalBDE=experimental BDE =133.32\,\text{kcal/mol}∣|\vec{c}^2projection=projection =102.18\,\text{kcal/mol}\n - \text{C}\equiv\text{C}experimentalBDE=experimental BDE =230.7\,\text{kcal/mol}∣|\vec{c}^2projection=projection =199.9\,\text{kcal/mol}\n\n- **Theoretical BDE Large-Scale Validation:**\n - Evaluated on \sim 50\,000single−bondBDEsrecalculatedattheB3LYP/6−31G(2df,p)levelacrosssingle-bond BDEs recalculated at the B3LYP/6-31G(2df,p) level across5\,000 QM9 molecules (from the dataset by John et al.).\n - A holdout evaluation (training on \sim 128\,000QM9molecules,excludingQM9 molecules, excluding2\,500testmolecules)yieldedanoverallPearsoncorrelationof∗∗test molecules) yielded an overall Pearson correlation of **r = 0.4198∗∗between** between\vec{c}^2 projections and DFT single-bond BDEs.\n\n![Relationship between Bond Dissociation Energies computed with DFT and bond-level interpretations](https://assets.knowt.com/pdf-flow-prod/f81235e7-21fc-4f96-9549-934e225480e2-figures/4.png)\n\n - **Element-Pair Correlation Breakdown (Holdout Set):**\n - \text{C-C}bonds:bonds:n = 4\,699,Pearson, Pearsonr = 0.4968((p < 10^{-12})\n - \text{C-N}bonds:bonds:n = 1\,064,Pearson, Pearsonr = 0.3043((p < 10^{-12})\n - \text{C-O}bonds:bonds:n = 1\,440,Pearson, Pearsonr = 0.2266((p < 10^{-12})\n - \text{H-N}bonds:bonds:n = 990,Pearson, Pearsonr = 0.2298((p < 10^{-12})\n - \text{C-H}bonds:bonds:n = 15\,980,Pearson, Pearsonr = 0.1414((p < 10^{-12})\n - \text{H-O}bonds:bonds:n = 522,Pearson, Pearsonr = -0.0584((p > 0.05, not significant)\n\n\n# Solubility Modeling and Atom-Centered Interpretations\n\n- **Solubility Benchmarks:**\n - Evaluated experimental log solubilities (\log S,molarity)infoursolvents(acetone,benzene,ethanol,water)fromBoobieretal.,withdatasetsizesrangingfrom, molarity) in four solvents (acetone, benzene, ethanol, water) from Boobier et al., with dataset sizes ranging from\sim 400toto900 molecules.\n - Tested three water solubility tasks: "Water" (-4 < \log S < -1),"Water(wide)"(fullrange), "Water (wide)" (full range-12toto2),and"Water(wide−narrow)"(trainedonwiderange,evaluatedon), and "Water (wide-narrow)" (trained on wide range, evaluated on-4 < \log S < -1).\n\n![Model performance on solubility datasets](https://assets.knowt.com/pdf-flow-prod/f81235e7-21fc-4f96-9549-934e225480e2-figures/5.jpg)\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![Linear model predictions of aqueous solubility projected to the atom level](https://assets.knowt.com/pdf-flow-prod/f81235e7-21fc-4f96-9549-934e225480e2-figures/6.png)\n\n - Polar functional groups (hydroxyl -\text{OH},amine, amine-\text{NH}_2)producestronglypositive) produce strongly positive\vec{c}^1 contributions, increasing predicted aqueous solubility.\n - Halogen substituents (chloro -\text{Cl})andhydrophobicalkylbackbonesproducenegative) and hydrophobic alkyl backbones produce negative\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 2)presentin) present in1\,000toto100\,000 QM9 molecules to simulate missing structural knowledge.\n\n![Performance improvement from adjustment based on unseen fragments](https://assets.knowt.com/pdf-flow-prod/f81235e7-21fc-4f96-9549-934e225480e2-figures/7.png)\n\n - **Raw Unadjusted Model:** MAE = **90.27\,\text{kcal/mol}∗∗,**,R^2 = 0.6708.\n - **Adjusted Model (\hat{y}{\text{adj}}):∗∗MAE=∗∗):** MAE = **43.24\,\text{kcal/mol}∗∗,**,R^2 = 0.9296.\n - Applying mean-coefficient bias adjustment reduced prediction error by **52%** and improved R^2by∗∗38by **38%**.\n\n- **Uncertainty Quantification Metrics Comparison:**\n - Evaluated on a 1,000-molecule sample from QM9.\n\n![Correspondence of various metrics for uncertainty with error](https://assets.knowt.com/pdf-flow-prod/f81235e7-21fc-4f96-9549-934e225480e2-figures/8.png)\n\n - **Correlations with Absolute Residuals:**\n - Unseen count (n_{\text{unseen}}):Pearson): Pearsonr = 0.5809,Spearman, Spearman\rho = 0.4214\n - Unseen fraction (\text{Fraction}_{\text{unseen}}):Pearson): Pearsonr = 0.7144,Spearman, Spearman\rho = 0.4579\n - Calibrated UQ Regression: Pearson r = 0.6891,Spearman, Spearman\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}} = 1representsperfectoracleperformanceandrepresents perfect oracle performance and\text{CC}{\text{eff}} = 0 represents random point removal.\n\n![Confidence curves comparing uncertainty metrics to an oracle](https://assets.knowt.com/pdf-flow-prod/f81235e7-21fc-4f96-9549-934e225480e2-figures/9.jpg)\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.