[ICML2025] Zero-Shot Cyclic Peptide Design with Composable Geometric Conditions
Codebase is complete but readme is under construction. Directly contact us if you are in hurry to use our codebase.
The conda environment can be constructed with the configuration env.yaml:
conda env create -f env.yamlThe codes are tested with cuda version 12.4 and pytorch version 1.13.1.
Don't forget to activate the environment before running the codes:
conda activate ComposerWe offer you a convenient and direct way to generate peptide using the ckpt we provided in ./checkpoint.
First we should set the condition we want to use:
export condition={CONDITION}Here, CONDITION should be a number:
1: Stapled peptide
2: Head-to-tail peptide
3: Disulfide peptide
4: Bicycle peptide
After that, run the following command:
python generate.py --config ./configs/pepbench/test_prompt_codesign.yaml --ckpt ./ckpts/LDM_codesign/version_325/checkpoint/epoch37_step85234.ckpt --gpu ${GPU_index}$ --save_dir ./results/${FOLDER NAME}You will get the linear peptide meeting with geometric constraints. You can use the ./evaluate_utils/success_utils.ipynb to filter the peptide that meet the geometric requirements.
The last step, please find the corresponding file in relaxer folder to transfer the generated linear peptide into the cyclic peptide. You need to specify the acid amoid index to generate the cyclic structure.
relaxer/
│ ├── base.py
│ ├── bicycle.py
│ ├── cys_to_cys.py
│ ├── k_to_de.py
│ ├── head_tail.py These datasets are only used for benchmarking models. If you just want to use the trained weights for inferencing on your cases, there is no need to download these datasets.
- Download
The datasets, which are originally introduced in this paper, are uploaded to Zenodo at this url. You can download them as follows:
mkdir datasets # all datasets will be put into this directory
wget https://zenodo.org/records/13373108/files/train_valid.tar.gz?download=1 -O ./datasets/train_valid.tar.gz # training/validation
wget https://zenodo.org/records/13373108/files/LNR.tar.gz?download=1 -O ./datasets/LNR.tar.gz # test set
wget https://zenodo.org/records/13373108/files/ProtFrag.tar.gz?download=1 -O ./datasets/ProtFrag.tar.gz # augmentation dataset- Decompresss
tar zxvf ./datasets/train_valid.tar.gz -C ./datasets
tar zxvf ./datasets/LNR.tar.gz -C ./datasets
tar zxvf ./datasets/ProtFrag.tar.gz -C ./datasets- Process
python -m scripts.data_process.process --index ./datasets/train_valid/all.txt --out_dir ./datasets/train_valid/processed # train/validation set
python -m scripts.data_process.process --index ./datasets/LNR/test.txt --out_dir ./datasets/LNR/processed # test set
python -m scripts.data_process.process --index ./datasets/ProtFrag/all.txt --out_dir ./datasets/ProtFrag/processed # augmentation datasetThe index of processed data for train/validation splits need to be generated as follows, which will result in datasets/train_valid/processed/train_index.txt and datasets/train_valid/processed/valid_index.txt:
python -m scripts.data_process.split --train_index datasets/train_valid/train.txt --valid_index datasets/train_valid/valid.txt --processed_dir datasets/train_valid/processed/Each task requires the following steps:
- Train autoencoder
- Train latent diffusion model
- Calculate distribution of latent distances between consecutive residues
- Generation & Evaluation
The pre-trained autoencoder is located at the ./checkpoints/autoencoder.pth. The weights are directly adopted from paper Full-atom peptide design with geometric latent diffusion.
GPU="0" bash scripts/train.sh ./configs/pepbench/prompt_finetune/train_codesign.yaml
python setup_latent_guidance.py \
--config ./configs/pepbench/prompt_finetune/setup_latent_guidance.yaml \
--ckpt ${CKPT_PATH} Thank you for your interest in our work!
Please let us know if you have any questions:
@misc{jiang2025zeroshot,
title={Zero-Shot Cyclic Peptide Design with Composable Geometric Conditions},
author={Dapeng Jiang and Xiangzhe Kong and Jiaqi Han and Mingyu Li and Rui Jiao and Wenbing Huang and Stefano Ermon and Jianzhu Ma and Yang Liu},
year={2025},
eprint={2507.04225},
archivePrefix={arXiv},
primaryClass={cs.LG}
}