diffdock-nim

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DiffDock NIM

DiffDock NIM

Predict protein-ligand binding poses with blind docking. Use this
SKILL.md
for first-pass hosted/local usage; load supplemental files only when needed:
  • references/api.md
    : exact hosted/local endpoints, schemas, Docker flags.
  • references/science.md
    : docking use cases, limits, and handoffs.
  • references/parameters.md
    : ligand formats, pose counts, diffusion controls.
  • references/validation.md
    : receptor, ligand, pose, and confidence checks.
  • references/examples.md
    : compact hosted/local and pose-saving patterns.
通过盲对接预测蛋白-配体结合构象。本
SKILL.md
适用于首次使用托管/本地部署场景;仅在需要时加载补充文件:
  • references/api.md
    :托管/本地端点、数据结构、Docker参数的详细说明。
  • references/science.md
    :对接使用场景、限制条件及交接说明。
  • references/parameters.md
    :配体格式、构象数量、扩散控制参数。
  • references/validation.md
    :受体、配体、构象及置信度校验说明。
  • references/examples.md
    :托管/本地部署及构象保存的简洁示例。

Choose Mode

选择运行模式

Ask only when context is unclear:
Hosted NVIDIA API or local Docker NIM?
  • Hosted:
    https://health.api.nvidia.com/v1/biology/mit/diffdock
  • Local:
    http://localhost:8000/molecular-docking/diffdock/generate
The hosted and local paths differ. Local has no
/v1/
prefix and uses the
/molecular-docking/
route. Hosted requests use
Authorization: Bearer $NGC_API_KEY
. Supported local Docker startup uses
NGC_API_KEY
(or
NVIDIA_API_KEY
via the preflight) for registry login, entitlement checks, and first-run model downloads; pass it into the container with
-e NGC_API_KEY
. Local inference requests use no auth header after readiness. Warm-cache key-free startup varies by image/version and should not be assumed.
仅在上下文不明确时询问:
使用NVIDIA托管API还是本地Docker NIM?
  • 托管版:
    https://health.api.nvidia.com/v1/biology/mit/diffdock
  • 本地版:
    http://localhost:8000/molecular-docking/diffdock/generate
托管版与本地版的路径不同。本地版没有
/v1/
前缀,使用
/molecular-docking/
路由。托管版请求需使用
Authorization: Bearer $NGC_API_KEY
。本地Docker启动需使用
NGC_API_KEY
(或通过预检流程使用
NVIDIA_API_KEY
)进行镜像仓库登录、权限校验及首次运行时的模型下载;需通过
-e NGC_API_KEY
将其传入容器。本地推理请求在服务就绪后无需认证头。无密钥的预热缓存启动方式因镜像/版本而异,请勿默认依赖该方式。

Local Docker

本地Docker部署

For the exact local preflight (
.env
load,
NVIDIA_API_KEY
fallback,
LOCAL_NIM_CACHE
,
NVIDIA_VISIBLE_DEVICES=0
,
--shm-size=2G
, both
--ulimit
flags,
docker login
, and the
docker run
for
nvcr.io/nim/mit/diffdock:2.2.0
), copy the command block in
references/api.md
under Docker Reference verbatim.
Readiness:
bash
until curl -sf http://localhost:8000/v1/health/ready; do sleep 5; done
如需完整的本地预检流程(加载
.env
文件、
NVIDIA_API_KEY
fallback、
LOCAL_NIM_CACHE
NVIDIA_VISIBLE_DEVICES=0
--shm-size=2G
、两个
--ulimit
参数、
docker login
以及运行
nvcr.io/nim/mit/diffdock:2.2.0
docker run
命令),请直接复制
references/api.md
Docker参考下的命令块。
服务就绪校验:
bash
until curl -sf http://localhost:8000/v1/health/ready; do sleep 5; done

Prepare Inputs

准备输入数据

Protein receptor must be ATOM records only. Strip headers, water, and HETATM.
python
from pathlib import Path
raw_pdb = Path("protein.pdb").read_text()
protein = "\n".join(line for line in raw_pdb.splitlines() if line.startswith("ATOM"))
if not protein:
    raise ValueError("protein.pdb has no ATOM records")
