Skip to content

Repository files navigation

🎯 PolyPharm

PolyPharm is a deep learning-based framework for multi-target drug design, capable of generating molecules with potential activities against multiple targets.

1️⃣ Directory Structure & Key Files

/                         ← 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

2️⃣ Results

✅ 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.

3️⃣ Quick Start

3.1 📥 Clone Repository & Download Dataset

git clone https://github.com/Yozu-Roo/POLYGEN.git

After download, extract and place the data/ folder at the root directory.


3.2 ⚙️ Install Conda Environment

Recommended Python 3.8:

conda env create -f environment.yml
conda activate polygen

3.3 🏋️‍♂️ Pre-training

python train_chembl_baseline.py
  • For multiple GPUs, adjust CUDA_VISIBLE_DEVICES in the script
  • Model weights are saved in pretrain_output/ during training

3.4 🔧 Fine-tuning

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 10000

RORγ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_path is your pre-trained model path
  • --threshold is the threshold for screening elite molecules
  • --n_epochs is the fine-tuning epochs
  • --optimize_n_epochs is the optimization epochs
  • --n_mol is 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

3.5 🧪 Molecule Generation

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_name is the benchmark task and can be replaced with GSK3B JNK3
  • --model_path is your fine-tuned model path
  • --n_mol is the number of generated molecules
  • Generated molecules are saved in generate_output_*/

4️⃣ Tips🌟

  • 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

About

PolyPharm: A deep learning-based framework for multi-target drug design

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages