TR2-D2 For Multi-Objective Therapeutic Peptide Design 🧫
This part of the code is for finetuning a peptide MDM to optimize multiple therapeutic properties, including binding affinity to a protein target, solubility, non-hemolysis, non-fouling, and cell membrane permeability, with TR2-D2.
The codebase is partially built upon PepTune (Tang et.al, 2024), MDLM (Sahoo et.al, 2023), and MDNS (Zhu et.al, 2025).
Environment Installation
conda env create -f environment.yml
conda activate tr2d2-pep
Model Pretrained Weights Download
Follow the steps below to download the model weights requried for this experiment, which is originally from PepTune.
- Download the PepTune pre-trained MDLM and place in
/TR2-D2/peptides/pretrained/: https://drive.google.com/file/d/1oXGDpKLNF0KX0ZdOcl1NZj5Czk2lSFUn/view?usp=sharing - Download the pre-trained binding affinity Transformer model and place in
/TR2-D2/tr2d2-pep/scoring/functions/classifiers/: https://drive.google.com/file/d/128shlEP_-rYAxPgZRCk_n0HBWVbOYSva/view?usp=sharing
Finetune with TR2-D2
After downloading the pretrained checkpoints, follow the steps below to run fine-tuning:
- Fill in the
base_pathinscoring/scoring_functions.pyanddiffusion.py. - Fill in
HOME_LOCto the base path whereTR2-D2is located andENV_PATHto the directory where your environment is downloaded infinetune.sh. - Create a path
tr2d2-pep/resultswhere the fine-tuning curves and generation results will be saved andtr2d2-pep/checkpointsfor checkpoint saving. Also, createtr2d2-pep/logswhere the training logs will be saved. - To specify a target protein, set
--prot_seq <insert amino acid sequence>and--prot_name <insert protein name>. Default protein is Transferrin receptor (TfR).
Run fine-tuning using nohup with the following commands:
chmod +x finetune.sh
nohup ./finetune.sh > finetune.log 2>&1 &
Evaluation will run automatically after the specified number of fine-tuning epochs --num_epochs is finished. To summarize metrics, fill in path and prot_name in metrics.py and run:
python metrics.py