PepTune
PepTune leverages Monte-Carlo Tree Search (MCTS) to guide a generative masked discrete diffusion model which iteratively refines a set of Pareto non-dominated sequences optimized across a set of therapeutic properties, including binding affinity, cell membrane permeability, solubility, non-fouling, and non-hemolysis.
Environment Installation
1 conda env create -f src/environment.yml
2
3 conda activate peptune
Model Pretrained Weights Download
Follow the steps below to download the model weights required for this experiment.
Download the PepTune pre-trained MDLM checkpoint and place in checkpoints/: https://drive.google.com/file/d/1oXGDpKLNF0KX0ZdOcl1NZj5Czk2lSFUn/view?usp=sharing
Download the pre-trained binding affinity Transformer model and place in src/scoring/functions/classifiers/: https://drive.google.com/file/d/128shlEP_-rYAxPgZRCk_n0HBWVbOYSva/view?usp=sharing
Training Data Download
1 # Download peptide_data.zip into the data/ directory
2 cd data/
3
4 # Unzip the training data
5 unzip peptide_data.zip
6
7 cd ..
After unzipping, the data should be located at data/peptide_data/.
Repository Structure
PepTune/
├── src/
│ ├── train_peptune.py # Main training script
│ ├── generate_mcts.py # MCTS-guided peptide generation
│ ├── generate_unconditional.py # Unconditional generation
│ ├── diffusion.py # Core masked discrete diffusion model
│ ├── pareto_mcts.py # Pareto-front MCTS implementation
│ ├── roformer.py # RoFormer backbone
│ ├── noise_schedule.py # Noise scheduling (loglinear, logpoly)
│ ├── config.yaml # Hydra configuration
│ ├── config.py # Argparse configuration
│ ├── environment.yml # Conda environment
│ ├── scoring/ # Therapeutic property scoring
│ │ ├── scoring_functions.py # Unified scoring interface
│ │ └── functions/ # Individual property predictors
│ │ ├── binding.py
│ │ ├── hemolysis.py
│ │ ├── nonfouling.py
│ │ ├── permeability.py
│ │ ├── solubility.py
│ │ └── classifiers/ # Pre-trained scoring model weights
│ ├── tokenizer/ # SMILES SPE tokenizer
│ │ ├── my_tokenizers.py
│ │ ├── new_vocab.txt
│ │ └── new_splits.txt
│ └── utils/ # Utilities & PeptideAnalyzer
│ ├── app.py
│ ├── generate_utils.py
│ └── utils.py
├── scripts/ # Shell scripts for running experiments
│ ├── train.sh # Pre-training
│ ├── generate_mcts.sh # MCTS-guided generation
│ └── generate_unconditional.sh # Unconditional generation
├── data/ # Training data
│ ├── dataloading_for_dynamic_batching.py
│ └── dataset.py
├── checkpoints/ # Model checkpoints
└── assets/ # Figures
Pre-training
Before running, fill in HOME_LOC and ENV_LOC in scripts/train.sh and base_path in src/config.yaml to match your paths.
1 chmod +x scripts/train.sh
2
3 nohup ./scripts/train.sh > train.log 2 > &1 &
Training uses Hydra configuration from src/config.yaml. Key settings:
Backbone: RoFormer (768 hidden, 8 layers, 12 heads)
Optimizer: AdamW (lr=3e-4, weight_decay=0.075)
Data: 11M SMILES peptide dataset with dynamic batching by length
Precision: fp64
Checkpoints saved to checkpoints/ (monitors val/nll, saves top 10)
MCTS-Guided Peptide Generation
Generate therapeutic peptides optimized across multiple objectives using Monte-Carlo Tree Search.
Fill in base_path in src/config.yaml and src/scoring/scoring_functions.py.
Fill in HOME_LOC in scripts/generate_mcts.sh.
Create output directories: mkdir -p results logs
1 chmod +x scripts/generate_mcts.sh
2
3 # Usage: ./scripts/generate_mcts.sh [PROT_NAME] [PROT_NAME2] [MODE] [MODEL] [LENGTH] [EPOCH]
4 # Example: Generate peptides targeting GFAP with length 100
5 nohup ./scripts/generate_mcts.sh gfap "" 2 mcts 100 7 > generate.log 2 > &1 &
Available Target Proteins
Name Target amhrAMH Receptor tfrTransferrin Receptor gfapGlial Fibrillary Acidic Protein glp1GLP-1 Receptor glastExcitatory Amino Acid Transporter ncamNeural Cell Adhesion Molecule cereblonCereblon (CRBN) ligaseE3 Ubiquitin Ligase skp2S-Phase Kinase-Associated Protein 2 p53Tumor Suppressor p53 egfpEnhanced Green Fluorescent Protein
To specify a custom target protein, override +prot_seq=<amino acid sequence> and +prot_name=<name> as Hydra arguments in the generation script.
Scoring Objectives
PepTune jointly optimizes across five therapeutic properties via the integrated scoring suite:
Objective Property Model binding_affinity1Binding affinity to target protein Cross-attention Transformer solubilityAqueous solubility XGBoost on SMILES CNN embeddings hemolysisNon-hemolytic SMILES binary classifier nonfoulingNon-fouling SMILES binary classifier permeabilityCell membrane permeability PAMPA CNN
Default MCTS Hyperparameters
These can be overridden via Hydra config overrides:
Parameter Default Description mcts.num_children50 Branching factor per MCTS node mcts.num_iter128 Number of MCTS iterations mcts.num_objectives5 Number of optimization objectives sampling.steps128 Diffusion denoising steps sampling.seq_length200 Generated peptide length
Unconditional Generation
Generate peptides without property guidance:
1 chmod +x scripts/generate_unconditional.sh
2
3 nohup ./scripts/generate_unconditional.sh > generate_unconditional.log 2 > &1 &
Evaluation
To summarize metrics after generation, fill in path and prot_name in src/metrics.py and run:
Citation
If you find this repository helpful for your publications, please consider citing our paper:
1 @article{tang2025peptune,
2 title={Peptune: De novo generation of therapeutic peptides with multi-objective-guided discrete diffusion},
3 author={Tang, Sophia and Zhang, Yinuo and Chatterjee, Pranam},
4 journal={42nd International Conference on Machine Learning},
5 year={2025}
6 }
License
To use this repository, you agree to abide by the Apache 2.0 License.