diffdock
DiffDock and DiffDock-L molecular docking. Use for protein-small-molecule pose prediction from PDB or sequence plus SMILES/SDF/MOL2, batch docking, virtual screening, and pose-confidence interpretation. Not for binding affinity prediction.
By k-dense-ai · 1,400 installs
npx skills add k-dense-ai/scientific-agent-skills --skill diffdock
Source repository · Upstream listing
DiffDock: Molecular Docking with Diffusion Models
Overview
DiffDock is a diffusion based deep learning tool for molecular docking that predicts 3D binding poses of small molecule ligands to protein targets. It represents the state of the art in computational docking, crucial for structure based drug discovery and chemical biology.
Core Capabilities:
Predict ligand binding poses with high accuracy using deep learning
Support protein structures (PDB files) or sequences (via ESMFold)
Process single complexes or batch virtual screening campaigns
Generate confidence scores to assess prediction reliability
Handle diverse ligand inputs (SMILES, SDF, MOL2)
Key Distinction: DiffDock predicts binding poses (3D structure) and confidence (prediction certainty), NOT binding affinity (ΔG, Kd). Always combine with scoring functions (GNINA, MM/GBSA) for affinity assessment.
When to Use This Skill
This skill should be used when:
"Dock this ligand to a protein" or "predict binding pose"
"Run molecular docking" or "perform protein ligand docking"
"Virtual screening" or "screen compound library"
"Where does this molecule bind?" or "predict binding site"
Structure based drug design or lead optimization tasks
Tasks involving PDB files + SMILES strings or ligand structures
Batch docking of multiple protein ligand pairs
Installation and Environment Setup
Check Environment Status
Before proceeding with DiffDock tasks, verify the environment setup:
This script validates Python version, PyTorch with CUDA, PyTorch Geometric, RDKit, ESM, and other dependencies.
Installation Options
Option 1: Conda (Recommended)
Option 2: Docker
Important Notes:
GPU strongly recommended (10 100x speedup vs CPU)
First run pre computes SO(2)/SO(3) lookup tables (~2 5 minutes)
Model checkpoints (~500MB) download automatically if not present
Current upstream release is DiffDock v1.1.3; DiffDock L is the default model line in default inference args.yaml
Core Workflows
Workflow 1: Single Protein Ligand Docking
Use Case: Dock one ligand to one protein target
Input Requirements:
Protein: PDB file OR amino acid sequence
Ligand: SMILES string OR structure file (SDF/MOL2)
Command:
Alternative (protein sequence):
Output Structure:
Current inference.py registers ligand description for single complex runs. Some upstream README text still says ligand ; use ligand description unless your local checkout explicitly supports a ligand alias.
Workflow 2: Batch Processing Multiple Complexes
Use Case: Dock multiple ligands to proteins, virtual screening campaigns
Step 1: Prepare Batch CSV
Use the provided script to create or validate batch input:
CSV Format:
Required Columns:
complex name : Unique identifier
protein path : PDB file path (leave empty if using sequence)
ligand description : SMILES string or ligand file path
protein sequence : Amino acid sequence (leave empty if using PDB)
Step 2: Run Batch Docking
For Large Virtual Screening ( 100 compounds):
Pre compute protein embeddings for faster processing:
Workflow 3: Analyzing Results
After docking completes, analyze confidence scores and rank predictions:
The analysis script:
Parses confidence scores from all predictions
Classifies as High ( 0), Moderate ( 1.5 to 0), or Low (< 1.5)
Ranks predictions within and across complexes
Generates statistical summaries
Exports results to CSV for downstream analysis
Confidence Score Interpretation
Understanding Scores:
Score Range Confidence Level Interpretation
0 High Strong prediction, likely accurate
1.5 to 0 Moderate Reasonable prediction, validate carefully
< 1.5 Low Uncertain prediction, requires validation
Critical Notes:
1. Confidence ≠ Affinity : High confidence means model certainty about structure, NOT strong binding
2. Context Matters : Adjust expectations for:
Large ligands ( 500 Da): Lower confidence expected
Multiple protein chains: May decrease confidence
Novel protein families: May underperform
3. Multiple Samples : Review top 3 5 predictions, look for consensus
For detailed guidance: Read references/confidence and limitations.md using the Read tool
Parameter Customization
Using Custom Configuration
Create custom configuration for specific use cases:
Key Parameters to Adjust
Sampling Density:
samples per complex: 10 → Increase to 20 40 for difficult cases
More samples = better coverage but longer runtime
Inference Steps:
inference steps: 20 → Increase to 25 30 for higher accuracy
More steps = potentially better quality but slower
Temperature Parameters (control diversity):
temp sampling tor: 7.04 → Increase for flexible ligands (8 10)
temp sampling tor: 7.04 → Decrease for rigid ligands (5 6)
Higher temperature = more diverse poses
Presets Available in Template:
1. High Accuracy: More samples + steps, lower temperature
2. Fast Screening: Fewer samples, faster
3. Flexible Ligands: Increased torsion temperature
4. Rigid Ligands: Decreased torsion temperature
For complete parameter reference: Read references/parameters reference.md using the Read tool
Advanced Techniques
Ensemble Docking (Protein Flexibility)
For proteins with known flexibility, dock to multiple conformations:
Run docking with increased sampling:
Integration with Scoring Functions
DiffDock generates poses; combine with other tools for affinity:
GNINA (Fast neural network scoring):
MM/GBSA (More accurate, slower):
Use AmberTools MMPBSA.py or gmx MMPBSA after energy minimization
Free Energy Calculations (Most accurate):
Use OpenMM + OpenFE or GROMACS for FEP/TI calculations
Recommended Workflow:
1. DiffDock → Generate poses with confidence scores
2. Visual inspection → Check structural plausibility
3. GNINA or MM/GBSA → Rescore and rank by affinity
4. Experimental validation → Biochemical assays
Limitations and Scope
DiffDock IS Designed For:
Small molecule ligands (typically 100 1000 Da)
Drug like organic compounds
Small peptides (<20 residues)
Single or multi chain proteins
DiffDock IS NOT Designed For:
Large biomolecules (protein protein docking) → Use DiffDock PP or AlphaFold Multimer
Large peptides ( 20 residues) → Use alternative methods
Covalent docking → Use specialized covalent docking tools
Binding affinity prediction → Combine with scoring functions
Membrane proteins → Not specifically trained, use with caution
For complete limitations: Read references/confidence and limitations.md using the Read tool
Troubleshooting
Common Issues
Issue: Low confidence scores across all predictions
Cause: Large/unusual ligands, unclear binding site, protein flexibility
Solution: Increase samples per complex (20 40), try ensemble docking, validate protein structure
Issue: Out of memory errors
Cause: GPU memory insufficient for batch size
Solution: Reduce batch size 2 or process fewer complexes at once
Issue: Slow performance
Cause: Running on CPU instead of GPU
Solution: Verify CUDA with python c "import torch; print(torch.cuda.is available())" , use GPU
Issue: Unrealistic binding poses
Cause: Poor protein preparation, ligand too large, wrong binding site
Solution: Check protein for missing residues, remove far waters, consider specifying binding site
Issue: "Module not found" errors
Cause: Missing dependencies or wrong environment
Solution: Run python scripts/setup check.py to diagnose
Performance Optimization
For Best Results:
1. Use GPU (essential for practical use)
2. Pre compute ESM embeddings for repeated protein use
3. Batch process multiple complexes together
4. Start with default parameters, then tune if needed
5. Validate protein structures (resolve missing residues)
6. Use canonical SMILES for ligands
Graphical User Interface
For interactive use, launch the web interface:
Or use the online demo without installation:
https://huggingface.co/spaces/reginabarzilaygroup/DiffDock Web
Resources
Helper Scripts ( scripts/ )
prepare batch csv.py : Create and validate batch input CSV files
Create templates with example entries
Validate file paths and SMILES strings
Check for required columns and format issues
analyze results.py : Analyze confidence scores and rank predictions
Parse results from single or batch runs
Generate statistical summaries
Export to CSV for downstream analysis
Identify top predictions across complexes
setup check.py : Verify DiffDock environment setup
Check Python version and dependencies
Verify PyTorch and CUDA availability
Test RDKit and PyTorch Geometric installation
Provide installation instructions if needed
Reference Documentation ( references/ )
parameters reference.md : Complete parameter documentation
All command line options and configuration parameters
Default values and acceptable ranges
Temperature parameters for controlling diversity
Model checkpoint locations and version flags
Read this file when users need:
Detailed parameter explanations
Fine tuning guidance for specific systems
Alternative sampling strategies
confidence and limitations.md : Confidence score interpretation and tool limitations
Detailed confidence score interpretation
When to trust predictions
Scope and limitations of DiffDock
Integration with complementary tools
Troubleshooting prediction quality
Read this file when users need:
Help interpreting confidence scores
Understanding when NOT to use DiffDock
Guidance on combining with other tools
Validation strategies
workflows examples.md : Comprehensive workflow examples
Detailed installation instructions
Step by step examples for all workflows
Advanced integration patterns
Troubleshooting common issues
Best practices and optimization tips
Read this file when users need:
Complete workflow examples with code
Integration with GNINA, OpenMM, or other tools
Virtual screening workflows
Ensemble docking procedures
Assets ( assets/ )
batch template.csv : Template for batch processing
Pre formatted CSV with required columns
Example entries showing different input types
Ready to customize with actual data
custom inference config.yaml : Configuration template
Annotated YAML with all parameters
Four preset configurations for common use cases
Detailed comments explaining each parameter
Ready to customize and use
Best Practices
1. Always verify environment with setup check.py before starting large jobs
2. Validate batch CSVs with prepare batch csv.py to catch errors early
3. Start with defaults then tune parameters based on system specific needs
4. Generate multiple samples (10 40) for robust predictions
5. Visual inspection of top poses before downstream analysis
6. Combine with scoring functions for affinity assessment
7. Use confidence scores for initial ranking, not final decisions
8. Pre compute embeddings for virtual screening campaigns
9. Document parameters used for reproducibility
10. Validate results experimentally when possible
Citations
When using DiffDock, cite the appropriate papers:
DiffDock L (current default model): Corso et al. (2024) "Deep Confident Steps to New Pockets: Strategies for Docking Generalization", ICLR 2024, arXiv:2402.18396
Original DiffDock: Corso et al. (2023) "DiffDock: Diffusion Steps, Twists, and Turns for Molecular Docking", ICLR 2023, arXiv:2210.01776
Additional Resources
GitHub Repository : https://github.com/gcorso/DiffDock
Online Demo : https://huggingface.co/spaces/reginabarzilaygroup/DiffDock Web
DiffDock L Paper : https://arxiv.org/abs/2402.18396
Original Paper : https://arxiv.org/abs/2210.01776
Citing Scientific Agent Skills
This skill is part of Scientific Agent Skills by K Dense