Skip to content

dptech-corp/Uni-pKa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uni-pKa

The official implementation of the paper Uni-pKa: An Accurate and Physically Consistent pKa Prediction through Protonation Ensemble Modeling.

Relevant preprint at [ChemRxiv] | Small molecule protonation state ranking demo at [Bohrium App] | Full datasets at [AISSquare]

This machine-learning-based pKa prediction model achieves the state-of-the-art accuracy on several drug-like small molecule macro-pKa datasets. Uni-pK<sub>a</sub>'s performance

Two core components of Uni-pKa framework are

  • A microstate enumerator to systematically build the protonation ensemble from a single structure.

  • A molecular machine learning model to predict the free energy of each single structure.

The model reaches the expected accuracy in the inference stage after the comprehensive data preparation by the enumerator, pretraining on the ChemBL dataset and finetuning on our Dwar-iBond dataset.

Alt text

Microstate Enumerator

Introduction

It uses iterated template-matching algorithm to enumerate all the microstates in adjacent macrostates of a molecule's protonation ensemble from at least one microstate stored as SMILES.

The protonation template smarts_pattern.tsv modifies and augments the one in the paper MolGpka: A Web Server for Small Molecule pKa Prediction Using a Graph-Convolutional Neural Network and its open source implementation (MIT license) in the Github repository MolGpKa.

Usage

main.py is to reconstruct a plain pKa dataset to the Uni-pKa standard macro-pKa format with fully enumerated microstates.

cd enumerator
python main.py enum -i <input> -o <output> -m <mode>

The recommended environment is

python = 3.8.13
rdkit = 2021.09.5
numpy = 1.20.3
pandas = 1.5.2

The <input> dataset is assumed be a csv-like file with a column storing SMILES. There are two cases allowed for each entry in the dataset.

  1. It contains only one SMILES. The Enumerator helps to build the protonated/deprotonated macrostate and complete the original macrostate.
    • When <mode> is "A", it will be considered as an acid (thrown into A pool).
    • When <mode> is "B", it will be considered as a base (thrown into B pool).
  2. It contains a string like "A1,...,Am>>B1,...Bn", where A1,...,Am are comma-separated SMILES of microstates in the acid macrostate (all thrown into A pool), and B1,...,Bn are comma-separated SMILES of microstates in the base macrostate(all thrown into B pool). The Enumerator helps to complete the both.

A/B mode of the microstate enumerator

The <mode> "A" (default) or "B" determines which pool (A/B) is the reference structures and the starting point of the enumeration.

The <output> dataset is then constructed after the enumeration.

Machine Learning Model

Introduction

It is a Uni-Mol-based neural network. By embedding the neural network into thermodynamic relationship between the free energy and pKa throughout the training and inference stages, the framework preserves physical consistency and adapts to multiple tasks.

Alt text

Usage

The recommended environment is the docker image.

docker pull dptechnology/unimol:latest-pytorch1.11.0-cuda11.3

See details in Uni-Mol repository.

After the full datasets had been downloaded, use scripts/pretrain_pka_mlm_aml.sh to pretrain the model, use scripts/finetune_pka_aml.sh to finetune the model, use infer_test.sh to test the trained model on a macro-pKa dataset, and use infer_free_energy.sh to infer the free energy of given structures for any pKa-related tasks.

About

The official repository of Uni-pKa

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published