Improving Small Molecule pK a Prediction Using Transfer Learning with Graph Neural Networks

Fritz Mayr, Marcus Wieder, Oliver Wieder, Thierry LangerbioRxiv 2022

TL;DR

This paper introduces "pkasolver," an open-source Python package that uses graph neural networks (GNNs) and transfer learning to accurately predict microstate pKa values for small molecules. By pre-training on a massive dataset of calculated pKa values and then fine-tuning on experimental data, pkasolver achieves state-of-the-art performance, addressing limitations of existing commercial and academic tools.

What Problem Does This Paper Address?

Predicting the pKa (acid dissociation constant) of small molecules is crucial in drug discovery and molecular modeling. It influences a molecule's charge, structure, and ultimately its behavior in biological systems. However, existing methods often face challenges: commercial tools can be expensive and restrictive, while academic solutions might require significant computational resources or expert knowledge to set up and use. Furthermore, accurately enumerating all possible protonation states and their corresponding pKa values for a molecule is a complex task. This paper aims to provide a more accessible, accurate, and efficient solution for this problem.

Methods

The core of this work is a graph neural network (GNN) model. Molecules are represented as graphs, where atoms are nodes and bonds are edges, with features encoding atom properties. The GNN architecture, specifically a Graph Isomorphism Network (GIN), is used to learn representations of protonated and deprotonated molecular species.

A key methodological innovation is the two-stage training approach:

  1. Pre-training: The GNN is initially trained on a very large dataset of calculated microstate pKa values from the ChEMBL database. This allows the model to learn general patterns of pKa prediction.
  2. Fine-tuning: The pre-trained model is then further trained (fine-tuned) on a smaller dataset of experimentally measured pKa values. This step significantly improves accuracy, especially for challenging cases, and helps the model generalize better to real-world experimental data.

The GNN model is integrated with Dimorphite-DL, an open-source tool for enumerating ionization states. This combination allows for the sequential prediction of pKa values for all relevant protonation states of a molecule.

Datasets

  • ChEMBL database: Used for pre-training the GNN model. It contained approximately 714,906 calculated microstate pKa values.
  • Experimental data set: A curated set of 5,994 molecules with experimentally measured pKa values, used for fine-tuning the model.
  • Novartis test set: An independent test set of 280 molecules used for evaluating model performance.
  • Literature test set: Another independent test set of 123 molecules, also used for evaluation.

The paper also mentions that the ChEMBL data was filtered to remove molecules present in the test sets to prevent data leakage.

Key Insights and Ideas

  • Transfer learning is highly effective for pKa prediction: Pre-training on a large, albeit calculated, dataset and then fine-tuning on a smaller, experimental dataset significantly boosts predictive accuracy. This approach leverages the strengths of both data types.
  • GNNs are well-suited for molecular property prediction: Representing molecules as graphs allows GNNs to automatically learn relevant features and relationships, reducing the need for manual feature engineering.
  • Combining GNNs with ionization state enumeration is powerful: The integration with Dimorphite-DL enables the prediction of sequential pKa values, providing a more complete picture of a molecule's acid-base behavior across different pH ranges.
  • The Novartis test set is particularly challenging: The paper notes that the fine-tuned model showed a particularly significant improvement on the Novartis test set, suggesting it presents unique challenges for pKa prediction models.

Key Results

  • The fine-tuned GNN model achieved state-of-the-art performance on the Novartis and Literature test sets, performing comparably to or better than established commercial software (Epik, Marvin) and other machine learning models.
  • On the Literature test set, the fine-tuned model achieved a Mean Absolute Error (MAE) of 0.52 and a Root Mean Squared Error (RMSE) of 0.82.
  • On the challenging Novartis test set, the MAE was 0.71 and the RMSE was 0.93. The fine-tuning step reduced the RMSE on this set from 1.18 to 0.93.
  • The developed pkasolver package is open-source and freely available, providing an accessible tool for researchers.
  • The paper demonstrates the package's capability with an example of ethylenediaminetetraacetic acid (EDTA), predicting its six pKa values with good relative agreement to experimental data.

Limitations and Future Work

  • Range of pKa values: The paper notes that the model's predictions are generally within the range of the training data (0-14), but extreme values might be less accurate.
  • Tautomeric changes: The current implementation does not explicitly consider tautomeric changes, which can sometimes lead to invalid molecular structures during protonation state generation.
  • Uncertainty estimation: While the package provides standard deviation for pKa predictions, further work could focus on more robust uncertainty quantification.
  • The authors encourage the community to build upon their work, suggesting future development could involve expanding the model's capabilities or applying it to other molecular property prediction tasks.

Summary updated

Abstract

Abstract Enumerating protonation states and calculating micro-state pK a values of small molecules is an important yet challenging task for lead optimization and molecular modeling. Commercial and non-commercial solutions have notable limitations such as restrictive and expensive licenses, high CPU/GPU hour requirements, or the need for expert knowledge to set up and use. We present a graph neural network model that is trained on 714,906 calculated mico-state pK a predictions from molecules obtained from the ChEMBL database. The model is fine-tuned on a set of 5,994 experimental pK a values significantly improving its performance on two challenging test sets. Combining the graph neural network model with Dimorphite-DL , an open-source program for enumerating ionization states, we have developed the open-source Python package pkasolver, which is able to generate and enumerate protonation states and calculate micro-state pK a values with high accuracy.
BibTeX
@misc{mayr2022improving,
  author = {Fritz Mayr and Marcus Wieder and Oliver Wieder and Thierry Langer},
  title = {{Improving Small Molecule pK <sub> <i>a</i> </sub> Prediction Using Transfer Learning with Graph Neural Networks}},
  year = {2022},
  doi = {10.1101/2022.01.20.476787},
  howpublished = {bioRxiv},
}
Figure