Ligand options:
  • SMILES:
    ligand = "CC(=O)OC1=CC=CC=C1C(=O)O"
    ;
    ligand_file_type = "txt"
    .
  • SDF:
    ligand = Path("ligand.sdf").read_text()
    ;
    ligand_file_type = "sdf"
    .
  • MOL2:
    ligand_file_type = "mol2"
    .
Do not use
"smiles"
as
ligand_file_type
; SMILES is
"txt"
.
蛋白受体必须仅包含ATOM记录。移除头部信息、水分子及HETATM记录。
python
from pathlib import Path
raw_pdb = Path("protein.pdb").read_text()
protein = "\n".join(line for line in raw_pdb.splitlines() if line.startswith("ATOM"))
if not protein:
    raise ValueError("protein.pdb has no ATOM records")
配体选项:
  • SMILES格式:
    ligand = "CC(=O)OC1=CC=CC=C1C(=O)O"
    ligand_file_type = "txt"
  • SDF格式:
    ligand = Path("ligand.sdf").read_text()
    ligand_file_type = "sdf"
  • MOL2格式:
    ligand_file_type = "mol2"
请勿将
"smiles"
作为
ligand_file_type
的值;SMILES格式对应的是
"txt"

Request Pattern

请求示例

python
import os
import requests

HOSTED = True
url = (
    "https://health.api.nvidia.com/v1/biology/mit/diffdock"
    if HOSTED else "http://localhost:8000/molecular-docking/diffdock/generate"
)
headers = {"Content-Type": "application/json"}
if HOSTED:
    headers["Authorization"] = f"Bearer {os.getenv('NGC_API_KEY')}"

payload = {
    "protein": protein,
    "ligand": ligand,
    "ligand_file_type": ligand_file_type,
    "num_poses": 10,
    "time_divisions": 20,
    "steps": 18,
    "save_trajectory": False,
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
result = response.json()
python
import os
import requests

HOSTED = True
url = (
    "https://health.api.nvidia.com/v1/biology/mit/diffdock"
    if HOSTED else "http://localhost:8000/molecular-docking/diffdock/generate"
)
headers = {"Content-Type": "application/json"}
if HOSTED:
    headers["Authorization"] = f"Bearer {os.getenv('NGC_API_KEY')}"

payload = {
    "protein": protein,
    "ligand": ligand,
    "ligand_file_type": ligand_file_type,
    "num_poses": 10,
    "time_divisions": 20,
    "steps": 18,
    "save_trajectory": False,
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
result = response.json()

Save And Report Output

保存并报告输出结果

ligand_positions
and
position_confidence
are parallel ranked lists.
position_confidence[0]
is the rank-1 pose confidence.
Save the ranked pose SDFs using the snippet in
references/examples.md
under Save Ranked Poses.
View pose SDF files with the receptor in PyMOL, ChimeraX, or UCSF Chimera. For pose sanity checks and confidence caveats, read
references/validation.md
.
ligand_positions
position_confidence
是相互对应的排序后列表。
position_confidence[0]
为排名第一的构象置信度。
请使用
references/examples.md
保存排序后构象下的代码片段保存排序后的构象SDF文件。
可在PyMOL、ChimeraX或UCSF Chimera中结合受体查看构象SDF文件。如需了解构象合理性校验及置信度相关注意事项,请阅读
references/validation.md

Limits And Troubleshooting

限制条件与故障排查

  • Max
    num_poses
    : 100. Max
    time_divisions
    : 20. Max
    steps
    : 18.
  • Single GPU; local minimum is about 24 GB VRAM.
  • 422
    : invalid
    ligand_file_type
    , invalid SMILES/SDF, or no ATOM records.
  • Empty poses: validate receptor ATOM records and ligand parseability.
  • Local URL 404 usually means the wrong hosted path or an accidental
    /v1/
    .
  • num_poses
    最大值:100。
    time_divisions
    最大值:20。
    steps
    最大值:18。
  • 仅支持单GPU;本地部署最低需要约24GB显存。
  • 返回
    422
    错误:
    ligand_file_type
    无效、SMILES/SDF格式无效或无ATOM记录。
  • 构象为空:校验受体ATOM记录及配体可解析性。
  • 本地URL返回404错误:通常是使用了错误的托管版路径或误加了
    /v1/
    前缀。