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 bapred
๐ Option 2: Using Conda (Recommended for Development)
git clone https://github.com/eightmm/BAPred.git
cd BAPred
conda env create -f env.yaml
conda activate BAPred
pip install -e .
๐ง Option 3: From Source
git clone https://github.com/eightmm/BAPred.git
cd BAPred
pip install -r requirements.txt
pip install -e .
python run_inference.py -r example/1KLT.pdb -l example/ligands.sdf -o results.csv
That'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/model
from 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"
)
BAPred/
โโโ ๐ฆ 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
โ โ โโโ GraphGPS.py # Graph GPS architecture
โ โ โโโ MHA.py # Multi-Head Attention
โ โ โโโ 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!
BAPred leverages cutting-edge graph neural network architectures:
- ๐ Graph Convolution: Gated GCN with Laplacian Positional Encoding
- ๐ Graph GPS: Global attention mechanism for long-range interactions
- ๐ญ Multi-Head Attention: Enhanced feature representation
- ๐ Complex Interactions: Protein-ligand interaction modeling
- 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
- Python: 3.11 or higher
- Memory: 4GB RAM minimum (8GB+ recommended)
- GPU: CUDA-compatible GPU (optional, but recommended for speed)
- Storage: 2GB free space
Dataset | Ligands | Processing Time | Performance |
---|---|---|---|
CASP16 | Challenge dataset | Competition | ๐ฅ 2nd Place |
Example | 500 | ~3 minutes | High precision |
Custom | Variable | Scales linearly | Research-grade |
BAPred achieved 2nd place in the CASP16 (Critical Assessment of protein Structure Prediction) ligand affinity prediction challenge, demonstrating its state-of-the-art performance in real-world protein-ligand binding affinity prediction tasks.
We welcome contributions! Please feel free to:
- ๐ Report bugs
- ๐ก Suggest features
- ๐ Improve documentation
- ๐ง Submit pull requests
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
If you use BAPred in your research, please cite:
@software{bapred2024,
title={BAPred: Protein-Ligand Binding Affinity Prediction using Graph Neural Networks},
author={Jaemin Sim},
year={2024},
url={https://github.com/eightmm/BAPred}
}
- ๐ Documentation: Check this README and code comments
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
Made with โค๏ธ for the scientific community
โญ Star us on GitHub if this project helped you!