diffdock

davila7/claude-code-templates · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/davila7/claude-code-templates --skill diffdock
0 commentsdiscussion
summary

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.

skill.md

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:

# Use the provided setup checker
python scripts/setup_check.py

This script validates Python version, PyTorch with CUDA, PyTorch Geometric, RDKit, ESM, and other dependencies.

Installation Options

Option 1: Conda (Recommended)

git clone https://github.com/gcorso/DiffDock.git
cd DiffDock
conda env create --file environment.yml
conda activate diffdock

Option 2: Docker

docker pull rbgcsail/diffdock
docker run -it --gpus all --entrypoint /bin/bash rbgcsail/diffdock
micromamba activate diffdock

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

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:

python -m inference \
  --config default_inference_args.yaml \
  --protein_path protein.pdb \
  --ligand "CC(=O)Oc1ccccc1C(=O)O" \
  --out_dir results/single_docking/

Alternative (protein sequence):

python -m inference \
  --config default_inference_args.yaml \
  --protein_sequence "MSKGEELFTGVVPILVELDGDVNGHKF..." \
  --ligand ligand.sdf \
  --out_dir results/sequence_docking/

Output Structure:

results/single_docking/
├── rank_1.sdf          # Top-ranked pose
├── rank_2.sdf          # Second-ranked pose
├── ...
├── rank_10.sdf         # 10th pose (default: 10 samples)
└── confidence_scores.txt

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:

# Create template
python scripts/prepare_batch_csv.py --create --output batch_input.csv

# Validate existing CSV
python scripts/prepare_batch_csv.py my_input.csv --validate

CSV Format:

complex_name,protein_path,ligand_description,protein_sequence
complex1,protein1.pdb,CC(=O)Oc1ccccc1C(=O)O,
complex2,,COc1ccc(C#N)cc1,MSKGEELFT...
complex3,protein3.pdb,ligand3.sdf,

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

python -m inference \
  --config default_inference_args.yaml \
  --protein_ligand_csv batch_input.csv \
  --out_dir results/batch/ \
  --batch_size 10

For Large Virtual Screening (>100 compounds):

Pre-compute protein embeddings for faster processing:

# Pre-compute embeddings
python datasets/esm_embedding_preparation.py \
  --protein_ligand_csv screening_input.csv \
  --out_file protein_embeddings.pt

# Run with pre-computed embeddings
python -m inference \
  --config default_inference_args.yaml \
  --protein_ligand_csv screening_input.csv \
  --esm_embeddings_path protein_embeddings.pt \
  --out_dir results/screening/

Workflow 3: Analyzing Results

After docking completes, analyze confidence scores and rank predictions:

# Analyze all results
python scripts/analyze_results.py results/batch/

# Show top 5 per complex
python scripts/analyze_results.py results/batch/ --top 5

# Filter by confidence threshold
python scripts/analyze_results.py results/batch/ --threshold 0.0

# Export to CSV
python scripts/analyze_results.py results/batch/ --export summary.csv

# Show top 20 predictions across all complexes
python scripts/analyze_results.py results/batch/ --best 20

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:

# Copy template
cp assets/custom_inference_config.yaml my_config.yaml

# Edit parameters (see template for presets)
# Then run with custom config
python -m inference \
  --config my_config.yaml \
  --protein_ligand_csv input.csv \
  --out_dir results/

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:

# Create ensemble CSV
import pandas as pd

conformations = ["conf1.pdb", "conf2.pdb", "conf3.pdb"]
ligand = "CC(=O)Oc1ccccc1C(=O)O"

data = {
    "complex_name": [f"ensemble_{i}" for i in range(len(conformations))],
    "protein_path": conformations,
    "ligand_description": [ligand] * len(conformations),
    "protein_sequence": [""] * len(conformations)
}

pd.DataFrame(data).to_csv("ensemble_input.csv", index=False)

Run docking with increased sampling:

python -m inference \
  --config default_inference_args.yaml \
  --protein_ligand_csv ensemble_input.csv \
  --samples_per_complex 20 \
  --out_dir results/ensemble/

Integration with Scoring Functions

DiffDock generates poses; combine with other tools for affinity:

GNINA (Fast neural network scoring):

for pose in results/*.sdf; do
    gnina -r protein.pdb -l "$pose" --score_only
done

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
  • Solu
how to use diffdock

How to use diffdock on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add diffdock
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/davila7/claude-code-templates --skill diffdock

The skills CLI fetches diffdock from GitHub repository davila7/claude-code-templates and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/diffdock

Reload or restart Cursor to activate diffdock. Access the skill through slash commands (e.g., /diffdock) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.539 reviews
  • Arjun Li· Dec 28, 2024

    Registry listing for diffdock matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Daniel White· Dec 24, 2024

    I recommend diffdock for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Ganesh Mohane· Dec 12, 2024

    Keeps context tight: diffdock is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Amelia Abebe· Dec 4, 2024

    diffdock fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Arjun Perez· Nov 19, 2024

    Useful defaults in diffdock — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Daniel Gill· Nov 15, 2024

    diffdock reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Sakshi Patil· Nov 3, 2024

    diffdock has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Chaitanya Patil· Oct 22, 2024

    Solid pick for teams standardizing on skills: diffdock is focused, and the summary matches what you get after install.

  • Ama Li· Oct 10, 2024

    I recommend diffdock for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Daniel Bansal· Oct 6, 2024

    Registry listing for diffdock matched our evaluation — installs cleanly and behaves as described in the markdown.

showing 1-10 of 39

1 / 4