Communitygithub.com

diffdock

DiffDock および DiffDock-L を用いた分子ドッキング。PDBファイルや配列から、SMILES/SDF/MOL2を入力としてタンパク質-低分子のポーズ予測、バッチドッキング、バーチャルスクリーニング、ポーズ信頼度の解釈を行います。結合親和性の予測は対象外です。

diffdock とは?

DiffDockは、拡散モデルを活用した深層学習ベースの分子ドッキングツールで、タンパク質標的に対する低分子リガンドの3次元結合ポーズを高精度に予測します。構造ベースの創薬やケミカルバイオロジーにおいて最先端の性能を発揮します。このスキルは、単一のタンパク質-リガンド複合体のドッキングから、化合物ライブラリを用いた大規模バーチャルスクリーニングまでをサポートし、PDBファイルまたはアミノ酸配列(ESMFold経由)からタンパク質構造を扱い、SMILES、SDF、MOL2形式のリガンド入力に対応します。また、予測の信頼性を評価するための信頼度スコアを生成し、分析スクリプトやWeb UIも提供します。なお、DiffDockは結合ポーズとその信頼度を予測するものであり、結合親和性(ΔG、Kd)を予測するものではないため、親和性評価には別のスコアリング関数(GNINA、MM/GBSAなど)を併用する必要があります。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/diffdock

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

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

概要

DiffDockは、拡散ベースの深層学習ツールであり、小さな分子リガンドのタンパク質標的への3次元結合ポーズを予測する分子ドッキングを行います。構造ベースの創薬やケミカルバイオロジーにおいて重要な、計算ドッキングの最先端技術です。

コア機能:

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

重要な区別: DiffDockは結合ポーズ(3D構造)と信頼度(予測の確実性)を予測し、結合親和性(ΔG、Kd)は予測しません。親和性評価には、常にスコアリング関数(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)は、存在しない場合に自動ダウンロード
  • 現在の上流リリースはDiffDock v1.1.3です。DiffDock-Lが default_inference_args.yaml のデフォルトモデルラインです。

コアワークフロー

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

ユースケース: 1つのリガンドを1つのタンパク質標的にドッキング

入力要件:

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

コマンド:

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

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

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

出力構造:

results/single_docking/
└── complex_0/
    ├── rank1.sdf                    # トップランクポーズのコピー(便宜用)
    ├── rank1_confidence0.87.sdf     # ファイル名に信頼度が含まれるトップランクポーズ
    ├── rank2_confidence0.42.sdf     # 2番目のポーズ
    ├── ...
    └── rank10_confidence-1.23.sdf   # 10番目のポーズ(デフォルト: 10サンプル)

現在の inference.py では、単一複合体実行時に --ligand_description を登録しています。一部のアップストリームREADMEではまだ --ligand と記載されていますが、ローカルのチェックアウトで明示的に --ligand エイリアスがサポートされていない限り、--ligand_description を使用してください。

ワークフロー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. 信頼度 ≠ 親和性: 高い信頼度はモデルの確実性を示すものであり、強い結合を意味するものではありません
  2. 文脈が重要: 以下の場合、期待値を調整してください:
    • 大きなリガンド(>500 Da): 低い信頼度が予想されます
    • 複数のタンパク質鎖: 信頼度が低下する可能性があります
    • 新規のタンパク質ファミリー: 性能が低下する可能性があります
  3. 複数サンプル: 上位3〜5件の予測を確認し、コンセンサスを探してください

詳細なガイダンスについては: Readツールを使用して references/confidence_and_limitations.md をお読みください

パラメータのカスタマイズ

カスタム設定の使用

特定のユースケース向けにカスタム設定を作成します:

# テンプレートのコピー
cp assets/custom_inference_config.yaml my_config.yaml

# パラメータの編集(テンプレートのプリセットを参照)
# その後、カスタム設定で実行
python -m inference \
  --config my_config.yaml \
  --protein_ligand_csv input.csv \
  --out_dir results/

調整すべき主要パラメータ

サンプリング密度:

  • samples_per_complex: 10 → 難しい場合は20〜40に増やす
  • サンプルが多いほどカバレッジは向上しますが、実行時間は増加します

推論ステップ数:

  • inference_steps: 20 → より高い精度を得るために25〜30に増やす
  • ステップ数が多いほど品質は向上する可能性がありますが、処理は遅くなります

