Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Diffusion-based docking that predicts protein-ligand poses without a predefined site. Use for blind docking, when traditional docking fails, or exploring multiple binding modes. Pipeline: prep protein (PDB) and ligand (SMILES/SDF), run inference, analyze confidence-ranked poses.
.claude/skills/jaechang-hits-diffdock/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 255% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 243% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 187% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 97% | 0% |
| case-03 | ✓→✗ | ▼ Worse | 95% | 0% |
DiffDock uses a diffusion generative model to predict protein-ligand binding poses directly from protein structure and ligand SMILES, treating docking as a generative rather than a search problem. Unlike traditional docking tools (AutoDock Vina, Glide), DiffDock does not require a predefined binding site — it samples poses across the full protein surface. It outputs a ranked set of binding poses with associated confidence scores. DiffDock excels at blind docking tasks and produces diverse pose hypotheses, making it valuable for de novo binding site discovery and challenging targets.
diffdock (conda install recommended), rdkit, torch, biopython, nglview (visualization)bash# Recommended: clone and install from source git clone https://github.com/gcorso/DiffDock.git cd DiffDock conda create -n diffdock python=3.9 conda activate diffdock pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu118 pip install -r requirements.txt # Download pretrained model weights python -c "from utils.download import download_pretrained; download_pretrained()"
pythonfrom Bio import PDB from Bio.PDB import PDBParser, PDBIO, Select class NonHetSelect(Select): """Remove HETATM records (ligands, water) — keep only protein atoms.""" def accept_residue(self, residue): return residue.id[0] == " " def clean_pdb(input_pdb: str, output_pdb: str): parser = PDBParser(QUIET=True) structure = parser.get_structure("protein", input_pdb) io = PDBIO() io.set_structure(structure) io.save(output_pdb, NonHetSelect()) print(f"Cleaned PDB saved to: {output_pdb}") clean_pdb("raw_protein.pdb", "protein_clean.pdb")
pythonfrom rdkit import Chem from rdkit.Chem import AllChem, SDWriter def smiles_to_sdf(smiles: str, output_sdf: str, n_confs: int = 1): """Convert SMILES to 3D SDF for DiffDock input.""" mol = Chem.MolFromSmiles(smiles) mol = Chem.AddHs(mol) AllChem.EmbedMolecule(mol, AllChem.ETKDGv3()) AllChem.MMFFOptimizeMolecule(mol) writer = SDWriter(output_sdf) writer.write(mol) writer.close() print(f"Ligand SDF written to: {output_sdf}") return mol # Example: ibuprofen smiles = "CC(C)Cc1ccc(cc1)C(C)C(=O)O" mol = smiles_to_sdf(smiles, "ligand.sdf") print(f"Ligand formula: {Chem.rdMolDescriptors.CalcMolFormula(mol)}")
bash# Command-line inference (run from the DiffDock directory) python inference.py \ --protein_path protein_clean.pdb \ --ligand "CC(C)Cc1ccc(cc1)C(C)C(=O)O" \ --out_dir results/ \ --inference_steps 20 \ --samples_per_complex 40 \ --batch_size 10 \ --no_final_step_noise
pythonimport subprocess def run_diffdock(protein_pdb: str, ligand_smiles: str, out_dir: str, n_samples: int = 40, n_steps: int = 20): cmd = [ "python", "inference.py", "--protein_path", protein_pdb, "--ligand", ligand_smiles, "--out_dir", out_dir, "--inference_steps", str(n_steps), "--samples_per_complex", str(n_samples), "--batch_size", "10", "--no_final_step_noise", ] result = subprocess.run(cmd, capture_output=True, text=True, cwd="DiffDock/") if result.returncode == 0: print(f"DiffDock complete. Results in: {out_dir}") else: print(f"Error: {result.stderr}") return result run_diffdock("protein_clean.pdb", "CC(C)Cc1ccc(cc1)C(C)C(=O)O", "results/")
pythonimport re from pathlib import Path import pandas as pd def parse_diffdock_results(out_dir: str) -> pd.DataFrame: """Parse DiffDock output SDF files and confidence scores.""" out_path = Path(out_dir) records = [] # DiffDock names output files: rank{N}_confidence{score}.sdf for sdf_file in sorted(out_path.glob("rank*_confidence*.sdf")): name = sdf_file.stem # Extract rank and confidence from filename rank_match = re.search(r"rank(\d+)", name) conf_match = re.search(r"confidence(-?[\d.]+)", name) if rank_match and conf_match: records.append({ "rank": int(rank_match.group(1)), "confidence": float(conf_match.group(1)), "sdf_file": str(sdf_file), }) df = pd.DataFrame(records).sort_values("rank") print(f"Found {len(df)} poses") print(df[["rank", "confidence", "sdf_file"]].head(10)) return df df_results = parse_diffdock_results("results/")
pythonfrom rdkit import Chem from rdkit.Chem import AllChem from Bio.PDB import PDBParser import numpy as np def get_binding_residues(protein_pdb: str, ligand_sdf: str, cutoff_angstrom: float = 4.0): """Find protein residues within cutoff distance of the top-ranked ligand pose.""" parser = PDBParser(QUIET=True) structure = parser.get_structure("prot", protein_pdb) prot_atoms = [(atom.get_coord(), residue.resname, residue.id[1]) for chain in structure for residue in chain for atom in residue.get_atoms()] mol = Chem.SDMolSupplier(ligand_sdf, removeHs=False)[0] lig_coords = mol.GetConformer().GetPositions() contacts = [] for prot_coord, resname, resnum in prot_atoms: dists = np.linalg.norm(lig_coords - prot_coord, axis=1) if dists.min() <= cutoff_angstrom: contacts.append((resnum, resname)) contacts = sorted(set(contacts)) print(f"Binding site residues within {cutoff_angstrom} A: {contacts[:10]}") return contacts # Use top-ranked pose top_sdf = df_results.loc[df_results.rank == 1, "sdf_file"].iloc[0] contacts = get_binding_residues("protein_clean.pdb", top_sdf)
pythonimport nglview as nv from rdkit import Chem # Load protein + top pose in Jupyter notebook view = nv.NGLWidget() view.add_pdbfile("protein_clean.pdb") top_sdf = df_results.loc[df_results.rank == 1, "sdf_file"].iloc[0] view.add_component(top_sdf) view.representations = [ {"type": "cartoon", "params": {"color": "chainindex"}}, {"type": "ball+stick", "params": {"sele": "ligand"}}, ] print(f"Visualizing top pose: confidence={df_results.confidence.iloc[0]:.3f}") view
| Parameter | Default | Range / Options | Effect | |-----------|---------|-----------------|--------| | --inference_steps | 20 | 10–40 | Number of diffusion reverse steps; more steps = slower but more accurate | | --samples_per_complex | 40 | 10–100 | Number of poses sampled; more = better coverage of binding modes | | --batch_size | 10 | 1–32 | GPU batch size; reduce if OOM error | | --no_final_step_noise | off | flag | Removes noise at last diffusion step; improves pose quality | | --actual_steps | equals inference_steps | 1–inference_steps | Steps to actually run (can be fewer than total) | | --save_visualisation | off | flag | Also saves PDB visualization files alongside SDF | | cutoff_angstrom | 4.0 | 3.0–6.0 Å | Distance cutoff for defining binding site residues |
When to use: Dock a library of analogs to the same protein for SAR analysis.
pythonimport pandas as pd import subprocess smiles_list = [ ("compound_1", "CC(C)Cc1ccc(cc1)C(C)C(=O)O"), ("compound_2", "CC(C)Cc1ccc(cc1)C(C)C(=O)N"), ("compound_3", "CC(C)Cc1ccc(cc1)C(C)C(=O)OC"), ] results = [] for name, smiles in smiles_list: out = f"results/{name}" cmd = ["python", "inference.py", "--protein_path", "protein_clean.pdb", "--ligand", smiles, "--out_dir", out, "--inference_steps", "20", "--samples_per_complex", "20"] subprocess.run(cmd, cwd="DiffDock/", capture_output=True) # Parse top confidence score df_r = parse_diffdock_results(out) if not df_r.empty: top_conf = df_r.loc[df_r.rank == 1, "confidence"].iloc[0] results.append({"name": name, "smiles": smiles, "top_confidence": top_conf}) df_batch = pd.DataFrame(results).sort_values("top_confidence", ascending=False) df_batch.to_csv("batch_docking_results.csv", index=False) print(df_batch)
When to use: Keep only high-confidence poses for further analysis or visualization.
python# Confidence > 0 generally indicates a plausible binding pose # DiffDock confidence scores: higher = more confident; ~0 is marginal; < -1 is poor high_conf = df_results[df_results["confidence"] > 0.0] print(f"High-confidence poses: {len(high_conf)} / {len(df_results)}") print(high_conf[["rank", "confidence", "sdf_file"]])
When to use: Rescore DiffDock poses with AutoDock Vina's energy function.
bash# Convert SDF to PDBQT using OpenBabel obabel rank1_confidence0.75.sdf -O rank1_ligand.pdbqt obabel protein_clean.pdb -O protein.pdbqt -xr # Rescore (no docking search, just energy evaluation) vina --receptor protein.pdbqt --ligand rank1_ligand.pdbqt \ --score_only --out rank1_rescored.pdbqt
results/rank{N}_confidence{score}.sdf — 3D ligand poses ranked by confidence scoredf_results DataFrame with rank, confidence score, and file path per pose| Problem | Cause | Solution | |---------|-------|----------| | CUDA out of memory | Batch size too large for GPU | Reduce --batch_size to 4 or 2 | | Empty results directory | Protein PDB parsing failed | Ensure PDB contains only ATOM records; remove HETATM with clean_pdb() | | All confidence scores < -2 | Ligand or protein format issue | Validate SMILES with RDKit; ensure protein is protonated and complete | | Very slow inference (>30 min) | Running on CPU | GPU is strongly recommended; CUDA environment must be correctly configured | | ModuleNotFoundError: e3nn | Dependency not installed | pip install e3nn in the DiffDock conda environment | | Poses cluster at one site | Low --samples_per_complex | Increase to 40–100 for better site coverage | | Protein missing residues | Incomplete crystal structure | Use MODELLER or Swiss-Model to fill gaps before docking |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 45,872 | 20,549 | -55% | 1 | 1 | 0% | 1,847 | 6,566 | +255% | 0 | 0 | — |
case-02 | fail→pass | 20,432 | 5,393 | -74% | 1 | 1 | 0% | 1,317 | 4,516 | +243% | 0 | 0 | — |
case-03 | pass→fail | 16,907 | 11,181 | -34% | 1 | 1 | 0% | 2,850 | 5,550 | +95% | 0 | 0 | — |
case-04 | pass→pass | 13,132 | 6,699 | -49% | 1 | 1 | 0% | 2,047 | 4,719 | +131% | 0 | 0 | — |
case-05 | pass→pass | 10,672 | 8,556 | -20% | 1 | 1 | 0% | 1,975 | 5,342 | +170% | 0 | 0 | — |
case-06 | pass→pass | 14,277 | 14,250 | -0% | 1 | 1 | 0% | 2,544 | 6,302 | +148% | 0 | 0 | — |
case-07 | pass→pass | 11,008 | 7,104 | -35% | 1 | 1 | 0% | 1,703 | 4,671 | +174% | 0 | 0 | — |
case-08 | pass→pass | 13,447 | 9,287 | -31% | 1 | 1 | 0% | 2,145 | 5,389 | +151% | 0 | 0 | — |
case-09 | pass→pass | 4,888 | 4,582 | -6% | 1 | 1 | 0% | 761 | 4,413 | +480% | 0 | 0 | — |
case-10 | pass→pass | 14,066 | 14,787 | +5% | 1 | 1 | 0% | 2,265 | 6,048 | +167% | 0 | 0 | — |
case-16 | pass→pass | 17,883 | 17,557 | -2% | 1 | 1 | 0% | 2,619 | 6,332 | +142% | 0 | 0 | — |
case-11 | fail→pass | 9,605 | 3,863 | -60% | 1 | 1 | 0% | 1,492 | 4,286 | +187% | 0 | 0 | — |
case-12 | pass→pass | 26,653 | 3,359 | -87% | 1 | 1 | 0% | 2,108 | 4,191 | +99% | 0 | 0 | — |
case-13 | pass→pass | 16,296 | 22,792 | +40% | 1 | 1 | 0% | 2,412 | 5,802 | +141% | 0 | 0 | — |
case-14 | pass→pass | 14,217 | 11,351 | -20% | 1 | 1 | 0% | 2,349 | 5,636 | +140% | 0 | 0 | — |
case-15 | pass→pass | 15,124 | 10,961 | -28% | 1 | 1 | 0% | 2,367 | 5,583 | +136% | 0 | 0 | — |
case-17 | pass→pass | 8,127 | 3,695 | -55% | 1 | 1 | 0% | 1,347 | 4,285 | +218% | 0 | 0 | — |
case-18 | pass→pass | 12,557 | 6,721 | -46% | 1 | 1 | 0% | 1,992 | 4,810 | +141% | 0 | 0 | — |
case-19 | fail→pass | 13,344 | 5,471 | -59% | 1 | 1 | 0% | 2,276 | 4,475 | +97% | 0 | 0 | — |
case-20 | pass→pass | 23,738 | 18,879 | -20% | 1 | 1 | 0% | 4,279 | 7,439 | +74% | 0 | 0 | — |
case-21 | pass→pass | 10,490 | 12,210 | +16% | 1 | 1 | 0% | 2,075 | 5,874 | +183% | 0 | 0 | — |
case-22 | pass→pass | 16,691 | 21,459 | +29% | 1 | 1 | 0% | 2,740 | 6,862 | +150% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 20 counted toward the lift figure. The other 2 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +14 percentage points is the difference between those two pass rates over the 20 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.