proteinmpnn-nim

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ProteinMPNN NIM

ProteinMPNN NIM

Design protein sequences for a supplied backbone PDB. Use this
SKILL.md
for first-pass hosted/local usage; load supplemental files only when needed:
  • references/api.md
    : exact endpoints, schemas, Docker flags, response fields.
  • references/science.md
    : inverse-folding uses, limits, and validation.
  • references/parameters.md
    : design controls, fixed positions, sampling.
  • references/validation.md
    : FASTA, score, and structure checks.
  • references/examples.md
    : compact hosted/local request patterns.
为提供的骨架PDB设计蛋白质序列。使用本
SKILL.md
进行首次托管/本地部署使用;仅在需要时加载补充文件:
  • references/api.md
    :精确的端点、模式、Docker参数、响应字段。
  • references/science.md
    :反向折叠的用途、限制与验证方法。
  • references/parameters.md
    :设计控制、固定位置、采样设置。
  • references/validation.md
    :FASTA、评分与结构检查规则。
  • references/examples.md
    :简洁的托管/本地请求示例。

Choose Mode

选择运行模式

Honor an explicitly configured runtime before asking.
NIM_API_MODE=local
selects the local service at
PROTEINMPNN_NIM_URL
; the URL defaults to
http://localhost:8000
for a NIM running in the same host or container. Ask only when neither the environment nor the user's request makes the mode clear:
Hosted NVIDIA API or local Docker NIM?
  • Hosted:
    https://health.api.nvidia.com/v1/biology/ipd/proteinmpnn/predict
  • Local:
    ${PROTEINMPNN_NIM_URL:-http://localhost:8000}/biology/ipd/proteinmpnn/predict
Local inference paths do not include
/v1/
. 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.
优先使用明确配置的运行时环境,若未明确则询问用户。设置
NIM_API_MODE=local
将选择
PROTEINMPNN_NIM_URL
指向的本地服务;若未指定该URL,默认使用同一主机或容器中运行的NIM地址
http://localhost:8000
。仅当环境配置和用户请求均未明确运行模式时,才询问用户:
使用托管式NVIDIA API还是本地Docker NIM?
  • 托管式:
    https://health.api.nvidia.com/v1/biology/ipd/proteinmpnn/predict
  • 本地:
    ${PROTEINMPNN_NIM_URL:-http://localhost:8000}/biology/ipd/proteinmpnn/predict
本地推理路径不包含
/v1/
。托管式请求需使用
Authorization: Bearer $NGC_API_KEY
头信息。本地Docker启动时,需使用
NGC_API_KEY
(或通过预检查使用
NVIDIA_API_KEY
)进行镜像仓库登录、权限验证和首次模型下载;通过
-e NGC_API_KEY
将其传入容器。本地推理服务就绪后,请求无需携带认证头。无密钥的预热缓存启动方式因镜像版本而异,请勿默认依赖该方式。

Local Docker

本地Docker部署

For local setup, run the full sequence — env preflight,
docker login
,
docker run
, readiness loop, then the no-auth localhost request; do not answer with only a localhost Python request. For the exact preflight (
.env
sourcing,
NGC_API_KEY
/
NVIDIA_API_KEY
handling, and the
docker run
for
nvcr.io/nim/ipd/proteinmpnn:latest
), copy the command block in
references/api.md
under Docker Reference verbatim. This NIM's cache mount is
/home/nvs/.cache/nim
, not
/opt/nim/.cache
. When
PROTEINMPNN_NIM_URL
is supplied, the service is already managed elsewhere; use that URL and do not start another Docker container.
Readiness:
bash
proteinmpnn_nim_url="${PROTEINMPNN_NIM_URL:-http://localhost:8000}"
until curl -sf "${proteinmpnn_nim_url%/}/v1/health/ready"; do sleep 5; done
本地部署需执行完整流程——环境预检查、
docker login
docker run
、就绪状态轮询,然后发起无认证的本地请求;请勿仅返回本地Python请求代码。关于精确的预检查步骤(
.env
文件加载、
NGC_API_KEY
/
NVIDIA_API_KEY
处理,以及
nvcr.io/nim/ipd/proteinmpnn:latest
docker run
命令),请直接复制
references/api.md
Docker参考下的命令块。本NIM的缓存挂载路径为
/home/nvs/.cache/nim
,而非
/opt/nim/.cache
。若已提供
PROTEINMPNN_NIM_URL
,说明服务已在其他位置管理;直接使用该URL,无需启动新的Docker容器。
就绪状态检查:
bash
proteinmpnn_nim_url="${PROTEINMPNN_NIM_URL:-http://localhost:8000}"
until curl -sf "${proteinmpnn_nim_url%/}/v1/health/ready"; do sleep 5; done

Request Pattern

请求模式

Read PDB content inline; do not send only a file path.
python
import os
from pathlib import Path
import requests

HOSTED = os.getenv("NIM_API_MODE", "hosted").strip().lower() != "local"
pdb_content = Path("1R42.pdb").read_text()
nim_url = os.getenv("PROTEINMPNN_NIM_URL", "http://localhost:8000").rstrip("/")
url = (
    "https://health.api.nvidia.com/v1/biology/ipd/proteinmpnn/predict"
    if HOSTED else f"{nim_url}/biology/ipd/proteinmpnn/predict"
)
headers = {"Content-Type": "application/json"}
if HOSTED:
    headers["Authorization"] = f"Bearer {os.environ['NGC_API_KEY']}"

payload = {
    "input_pdb": pdb_content,
    "num_seq_per_target": 10,
    "sampling_temp": [0.1],
    "use_soluble_model": False,
    "ca_only": False,
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
result = response.json()
Common controls:
  • Redesign only chain A:
    "input_pdb_chains": ["A"]
    .
  • Exclude amino acids:
    "omit_AAs": ["C"]
    or
    "omit_AAs": ["M"]
    .
  • Diversity:
    "sampling_temp": [0.1, 0.3, 0.5]
    (always a list).
  • Solubility bias:
    "use_soluble_model": True
    .
  • Candidate count:
    num_seq_per_target
    is 1-100.
直接读取PDB内容嵌入请求;请勿仅发送文件路径。
python
import os
from pathlib import Path
import requests

HOSTED = os.getenv("NIM_API_MODE", "hosted").strip().lower() != "local"
pdb_content = Path("1R42.pdb").read_text()
nim_url = os.getenv("PROTEINMPNN_NIM_URL", "http://localhost:8000").rstrip("/")
url = (
    "https://health.api.nvidia.com/v1/biology/ipd/proteinmpnn/predict"
    if HOSTED else f"{nim_url}/biology/ipd/proteinmpnn/predict"
)
headers = {"Content-Type": "application/json"}
if HOSTED:
    headers["Authorization"] = f"Bearer {os.environ['NGC_API_KEY']}"

payload = {
    "input_pdb": pdb_content,
    "num_seq_per_target": 10,
    "sampling_temp": [0.1],
    "use_soluble_model": False,
    "ca_only": False,
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
result = response.json()
常用控制参数:
  • 仅重设计A链:
    "input_pdb_chains": ["A"]
  • 排除特定氨基酸:
    "omit_AAs": ["C"]
    "omit_AAs": ["M"]
  • 多样性设置:
    "sampling_temp": [0.1, 0.3, 0.5]
    (必须为列表格式)。
  • 可溶性偏好:
    "use_soluble_model": True
  • 候选序列数量:
    num_seq_per_target
    取值范围为1-100。

Save And Report Output

保存并报告输出结果

Save the returned
mfasta
and pair scores only with designed (non-native/WT) rows, using the snippet in
references/examples.md
under Save Multi-FASTA. Validate promising designs by predicting structures with Boltz2 or OpenFold3 and comparing them to the target backbone. For FASTA/score sanity checks, read
references/validation.md
.
保存返回的
mfasta
文件,并仅将评分与设计的(非天然/野生型)序列行配对,可使用
references/examples.md
保存多FASTA下的代码片段。通过Boltz2或OpenFold3预测候选设计的结构,并与目标骨架对比,以此验证设计的可行性。关于FASTA/评分的合理性检查,请参考
references/validation.md

Limits And Troubleshooting

限制与故障排查

  • Minimum GPU VRAM: about 3 GB.
  • sampling_temp
    must be a list, even for one value.
  • Empty
    mfasta
    : check non-empty
    input_pdb
    and
    num_seq_per_target >= 1
    .
  • PDB parse errors: use valid PDB ATOM records.
  • Local URL 404 usually means an accidental
    /v1/
    prefix.
  • Cache mount error: use
    /home/nvs/.cache/nim
    inside the container.
  • 最低GPU显存要求:约3GB。
  • sampling_temp
    必须为列表格式,即使仅设置一个值。
  • mfasta
    为空:检查
    input_pdb
    是否非空,且
    num_seq_per_target >= 1
  • PDB解析错误:确保使用有效的PDB ATOM记录。
  • 本地URL返回404:通常是意外添加了
    /v1/
    前缀。
  • 缓存挂载错误:容器内使用
    /home/nvs/.cache/nim
    路径。