Home

Awesome

DecompDiff: Diffusion Models with Decomposed Priors for Structure-Based Drug Design

This repository is the official implementation of DecompDiff: Diffusion Models with Decomposed Priors for Structure-Based Drug Design.

Dependencies

Install via Conda and Pip

conda create -n decompdiff python=3.8
conda activate decompdiff
conda install pytorch pytorch-cuda=11.6 -c pytorch -c nvidia
conda install pyg -c pyg
conda install rdkit openbabel tensorboard pyyaml easydict python-lmdb -c conda-forge

# For decomposition
conda install -c conda-forge mdtraj
pip install alphaspace2

# For Vina Docking
pip install meeko==0.1.dev3 scipy pdb2pqr vina==1.2.2 
python -m pip install git+https://github.com/Valdes-Tresanco-MS/AutoDockTools_py3

Preprocess

python scripts/data/preparation/preprocess_subcomplex.py configs/preprocessing/crossdocked.yml

We have provided the processed dataset file here.

Training

To train the model from scratch, you need to download the *.lmdb, *_name2id.pt and split_by_name.pt files and put them in the data directory. Then, you can run the following command:

python scripts/train_diffusion_decomp.py configs/training.yml

Sampling

To sample molecules given protein pockets in the test set, you need to download test_index.pkl and test_set.zip files, unzip it and put them in the data directory. Then, you can run the following command:

python scripts/sample_diffusion_decomp.py configs/sampling_drift.yml  \
  --outdir $SAMPLE_OUT_DIR -i $DATA_ID --prior_mode {ref_prior, beta_prior}

We have provided the trained model checkpoint here.

If you want to sample molecules with beta priors, you also need to download files in this directory.

Evaluation

python scripts/evaluate_mol_from_meta_full.py $SAMPLE_OUT_DIR \
  --docking_mode {none, vina_score, vina_full} \
  --aggregate_meta True --result_path $EVAL_OUT_DIR

Results

BondliGANGraphBPARPocket2MolTargetDiffOurs
C-C0.6010.3680.6090.4960.3690.359
C=C0.6650.5300.6200.5610.5050.537
C-N0.6340.4560.4740.4160.3630.344
C=N0.7490.6930.6350.6290.5500.584
C-O0.6560.4670.4920.4540.4210.376
C=O0.6610.4710.5580.5160.4610.374
C:C0.4970.4070.4510.4160.2630.251
C:N0.6380.6890.5520.4870.2350.269
AngleliGANGraphBPARPocket2MolTargetDiffOurs
CCC0.5980.4240.3400.3230.3280.314
CCO0.6370.3540.4420.4010.3850.324
CNC0.6040.4690.4190.2370.3670.297
OPO0.5120.6840.3670.2740.3030.217
NCC0.6210.3720.3920.3510.3540.294
CC=O0.6360.3770.4760.3530.3560.259
COC0.6060.4820.4590.3170.3890.339
MethodsVina Score (↓)Vina Min (↓)Vina Dock (↓)High Affinity (↑)QED (↑)SA (↑)Success Rate (↑)
Reference-6.46-6.49-7.26-0.470.7425.0%
liGAN---6.2011.1%0.390.573.9%
GraphBP---4.706.7%0.450.480.1%
AR-5.64-5.88-6.6231.0%0.500.637.1%
Pocket2Mol-4.70-5.82-6.7951.0%0.570.7524.4%
TargetDiff-6.30-6.83-7.9159.1%0.480.5810.5%
Ours-6.04-7.09-8.4371.0%0.430.6024.5%

Security

If you discover a potential security issue in this project, or think you may have discovered a security issue, we ask that you notify Bytedance Security via our security center or vulnerability reporting email.

Please do not create a public GitHub issue.

License

This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International Public License.