Protein-Ligand Binding Affinity Prediction using Graph Neural Networks
High-performance protein-ligand binding affinity prediction model - 2nd place in CASP16 ligand affinity challenge
- CASP16: 2nd place in the prestigious CASP16 ligand affinity prediction challenge
- High Accuracy: Graph Neural Network-based architecture for precise binding affinity prediction
- Research Ready: Pre-trained models ready for immediate use
- Easy Integration: Simple Python API and command-line interface
- Scalable: Batch processing for high-throughput screening
Choose your preferred installation method:
Option 1: Install from PyPI (Simplest)
pip install bapredOption 2: Using Conda (Recommended for Development)
git clone https://github.com/eightmm/BA-Pred.git
cd BA-Pred
conda env create -f env.yaml
conda activate BAPred
pip install -e .Option 3: From Source
git clone https://github.com/eightmm/BA-Pred.git
cd BA-Pred
pip install -r requirements.txt
pip install -e .python run_inference.py -r example/1KLT.pdb -l example/ligands.sdf -o results.csvThat's it! Your binding affinity predictions will be saved in results.csv.
# Predict binding affinities
python run_inference.py -r example/1KLT.pdb -l example/ligands.sdf -o results.csv# Use CPU instead of GPU
python run_inference.py -r protein.pdb -l ligands.sdf -o results.csv --device cpu
# Custom batch size for memory optimization
python run_inference.py -r protein.pdb -l ligands.sdf -o results.csv --batch_size 64
# Limit CPU workers for data loading
python run_inference.py -r protein.pdb -l ligands.sdf -o results.csv --ncpu 8
# Specify custom model path
python run_inference.py -r protein.pdb -l ligands.sdf -o results.csv --model_path /path/to/modelfrom bapred.inference import inference
# Run prediction programmatically
inference(
protein_pdb="example/1KLT.pdb",
ligand_file="example/ligands.sdf",
output="results.csv",
batch_size=128,
ncpu=4,
model_path="bapred/weight",
device="cuda"
)BA-Pred/
├── bapred/ # Main package
│ ├── data/ # Data processing modules
│ │ ├── atom_feature.py # Atomic feature extraction
│ │ ├── data.py # Dataset handling
│ │ └── utils.py # Utility functions
│ ├── model/ # Neural network models
│ │ ├── GatedGCNLSPE.py # Gated Graph Convolution
│ │ └── model.py # Main model wrapper
│ ├── weight/ # Pre-trained weights
│ │ └── BAPred.pth # Model checkpoint
│ └── inference.py # Inference engine
├── example/ # Example files
│ ├── 1KLT.pdb # Sample protein structure
│ └── ligands.sdf # Sample ligand library
├── run_inference.py # Easy-to-use script
├── requirements.txt # Python dependencies
├── env.yaml # Conda environment
└── README.md # You are here!
- Protein: PDB format (
.pdb) - Ligands: SDF (
.sdf), MOL2 (.mol2), or text file with paths (.txt)
- CSV/TSV file with columns:
Name: Ligand identifierpKd: Predicted binding affinity (pKd scale)Kcal/mol: Binding energy in kcal/mol
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
If you use BA-Pred in your research, please cite:
@software{bapred2024,
title={BA-Pred: Protein-Ligand Binding Affinity Prediction using Graph Neural Networks},
author={Jaemin Sim},
year={2024},
url={https://github.com/eightmm/BA-Pred}
}- Documentation: Check this README and code comments
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with care for the scientific community
Star us on GitHub if this project helped you!