PolyPharm is a deep learning-based framework for multi-target drug design, capable of generating molecules with potential activities against multiple targets.
/ ← Root directory
├── data ← Dataset, interaction scoring models, and multi-target scoring weights
│ ├── GSK3B+JNK3
│ └── ROR_gamma+DHODH
├── results ← Generated molecules from different methods on benchmark tasks
│ ├── gsk3β_jnk3
│ └── rorγt_dhodh
├── model ← Model code
├── score_modules ← Scoring utilities
│ ├── ESOL_Score
│ └── SA_Score
├── utils ← Utilities (multi-target scoring, data preprocessing, etc.)
├── environment.yml ← Conda environment
├── train_chembl_baseline.py ← Pre-training script
├── RL_generate.py ← Fine-tuning script
├── generate.py ← Molecule generation script
✅ Pre-generated molecules are provided for download (including QED, SA, Docking score, LogP, Weight) along with comparison methods (some from AIxFuse open-source data):
- GSK3β|JNK3 benchmark task:
results/gsk3β_jnk3/POLYGEN.csv - RORγt|DHODH benchmark task:
results/rorγt_dhodh/POLYGEN.csv
💡 To train from scratch, follow the steps below.
git clone https://github.com/Yozu-Roo/POLYGEN.git- Dataset (~1.69GB) download via Google Drive
- Or download via Baidu Drive
- Or contact via email: niuziru@stu.xmu.edu.cn
After download, extract and place the data/ folder at the root directory.
Recommended Python 3.8:
conda env create -f environment.yml
conda activate polygenpython train_chembl_baseline.py- For multiple GPUs, adjust
CUDA_VISIBLE_DEVICESin the script - Model weights are saved in
pretrain_output/during training
GSK3β|JNK3 benchmark task:
python RL_generate.py \
--target_name GSK3B JNK3 \
--output_dir ./finetune_output_GJ \
--model_path ./pretrain_output/rs_mapping/fold0_epoch32.pth \
--tokenizer_path ./pretrain_output/rs_mapping/tokenizer.pkl \
--n_mol 10000 \
--device cuda \
--batch_size 512 \
--seed 42 \
--threshold 0.60 \
--n_epochs 20 \
--optimize_n_epochs 5 \
--save_frequency 10 \
--save_payloads \
--keep_top 10000RORγt|DHODH benchmark task:
python RL_generate.py \
--target_name ROR_gamma DHODH \
--output_dir ./finetune_output_RD \
--model_path ./pretrain_output/fold0_epoch32.pth \
--tokenizer_path ./pretrain_output/tokenizer.pkl \
--n_mol 30000 \
--device cuda \
--batch_size 512 \
--seed 42 \
--threshold 0.7 \
--n_epochs 20 \
--optimize_n_epochs 5 \
--save_frequency 10 \
--save_payloads \
--keep_top 10000--tokenizer_pathis your pre-trained model path--thresholdis the threshold for screening elite molecules--n_epochsis the fine-tuning epochs--optimize_n_epochsis the optimization epochs--n_molis the number of molecules sampled each epoch- Generated results and model weights are saved in
finetune_output_*/ - Multi-GPU users may modify
CUDA_VISIBLE_DEVICES
python generate.py \
--target_name ROR_gamma DHODH \
--output_dir ./generate_output_RD \
--model_path ./finetune_output_RD/epoch_15_finetuned_model.pth \
--tokenizer_path ./pretrain_output/tokenizer.pkl \
--n_mol 10000 \
--device cuda \
--filter \
--batch_size 512 \
--seed 42--target_nameis the benchmark task and can be replaced withGSK3B JNK3--model_pathis your fine-tuned model path--n_molis the number of generated molecules- Generated molecules are saved in
generate_output_*/
- Ensure all paths are correct to avoid file-not-found errors
- GPU significantly speeds up training and generation
- Docking tool: AutoDock Vina or using Vina-GPU speeds up
- Retrosynthesis tool: AiZynthFinder