A modular deep learning framework for antibody sequence classification and representation using pre-trained Protein Language Models
Python
1
0 commits
updated Mar 5, 2026
This repository implements Protein Language Models (PLMs) for antibody sequence analysis, specifically focused on B-cell receptor (BCR) classification.
Antibodies are versatile proteins with the capacity to bind a broad range of targets. This project explores deep representation learning models (like AntiBERTa, ESM-2, and BioBERT) to comprehend antibody sequences and predict their binding properties.
pip install .
For development:
pip install -e ".[dev]"
Place your BCR sequence data in CSV format in the data/ directory. The CSV should contain columns for sequences (e.g., SEQUENCE_AA) and labels (e.g., BINDING).
You can use the provided training logic to train a model:
from src.plm import PLMClassifier, build_balanced_dataset, get_dataloaders, train
from transformers import RoFormerTokenizer
# Configuration
config = {
'model_type': 'antiberta',
'classifier_type': 'mlp',
'device': 'cuda',
'learning_rate': 1e-5,
'num_epochs': 50,
'batch_size': 32,
'save_path': 'checkpoints/best_model.ckpt',
'log_interval': 10,
'require_improvement': 1000,
}
# Data
tokenizer = RoFormerTokenizer.from_pretrained("alchemab/antiberta2")
balanced_data = build_balanced_dataset('data/your_data.csv')
train_loader, test_loader, label_map = get_dataloaders(balanced_data, tokenizer, max_length=128)
# Model
model = PLMClassifier(model_type=config['model_type'], classifier_type=config['classifier_type'])
# Run Training
train(model, train_loader, test_loader, config)
This repository has been refactored from research notebooks into a professional Python package.
PLMClassifier uses a unified interface for AntiBERTa, ESM-2, and BioBERT.plm-train) simplifies the training pipeline for reproducible experiments.pyproject.toml and standard src/ layout for better maintainability and reproducibility.Liu, M., Zhang, Y., & Zhang, Y. (2025). Exploring protein language model architecture-induced biases for antibody comprehension. arXiv preprint. https://arxiv.org/abs/2512.09894v1
A modular deep learning framework for antibody sequence classification and representation using pre-trained Protein Language Models
Python
1
0 commits
updated Mar 5, 2026
This repository implements Protein Language Models (PLMs) for antibody sequence analysis, specifically focused on B-cell receptor (BCR) classification.
Antibodies are versatile proteins with the capacity to bind a broad range of targets. This project explores deep representation learning models (like AntiBERTa, ESM-2, and BioBERT) to comprehend antibody sequences and predict their binding properties.
pip install .
For development:
pip install -e ".[dev]"
Place your BCR sequence data in CSV format in the data/ directory. The CSV should contain columns for sequences (e.g., SEQUENCE_AA) and labels (e.g., BINDING).
You can use the provided training logic to train a model:
from src.plm import PLMClassifier, build_balanced_dataset, get_dataloaders, train
from transformers import RoFormerTokenizer
# Configuration
config = {
'model_type': 'antiberta',
'classifier_type': 'mlp',
'device': 'cuda',
'learning_rate': 1e-5,
'num_epochs': 50,
'batch_size': 32,
'save_path': 'checkpoints/best_model.ckpt',
'log_interval': 10,
'require_improvement': 1000,
}
# Data
tokenizer = RoFormerTokenizer.from_pretrained("alchemab/antiberta2")
balanced_data = build_balanced_dataset('data/your_data.csv')
train_loader, test_loader, label_map = get_dataloaders(balanced_data, tokenizer, max_length=128)
# Model
model = PLMClassifier(model_type=config['model_type'], classifier_type=config['classifier_type'])
# Run Training
train(model, train_loader, test_loader, config)
This repository has been refactored from research notebooks into a professional Python package.
PLMClassifier uses a unified interface for AntiBERTa, ESM-2, and BioBERT.plm-train) simplifies the training pipeline for reproducible experiments.pyproject.toml and standard src/ layout for better maintainability and reproducibility.Liu, M., Zhang, Y., & Zhang, Y. (2025). Exploring protein language model architecture-induced biases for antibody comprehension. arXiv preprint. https://arxiv.org/abs/2512.09894v1