温度パラメータ(多様性の制御):

  • temp_sampling_tor: 7.04 → 柔軟なリガンドの場合は増加(8〜10)
  • temp_sampling_tor: 7.04 → 剛直なリガンドの場合は減少(5〜6)
  • 温度が高いほど、より多様なポーズが生成されます

テンプレートで利用可能なプリセット:

  1. 高精度: より多くのサンプル+ステップ、低い温度
  2. 高速スクリーニング: 少ないサンプル、高速
  3. 柔軟なリガンド: ねじれ温度を増加
  4. 剛直なリガンド: ねじれ温度を減少

完全なパラメータリファレンスについては: Readツールを使用して references/parameters_reference.md をお読みください

高度なテクニック

アンサンブルドッキング(タンパク質の柔軟性)

既知の柔軟性を持つタンパク質の場合、複数のコンフォメーションにドッキングします:

# アンサンブル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)

サンプリングを増やしてドッキングを実行:

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

スコアリング関数との統合

DiffDockはポーズを生成します。親和性を得るために他のツールと組み合わせます:

GNINA(高速なニューラルネットワークスコアリング):

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

MM/GBSA(より正確だが低速): エネルギー最小化後、AmberToolsのMMPBSA.pyまたはgmx_MMPBSAを使用します

自由エネルギー計算(最も正確): FEP/TI計算にはOpenMM + OpenFEまたはGROMACSを使用します

推奨ワークフロー:

  1. DiffDock → 信頼度スコア付きポーズを生成
  2. 目視検査 → 構造的な妥当性を確認
  3. GNINAまたはMM/GBSA → 親和性で再スコアリングおよびランク付け
  4. 実験的検証 → 生化学アッセイ

制限事項と範囲

DiffDockが対応するもの:

  • 低分子リガンド(通常100〜1000 Da)
  • 薬物様有機化合物
  • 小さなペプチド(20残基未満)
  • 単一鎖または複数鎖のタンパク質

DiffDockが対応しないもの:

  • 大きな生体分子(タンパク質-タンパク質ドッキング)→ DiffDock-PPまたはAlphaFold-Multimerを使用
  • 大きなペプチド(20残基超)→ 代替手法を使用
  • 共有結合ドッキング → 専用の共有結合ドッキングツールを使用
  • 結合親和性予測 → スコアリング関数と組み合わせて使用
  • 膜タンパク質 → 特別に訓練されていないため、注意して使用

完全な制限事項については: Readツールを使用して references/confidence_and_limitations.md をお読みください

トラブルシューティング

一般的な問題

問題: すべての予測で低い信頼度スコア

  • 原因: 大きい/異常なリガンド、不明確な結合部位、タンパク質の柔軟性
  • 解決策: samples_per_complex を増やす(20〜40)、アンサンブルドッキングを試す、タンパク質構造を検証する

問題: メモリ不足エラー

  • 原因: GPUメモリがバッチサイズに対して不十分
  • 解決策: --batch_size 2 に減らすか、一度に処理する複合体の数を減らす

問題: パフォーマンスが遅い

  • 原因: GPUではなくCPUで実行している
  • 解決策: python -c "import torch; print(torch.cuda.is_available())" でCUDAを確認し、GPUを使用する

問題: 非現実的な結合ポーズ

  • 原因: タンパク質の準備不良、リガンドが大きすぎる、誤った結合部位
  • 解決策: タンパク質の欠落残基を確認し、遠くの水分子を除去し、結合部位の指定を検討する

問題: 「Module not found」エラー

  • 原因: 依存関係の欠落または環境の誤り
  • 解決策: python scripts/setup_check.py を実行して診断する

パフォーマンス最適化

最良の結果を得るために:

  1. GPUを使用する(実用的に必須)
  2. 繰り返し使用するタンパク質についてはESM埋め込みを事前計算する
  3. 複数の複合体をまとめてバッチ処理する
  4. デフォルトパラメータから開始し、必要に応じて調整する
  5. タンパク質構造を検証する(欠落残基を解決する)
  6. リガンドには標準的なSMILESを使用する

グラフィカルユーザーインターフェース

対話的に使用するには、Webインターフェースを起動します:

python app/main.py
# http://localhost:7860 にアクセス

または、インストールせずにオンラインデモを使用:

リソース

ヘルパースクリプト(scripts/)

