This is the official code repository for PLAPT, a state-of-the-art protein-ligand binding affinity predictor. Preprint
Abstract
Understanding protein-ligand binding affinity is crucial for drug discovery, enabling the identification of promising drug candidates efficiently. We introduce PLAPT, a novel model leveraging transfer learning from pre-trained transformers like ProtBERT and ChemBERTa to predict binding affinities with high accuracy. Our method processes one-dimensional protein and ligand sequences, leveraging a branching neural network architecture for feature integration and affinity estimation. We demonstrate PLAPT's superior performance through validation on multiple datasets, achieving state-of-the-art results while requiring significantly less computational resources for training compared to existing models. Our findings indicate that PLAPT offers a highly effective and accessible approach for accelerating drug discovery efforts.
PLAPT Architecture
Usage
Plapt CLI
Plapt CLI is a command-line interface for the Plapt Python package, designed for predicting affinities using sequences and SMILES strings. This tool is user-friendly and offers flexibility in output formats and file handling.
Prerequisites
Before using Plapt CLI, you need to have the following installed:
If -o is omitted, results are printed to the console.
Using Plapt Directly in Python
Apart from the command-line interface, Plapt can also be used directly in Python scripts. This allows for more flexibility and integration into larger Python projects or workflows.
Installation
Ensure you have followed the installation steps mentioned in the earlier section to set up the Plapt environment and dependencies.
Basic Usage
To use Plapt in a Python script, you need to import the Plapt class and then create an instance of it. You can then call its methods to predict affinities.
Importing and Initializing Plapt
python
1# First, import the Plapt class from the package, making sure you are working in the same directory as the plapt.py file:2from plapt import Plapt
34# create an instance of the Plapt class. For basic usage, no initialization parameters are needed:5plapt = Plapt()
Running Predictions
After initializing the Plapt object, you can use it to predict affinities. Here's an example of how to do it:
The outputted json can subsequently used for other tasks.
Advanced Usage
Plapt can be initialized with specialized parameters, such as the prediction module used, caching, or the inference device. Example below:
python
1from plapt import Plapt
23# create an instance of the Plapt class with other parameters:4plapt = Plapt(5 prediction_module_path="models/predictionModule.onnx",# For using a different prediction module. This is set to "models/predictionModule.onnx" by default. 6 caching=True,# Enable or disable caching. Enabled by default.7 device="cuda"# Set the computation device ("cuda" for GPU or "cpu" for CPU). If cuda isn't available on your system, it will fallback to "cpu" automatically.8)
Each option can be specified seperately (e.g., plapt = Plapt(caching=False) if you would like to disable caching.
Data Preparation and Encoding
We source protein-ligand pairs and their corresponding affinity values from an open-source binding affinity dataset on hugginface, binding_affinity. We then used ProtBERT and ChemBERTa for encoding proteins and ligands respectively, giving us high quality vector-space representations. The encoding process is detailed in the encoding.ipynb notebook. The dataset, already encoded, is available on our Google Drive for ease of access and use.
Importing Encoders and Running the Notebook
For users to import the encoders and run the Wolfram notebook (WL Notebooks/FinalEssay.nb), we provide the encoders_to_onnx.ipynb notebook. This ensures that users can replicate our encoding process and utilize the full capabilities of PLAPT.