# Diffdock

> Skill for protein-ligand docking with DiffDock, a diffusion model that generates 3D binding poses from protein structure and ligand SMILES. Use this skill when a user wants to dock a small molecule to a protein, predict binding poses, run blind docking (no pocket specification required), or process batches of protein-ligand complexes. Also trigger when the user mentions DiffDock, molecular dockin…

- **Type:** Skill
- **Install:** `agentstack add skill-naity-fm4life-diffdock`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [naity](https://agentstack.voostack.com/s/naity)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [naity](https://github.com/naity)
- **Source:** https://github.com/naity/FM4Life/tree/main/skills/diffdock

## Install

```sh
agentstack add skill-naity-fm4life-diffdock
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# DiffDock: Diffusion-Based Molecular Docking

## Overview

DiffDock predicts 3D protein-ligand binding poses using a diffusion model. Given a protein structure and a ligand SMILES string, it generates multiple candidate poses ranked by a confidence score.

**Key properties:**
- **Blind docking** — no binding site specification required; searches entire protein surface
- **Diffusion model** — generates diverse poses via iterative denoising (score-based diffusion)
- **SE(3)-equivariant** — architecture respects 3D symmetry (rotations, translations)
- **Confidence model** — separate network ranks poses by predicted accuracy (not binding affinity)
- **Current default:** DiffDock-L (ICLR 2024) — improved generalization over original (ICLR 2023)

**Important distinction:** The confidence score predicts *pose quality* (RMSD to true binding pose), not *binding affinity*. High confidence ≠ strong binder.

## Installation

DiffDock requires a conda environment — no pip-only install available:

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

Or with Docker (includes GPU support):

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

Key dependencies: PyTorch 1.13 + CUDA 11.7, torch-geometric 2.2, e3nn 0.5.1, RDKit, fair-esm (ESM-2 for protein embeddings), pytorch-lightning.

**First run:** precomputes SO(2)/SO(3) distribution caches (~2 min). Not repeated.

## Core Usage

### Single complex

```bash
cd DiffDock
python -m inference \
  --config default_inference_args.yaml \
  --protein_path protein.pdb \
  --ligand_description "COc(cc1)ccc1C#N" \
  --out_dir results/my_docking
```

### From protein sequence (ESMFold folds it automatically)

```bash
python -m inference \
  --config default_inference_args.yaml \
  --protein_sequence "MVHLTPEEKSAVTALWGKVNVDEVGGEALGRLLVVYPWTQRFFESFGDLSTPDAVMGNPKVKAHGKKVLGAFSDGLAHLDNLKGTFATLSELHCDKLHVDPENFRLLGNVLVCVLAHHFGKEFTPPVQAAYQKVVAGVANALAHKYH" \
  --ligand_description "CC(=O)Nc1ccc(O)cc1" \
  --out_dir results/my_docking
```

### Batch processing (CSV input)

```bash
python -m inference \
  --config default_inference_args.yaml \
  --protein_ligand_csv complexes.csv \
  --out_dir results/batch
```

CSV format (`complexes.csv`):

```csv
complex_name,protein_path,ligand_description,protein_sequence
complex_A,proteins/target_A.pdb,CC(=O)Nc1ccc(O)cc1,
complex_B,proteins/target_B.pdb,data/ligand_B.sdf,
complex_C,,COc1ccc(C#N)cc1,MVHLTPEEKSAVTALWG...
```

### Ligand from SDF file

```bash
python -m inference \
  --config default_inference_args.yaml \
  --protein_path protein.pdb \
  --ligand_description ligand.sdf \
  --out_dir results/my_docking
```

## Key Parameters

| Parameter | Default | Description |
|---|---|---|
| `--samples_per_complex` | 10 | Poses to generate per complex |
| `--inference_steps` | 20 | Denoising steps (fewer = faster, less refined) |
| `--batch_size` | 10 | Parallel complexes (reduce if OOM) |
| `--no_final_step_noise` | True | No noise in final step (better quality) |
| `--save_visualisation` | False | Save reverse-diffusion trajectory PDB |

**Speed vs quality:**

| Mode | `--inference_steps` | `--samples_per_complex` | `--batch_size` |
|---|---|---|---|
| Fast screening | 5 | 5 | 20 |
| Default | 20 | 10 | 10 |
| High quality | 40 | 20 | 5 |

GPU: ~2–5 sec/pose. CPU: ~30–60 sec/pose.

## Output Format

```
results/my_docking/
└── complex_0/
    ├── rank1_confidence0.43.sdf     ← best pose, high confidence
    ├── rank2_confidence-0.12.sdf    ← 2nd best, moderate
    ├── rank3_confidence-1.23.sdf    ← 3rd, low confidence
    └── ...                          ← up to samples_per_complex
```

- Files are **SDF format** — open directly in PyMOL, ChimeraX, or RDKit
- **Ranked** by confidence score (rank1 = highest)
- Confidence score is in the filename: `rank{N}_confidence{score}.sdf`

## Confidence Score Interpretation

| Score | Confidence | Meaning |
|---|---|---|
| `> 0` | High | Model is confident the pose is accurate |
| `-1.5` to `0` | Moderate | Plausible but uncertain |
| `1000 residues)
- **Validate setup** — first run on a known PDB complex with its co-crystal ligand; check RMSD

## Scripts

- `scripts/dock.py` — wrapper that runs DiffDock and parses results; see `scripts/dock.py --help`

## Resources

- **GitHub:** https://github.com/gcorso/DiffDock
- **DiffDock (original):** Corso et al., ICLR 2023 — https://arxiv.org/abs/2210.01776
- **DiffDock-L:** Corso et al., ICLR 2024 — https://arxiv.org/abs/2402.18396

## References

- `references/cli-reference.md` — full CLI parameter reference, output format details, confidence model, batch CSV format, DiffDock-L vs original

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [naity](https://github.com/naity)
- **Source:** [naity/FM4Life](https://github.com/naity/FM4Life)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-naity-fm4life-diffdock
- Seller: https://agentstack.voostack.com/s/naity
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
