jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ Diffdock

diffdock

拡散モデルを活用し、タンパク質と薬剤

⏱ RAG構築 1週間 → 1日

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Diffusion-based molecular docking. Predict protein-ligand binding poses from PDB/SMILES, confidence scores, virtual screening, for structure-based drug design. Not for affinity prediction.

🇯🇵 日本人クリエイター向け解説

一言でいうと

拡散モデルを活用し、タンパク質と薬剤

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o diffdock.zip https://jpskill.com/download/4150.zip && unzip -o diffdock.zip && rm diffdock.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4150.zip -OutFile "$d\diffdock.zip"; Expand-Archive "$d\diffdock.zip" -DestinationPath $d -Force; ri "$d\diffdock.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して diffdock.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → diffdock フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-18
同梱ファイル
9

💬 こう話しかけるだけ — サンプルプロンプト

  • Diffdock を使って、最小構成のサンプルコードを示して
  • Diffdock の主な使い方と注意点を教えて
  • Diffdock を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

DiffDock: 拡散モデルによる分子ドッキング

概要

DiffDockは、拡散ベースの深層学習ツールであり、タンパク質ターゲットに対する低分子リガンドの3D結合ポーズを予測する分子ドッキングを行います。これは、構造ベースの創薬やケミカルバイオロジーに不可欠な、計算ドッキングにおける最先端技術です。

主要な機能:

  • 深層学習を用いて、リガンドの結合ポーズを高精度で予測します。
  • タンパク質構造(PDBファイル)または配列(ESMFold経由)をサポートします。
  • 単一の複合体またはバッチ仮想スクリーニングキャンペーンを処理します。
  • 予測の信頼性を評価するための信頼度スコアを生成します。
  • 多様なリガンド入力(SMILES、SDF、MOL2)を扱います。

重要な区別: DiffDockは、結合親和性(ΔG、Kd)ではなく、結合ポーズ(3D構造)と信頼度(予測の確実性)を予測します。親和性評価には、常にスコアリング関数(GNINA、MM/GBSA)と組み合わせて使用してください。

このスキルを使用する場面

このスキルは、次のような場合に使用してください。

  • 「このリガンドをタンパク質にドッキングする」または「結合ポーズを予測する」
  • 「分子ドッキングを実行する」または「タンパク質-リガンドドッキングを行う」
  • 「仮想スクリーニング」または「化合物ライブラリをスクリーニングする」
  • 「この分子はどこに結合しますか?」または「結合部位を予測する」
  • 構造ベースの創薬またはリード最適化タスク
  • PDBファイルとSMILES文字列またはリガンド構造を含むタスク
  • 複数のタンパク質-リガンドペアのバッチドッキング

インストールと環境設定

環境ステータスの確認

DiffDockタスクに進む前に、環境設定を確認してください。

# 提供されているセットアップチェッカーを使用します
python scripts/setup_check.py

このスクリプトは、Pythonのバージョン、CUDA付きPyTorch、PyTorch Geometric、RDKit、ESM、およびその他の依存関係を検証します。

インストールオプション

オプション1: Conda (推奨)

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

オプション2: Docker

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

重要な注意点:

  • GPUを強く推奨します(CPUと比較して10〜100倍の高速化)
  • 初回実行時にSO(2)/SO(3)ルックアップテーブルが事前計算されます(約2〜5分)
  • モデルのチェックポイント(約500MB)は、存在しない場合、自動的にダウンロードされます

コアワークフロー

ワークフロー1: 単一のタンパク質-リガンドドッキング

ユースケース: 1つのリガンドを1つのタンパク質ターゲットにドッキングします。

入力要件:

  • タンパク質: PDBファイル または アミノ酸配列
  • リガンド: SMILES文字列 または 構造ファイル(SDF/MOL2)

コマンド:

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

代替(タンパク質配列):

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

出力構造:

results/single_docking/
├── rank_1.sdf          # 最上位のポーズ
├── rank_2.sdf          # 2番目にランク付けされたポーズ
├── ...
├── rank_10.sdf         # 10番目のポーズ(デフォルト: 10サンプル)
└── confidence_scores.txt

ワークフロー2: 複数の複合体のバッチ処理

ユースケース: 複数のリガンドをタンパク質にドッキングする、仮想スクリーニングキャンペーン

ステップ1: バッチCSVの準備

提供されているスクリプトを使用して、バッチ入力を作成または検証します。

# テンプレートを作成します
python scripts/prepare_batch_csv.py --create --output batch_input.csv

# 既存のCSVを検証します
python scripts/prepare_batch_csv.py my_input.csv --validate

CSV形式:

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,

必須列:

  • complex_name: 一意の識別子
  • protein_path: PDBファイルのパス(配列を使用する場合は空欄)
  • ligand_description: SMILES文字列またはリガンドファイルのパス
  • protein_sequence: アミノ酸配列(PDBを使用する場合は空欄)

ステップ2: バッチドッキングの実行

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

大規模な仮想スクリーニング(100化合物以上)の場合:

処理を高速化するために、タンパク質埋め込みを事前計算します。

# 埋め込みを事前計算します
python datasets/esm_embedding_preparation.py \
  --protein_ligand_csv screening_input.csv \
  --out_file protein_embeddings.pt

# 事前計算された埋め込みで実行します
python -m inference \
  --config default_inference_args.yaml \
  --protein_ligand_csv screening_input.csv \
  --esm_embeddings_path protein_embeddings.pt \
  --out_dir results/screening/

ワークフロー3: 結果の分析

ドッキング完了後、信頼度スコアを分析し、予測をランク付けします。

# すべての結果を分析します
python scripts/analyze_results.py results/batch/

# 複合体ごとに上位5つを表示します
python scripts/analyze_results.py results/batch/ --top 5

# 信頼度閾値でフィルタリングします
python scripts/analyze_results.py results/batch/ --threshold 0.0

# CSVにエクスポートします
python scripts/analyze_results.py results/batch/ --export summary.csv

# すべての複合体で上位20の予測を表示します
python scripts/analyze_results.py results/batch/ --best 20

分析スクリプトは次のことを行います。

  • すべての予測から信頼度スコアを解析します。
  • 高(>0)、中(-1.5〜0)、低(<-1.5)に分類します。
  • 複合体内および複合体間で予測をランク付けします。
  • 統計的要約を生成します。
  • 後続の分析のために結果をCSVにエクスポートします。

信頼度スコアの解釈

スコアの理解:

スコア範囲 信頼度レベル 解釈
> 0 強い予測、おそらく正確
-1.5〜0 妥当な予測、慎重に検証が必要
< -1.5 不確実な予測、検証が必要

重要な注意点:

  1. 信頼度 ≠ 親和性: 高い信頼度は、モデルが確信していることを意味します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

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
  • 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:

python app/main.py
# Navigate to http://localhost:7860

Or use the online demo without installation:

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):

Stärk et al. (2024) "DiffDock-L: Improving Molecular Docking with Diffusion Models"
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

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。