prepare_batch_csv.py: バッチ入力CSVファイルの作成と検証

  • サンプルエントリを含むテンプレートの作成
  • ファイルパスとSMILES文字列の検証
  • 必須カラムと形式の問題をチェック

analyze_results.py: 信頼度スコアの分析と予測のランク付け

  • 単一またはバッチ実行からの結果を解析
  • 統計サマリーを生成
  • 後続分析のためにCSVにエクスポート
  • 複合体間でトップ予測を特定

setup_check.py: DiffDock環境設定の検証

  • Pythonバージョンと依存関係をチェック
  • PyTorchとCUDAの可用性を確認
  • RDKitとPyTorch Geometricのインストールをテスト
  • 必要に応じてインストール手順を提供

リファレンスドキュメント(references/)

parameters_reference.md: 完全なパラメータドキュメント

  • すべてのコマンドラインオプションと設定パラメータ
  • デフォルト値と許容範囲
  • 多様性を制御するための温度パラメータ
  • モデルチェックポイントの場所とバージョンフラグ

ユーザーが以下を必要とする場合にこのファイルを読んでください:

  • 詳細なパラメータ説明
  • 特定のシステムに対する微調整ガイダンス
  • 代替サンプリング戦略

confidence_and_limitations.md: 信頼度スコアの解釈とツールの制限事項

  • 詳細な信頼度スコアの解釈
  • 予測を信頼すべきタイミング
  • DiffDockの範囲と制限
  • 補完ツールとの統合
  • 予測品質のトラブルシューティング

ユーザーが以下を必要とする場合にこのファイルを読んでください:

  • 信頼度スコアの解釈に関するヘルプ
  • DiffDockを使用すべきでないタイミングの理解
  • 他のツールとの組み合わせに関するガイダンス
  • 検証戦略

workflows_examples.md: 包括的なワークフロー例

  • 詳細なインストール手順
  • すべてのワークフローのステップバイステップの例
  • 高度な統合パターン
  • 一般的な問題のトラブルシューティング
  • ベストプラクティスと最適化のヒント

ユーザーが以下を必要とする場合にこのファイルを読んでください:

  • コードを含む完全なワークフロー例
  • GNINA、OpenMM、または他のツールとの統合
  • バーチャルスクリーニングワークフロー
  • アンサンブルドッキング手順

アセット(assets/)

batch_template.csv: テンプレート

...

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

adaptyv

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

aeon

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

alphagenome

Look up precomputed AlphaGenome Atlas effects for any GRCh38 single-nucleotide variant (AVI score with Phred and 18 SHAP feature attributions, plus raw and quantile scores for RNA-seq, DNase, ATAC, ChIP-TF, ChIP-histone, CAGE, PRO-cap, splicing, polyadenylation and contact-map tracks), score variants or scan windows on demand with the AlphaGenome model for human and mouse (variant scoring, in silico mutagenesis, REF-versus-ALT track prediction), and build Atlas website deep links. Use when the user mentions AlphaGenome, AlphaGenome Atlas, AVI or AlphaGenome Variant Impact, DeepMind variant effect prediction, or wants to prioritise or mechanistically interpret non-coding, regulatory, splicing, enhancer, promoter, or chromatin-accessibility effects of SNVs from a VCF, credible set, or region. Research use only; not a clinical tool.

analytical-method-validation

Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include

anndata

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

arbor

Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g.

arboreto

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

autoskill

Observe the user

benchling-integration

Benchling Python SDK and REST API integration for registry entities, inventory, ELN entries, workflows, Benchling Apps, and Data Warehouse queries. Use when automating lab data with benchling-sdk or the v2 API.

bgpt-paper-search

Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server. Returns 25+ fields per paper including methods, results, sample sizes, quality scores, and conclusions. Use for literature reviews, evidence synthesis, and finding experimental details not available in abstracts alone.

bids

>

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use biopython.

bulk-rnaseq

End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g.

cellxgene-census

Query the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.

cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

citation-management

Comprehensive citation management for academic research. Search OpenAlex, PubMed, and Google Scholar for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

clinical-decision-support

Prepare and validate research-only clinical decision-support evaluation, evidence-profile, cohort, survival, biomarker/model, privacy, and governance artifacts. Use for aggregate or synthetic research documentation and traceability—not patient care or live clinical operation.

clinical-reports

Create safety-bounded draft structures and run local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.

関連スキル