msa-search-nim
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMSA-Search NIM
MSA-Search NIM
Generate protein MSAs with GPU-accelerated MMSeqs2. Use this for
first-pass hosted/local usage; load supplemental files only when needed:
SKILL.md- : exact endpoints, schemas, Docker flags, response fields.
references/api.md - : MSA purpose, pairing/templates, limits, handoffs.
references/science.md - : database, pairing, depth, and template tuning.
references/parameters.md - : alignment, template, and artifact checks.
references/validation.md - : compact hosted/local request patterns.
references/examples.md
利用GPU加速的MMSeqs2生成蛋白质MSA。请使用此进行首次托管/本地使用;仅在需要时加载补充文件:
SKILL.md- :精确的端点、模式、Docker参数、响应字段。
references/api.md - :MSA的用途、配对/模板、限制、交接说明。
references/science.md - :数据库、配对、深度和模板调优参数。
references/parameters.md - :比对、模板和人工产物检查。
references/validation.md - :简洁的托管/本地请求示例。
references/examples.md
Choose Mode And Endpoint
选择模式与端点
Ask only when context is unclear:
Hosted NVIDIA API or local Docker NIM?
- Hosted standard MSA:
https://health.api.nvidia.com/v1/biology/colabfold/msa-search/predict - Hosted paired MSA:
https://health.api.nvidia.com/v1/biology/colabfold/msa-search/paired/predict - Local standard MSA:
http://localhost:8000/biology/colabfold/msa-search/predict - Local paired MSA:
http://localhost:8000/biology/colabfold/msa-search/paired/predict - Local templates:
http://localhost:8000/biology/colabfold/msa-search/structure-templates/predict
Local inference paths do not include . Hosted requests use . Supported local Docker
startup uses (or via the preflight) for
registry login, entitlement checks, and first-run model downloads; pass it
into the container with . Local inference requests use no
auth header after readiness. Warm-cache key-free startup varies by
image/version and should not be assumed.
The hosted template path returned HTTP 404 in validation, so use local Docker
for template search unless the hosted docs/service changes.
/v1/Authorization: Bearer $NGC_API_KEYNGC_API_KEYNVIDIA_API_KEY-e NGC_API_KEY仅在上下文不明确时询问:
使用托管式NVIDIA API还是本地Docker NIM?
- 托管式标准MSA:
https://health.api.nvidia.com/v1/biology/colabfold/msa-search/predict - 托管式配对MSA:
https://health.api.nvidia.com/v1/biology/colabfold/msa-search/paired/predict - 本地标准MSA:
http://localhost:8000/biology/colabfold/msa-search/predict - 本地配对MSA:
http://localhost:8000/biology/colabfold/msa-search/paired/predict - 本地模板:
http://localhost:8000/biology/colabfold/msa-search/structure-templates/predict
本地推理路径不包含。托管式请求需使用。支持的本地Docker启动流程使用(或通过预检步骤使用)进行注册表登录、权限验证和首次运行模型下载;通过将其传入容器。本地推理请求在服务就绪后无需身份验证头。免密钥的暖启动缓存机制因镜像/版本而异,请勿默认依赖。验证发现托管式模板路径返回HTTP 404错误,因此除非托管文档/服务更新,否则请使用本地Docker进行模板搜索。
/v1/Authorization: Bearer $NGC_API_KEYNGC_API_KEYNVIDIA_API_KEY-e NGC_API_KEYLocal Docker
本地Docker部署
Default local deployment = parallel download + . The first recipe below
is the one to use for real workflows. It downloads the database(s) with a range-parallel
downloader (aria2c) and starts the NIM against those files — ~14 min for UniRef30 vs >80 min
for the NIM's built-in downloader (measured, H100). Do not reach for the plain
(the "Fallback" subsection) unless you only want a smoke test or you
deliberately want the NIM to manage its own blob cache.
NIM_MODEL_NAMEdocker rundatabases:pdb70Local setup requires a GPU. Size the NVMe volume to the profile you pick (UniRef30 ~490 GB;
full set ~1.4 TB). For setup answers, include env preflight, , the parallel
download, launch, readiness, and then no-auth local inference. Do not invent a
cache default or drop the fallback.
docker loginNIM_MODEL_NAMENVIDIA_API_KEYbash
undefined默认本地部署 = 并行下载 + 。 以下第一个方案适用于实际工作流:它使用范围并行下载器(aria2c)下载数据库文件,并基于这些文件启动NIM——UniRef30数据库耗时约14分钟,相比NIM内置下载器的80+分钟大幅缩短(基于H100测试)。除非仅需冒烟测试,或特意希望NIM自行管理Blob缓存,否则请勿使用普通命令(即“备选方案”小节内容)。
NIM_MODEL_NAMEdatabases:pdb70docker run本地部署需要GPU支持。请根据所选配置调整NVMe卷大小(UniRef30约490 GB;完整集约1.4 TB)。如需部署解答,请包含环境预检、、并行下载、启动、服务就绪检查,以及无身份验证的本地推理步骤。请勿自行设置缓存默认值,或省略备选方案。
docker loginNIM_MODEL_NAMENVIDIA_API_KEYbash
undefined--- env preflight (do not drop the NVIDIA_API_KEY fallback) ---
--- 环境预检(请勿省略NVIDIA_API_KEY备选方案) ---
set -a
[ -f .env ] && . ./.env
set +a
if [ -z "${NGC_API_KEY:-}" ] && [ -n "${NVIDIA_API_KEY:-}" ]; then
export NGC_API_KEY="$NVIDIA_API_KEY"
fi
: "${NGC_API_KEY:?Set NGC_API_KEY or NVIDIA_API_KEY}"
: "${DB_DIR:=/data/fast-db}" # where the parallel download lands
echo "$NGC_API_KEY" | docker login nvcr.io --username '$oauthtoken' --password-stdin
set -a
[ -f .env ] && . ./.env
set +a
if [ -z "${NGC_API_KEY:-}" ] && [ -n "${NVIDIA_API_KEY:-}" ]; then
export NGC_API_KEY="$NVIDIA_API_KEY"
fi
: "${NGC_API_KEY:?请设置NGC_API_KEY或NVIDIA_API_KEY}"
: "${DB_DIR:=/data/fast-db}" # 并行下载文件的存储路径
echo "$NGC_API_KEY" | docker login nvcr.io --username '$oauthtoken' --password-stdin
--- 1) pick the DB version(s) you need (paired/complex work = uniref30 only) ---
--- 1) 选择所需的数据库版本(配对/复合物分析仅需uniref30) ---
DB_VERSION=uniref30_2302-m18v1
command -v aria2c >/dev/null || { echo "aria2c required; install it (e.g. apt-get install -y aria2) and re-run"; exit 1; }
mkdir -p "$DB_DIR"
DB_VERSION=uniref30_2302-m18v1
command -v aria2c >/dev/null || { echo "需要aria2c;请安装(例如apt-get install -y aria2)后重新运行"; exit 1; }
mkdir -p "$DB_DIR"
--- 2) parallel download from NGC (see "Parallel Download" section for the all-DB loop) ---
--- 2) 从NGC并行下载数据库(如需下载全量数据库,请查看“并行下载任意数据库集”章节) ---
curl -fsS -H "Authorization: Bearer $NGC_API_KEY"
"https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/${DB_VERSION}/files"
-o /tmp/files.json DB_DIR="$DB_DIR" python3 - <<'PY' import json, os d = json.load(open("/tmp/files.json")); dbdir = os.environ["DB_DIR"]; lines = [] for url, path in zip(d["urls"], d["filepath"]): lines += [url.strip(), f" dir={dbdir}", f" out={path}"] open("/tmp/aria.in", "w").write("\n".join(lines) + "\n") PY aria2c -i /tmp/aria.in --max-concurrent-downloads=4 --max-connection-per-server=16
--split=16 --min-split-size=1M --continue=true --file-allocation=none
"https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/${DB_VERSION}/files"
-o /tmp/files.json DB_DIR="$DB_DIR" python3 - <<'PY' import json, os d = json.load(open("/tmp/files.json")); dbdir = os.environ["DB_DIR"]; lines = [] for url, path in zip(d["urls"], d["filepath"]): lines += [url.strip(), f" dir={dbdir}", f" out={path}"] open("/tmp/aria.in", "w").write("\n".join(lines) + "\n") PY aria2c -i /tmp/aria.in --max-concurrent-downloads=4 --max-connection-per-server=16
--split=16 --min-split-size=1M --continue=true --file-allocation=none
curl -fsS -H "Authorization: Bearer $NGC_API_KEY"
"https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/${DB_VERSION}/files"
-o /tmp/files.json DB_DIR="$DB_DIR" python3 - <<'PY' import json, os d = json.load(open("/tmp/files.json")); dbdir = os.environ["DB_DIR"]; lines = [] for url, path in zip(d["urls"], d["filepath"]): lines += [url.strip(), f" dir={dbdir}", f" out={path}"] open("/tmp/aria.in", "w").write("\n".join(lines) + "\n") PY aria2c -i /tmp/aria.in --max-concurrent-downloads=4 --max-connection-per-server=16
--split=16 --min-split-size=1M --continue=true --file-allocation=none
"https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/${DB_VERSION}/files"
-o /tmp/files.json DB_DIR="$DB_DIR" python3 - <<'PY' import json, os d = json.load(open("/tmp/files.json")); dbdir = os.environ["DB_DIR"]; lines = [] for url, path in zip(d["urls"], d["filepath"]): lines += [url.strip(), f" dir={dbdir}", f" out={path}"] open("/tmp/aria.in", "w").write("\n".join(lines) + "\n") PY aria2c -i /tmp/aria.in --max-concurrent-downloads=4 --max-connection-per-server=16
--split=16 --min-split-size=1M --continue=true --file-allocation=none
--- 3) launch the NIM against the downloaded files (skips the slow built-in download) ---
--- 3) 基于已下载文件启动NIM(跳过缓慢的内置下载流程) ---
docker run -d --name msa-search --runtime=nvidia --gpus all
-e NGC_API_KEY
-e NIM_MODEL_NAME=/databases
-v "${DB_DIR}:/databases"
-p 8000:8000
nvcr.io/nim/colabfold/msa-search:2
-e NGC_API_KEY
-e NIM_MODEL_NAME=/databases
-v "${DB_DIR}:/databases"
-p 8000:8000
nvcr.io/nim/colabfold/msa-search:2
Readiness:
```bash
until curl -sf http://localhost:8000/v1/health/ready; do sleep 5; doneIf the DB is already present in , skip steps 1-2 — the launch alone is a ~20 s warm
start. See "Parallel Download For Any Database Set" for the multi-database ()
loop and the full rationale.
$DB_DIRdatabases:alldocker run -d --name msa-search --runtime=nvidia --gpus all
-e NGC_API_KEY
-e NIM_MODEL_NAME=/databases
-v "${DB_DIR}:/databases"
-p 8000:8000
nvcr.io/nim/colabfold/msa-search:2
-e NGC_API_KEY
-e NIM_MODEL_NAME=/databases
-v "${DB_DIR}:/databases"
-p 8000:8000
nvcr.io/nim/colabfold/msa-search:2
服务就绪检查:
```bash
until curl -sf http://localhost:8000/v1/health/ready; do sleep 5; done若中已存在数据库,请跳过步骤1-2——仅启动服务即可实现约20秒的暖启动。如需多数据库()循环及完整说明,请查看“并行下载任意数据库集”章节。
$DB_DIRdatabases:allFallback: Let The NIM Download Its Own Databases (slower)
备选方案:让NIM自行下载数据库(速度较慢)
Use this only for a quick smoke test, or when you specifically want the NIM
to manage its own blob cache. It uses the built-in downloader, which is slow on large profiles
(UniRef30 stalled past 80 min in testing). Pin the smallest profile with
(see "Faster Startup") so it does not fetch the full 1.4 TB.
databases:pdb70NIM_MODEL_PROFILEbash
: "${LOCAL_NIM_CACHE:?Set LOCAL_NIM_CACHE}"
mkdir -p "${LOCAL_NIM_CACHE}"; chmod 755 "${LOCAL_NIM_CACHE}"
docker run --rm --name msa-search \
--runtime=nvidia --gpus all \
-e NGC_API_KEY \
-e NIM_MODEL_PROFILE=<hash-from-list-model-profiles> \
-v "${LOCAL_NIM_CACHE}:/opt/nim/.cache" \
-p 8000:8000 \
nvcr.io/nim/colabfold/msa-search:2仅在快速冒烟测试,或特意希望NIM自行管理Blob缓存时使用此方案。它使用内置下载器,在处理大型配置时速度极慢(测试中UniRef30下载耗时超过80分钟仍未完成)。请通过指定最小配置(查看“更快启动”章节),避免下载完整的1.4 TB数据。
databases:pdb70NIM_MODEL_PROFILEbash
: "${LOCAL_NIM_CACHE:?请设置LOCAL_NIM_CACHE}"
mkdir -p "${LOCAL_NIM_CACHE}"; chmod 755 "${LOCAL_NIM_CACHE}"
docker run --rm --name msa-search \
--runtime=nvidia --gpus all \
-e NGC_API_KEY \
-e NIM_MODEL_PROFILE=<hash-from-list-model-profiles> \
-v "${LOCAL_NIM_CACHE}:/opt/nim/.cache" \
-p 8000:8000 \
nvcr.io/nim/colabfold/msa-search:2Faster Startup: Task-Specific Database Profiles
更快启动:任务专属数据库配置
The full database download is ~1.4 TB and can take well over an hour on first launch. If you
only need some databases, select a task-specific profile so the NIM downloads just those.
This is the single biggest lever on local startup time.
List the profiles your image actually ships (hashes change between releases — never hardcode
them):
bash
docker run --rm --entrypoint list-model-profiles nvcr.io/nim/colabfold/msa-search:2Then pass the chosen hash with :
NIM_MODEL_PROFILEbash
docker run --rm --name msa-search \
--runtime=nvidia --gpus all \
-e NGC_API_KEY \
-e NIM_MODEL_PROFILE=<hash-from-list-model-profiles> \
-v "${LOCAL_NIM_CACHE}:/opt/nim/.cache" \
-p 8000:8000 \
nvcr.io/nim/colabfold/msa-search:2Profiles available in this image (confirm hashes with ):
list-model-profiles| Profile tags | Databases | Best for | Storage |
|---|---|---|---|
| PDB70 | Quick testing / smoke check | ~100 MB |
| UniRef30 | Paired MSA search for complexes — UniRef30 is the only DB used for species-based pairing | ~500 GB |
| UniRef30 + PDB70 + PDB structures | Structural template search | ~700 GB |
| UniRef30 + ColabFold envdb + PDB70 + PDB100 + PDB structures | Full sensitivity, all databases | ~1.2 TB |
Verify the loaded profile after readiness:
bash
curl -s localhost:8000/v1/metadata | jqNotes:
- The request-level parameter only selects among databases already downloaded; it does NOT change what is fetched at startup. Startup footprint is set by
databasesalone.NIM_MODEL_PROFILE - Paired search needs UniRef30 only. has no taxonomy and cannot be used for pairing, so
colabfold_envdb_202108is the correct, smallest profile for complex/paired workflows — it skips the envdb, the largest part of the full set.databases:uniref30 - For maximum monomer sensitivity (UniRef30 + envdb merged) you still need ; there is no envdb-inclusive profile smaller than the full set.
databases:all
完整数据库下载约1.4 TB,首次启动可能耗时超1小时。若仅需部分数据库,请选择任务专属配置,让NIM仅下载所需内容。这是缩短本地启动时间最有效的方法。
列出当前镜像实际支持的配置(哈希值随版本变化——请勿硬编码):
bash
docker run --rm --entrypoint list-model-profiles nvcr.io/nim/colabfold/msa-search:2然后通过传入所选哈希值:
NIM_MODEL_PROFILEbash
docker run --rm --name msa-search \
--runtime=nvidia --gpus all \
-e NGC_API_KEY \
-e NIM_MODEL_PROFILE=<hash-from-list-model-profiles> \
-v "${LOCAL_NIM_CACHE}:/opt/nim/.cache" \
-p 8000:8000 \
nvcr.io/nim/colabfold/msa-search:2此镜像支持的配置(请通过确认哈希值):
list-model-profiles| 配置标签 | 包含数据库 | 适用场景 | 存储需求 |
|---|---|---|---|
| PDB70 | 快速测试/冒烟检查 | ~100 MB |
| UniRef30 | 复合物配对MSA搜索——UniRef30是唯一支持基于物种配对的数据库 | ~500 GB |
| UniRef30 + PDB70 + PDB结构 | 结构模板搜索 | ~700 GB |
| UniRef30 + ColabFold envdb + PDB70 + PDB100 + PDB结构 | 全灵敏度分析,包含所有数据库 | ~1.2 TB |
服务就绪后验证已加载的配置:
bash
curl -s localhost:8000/v1/metadata | jq注意事项:
- 请求级别的参数仅能在已下载的数据库中选择;无法改变启动时下载的数据库内容。启动时的存储占用完全由
databases决定。NIM_MODEL_PROFILE - 配对搜索仅需UniRef30。无分类信息,无法用于配对,因此
colabfold_envdb_202108是复合物/配对工作流的正确最小配置——它会跳过envdb(完整集中最大的部分)。databases:uniref30 - 如需最高单体灵敏度(合并UniRef30与envdb),仍需使用;目前没有包含envdb且小于完整集的配置。
databases:all
Custom Or Individual Databases
自定义或单个数据库
To use a single manually downloaded database (or your own MMSeqs2 DB), download it from NGC
and point the NIM at the mount with instead of a profile:
NIM_MODEL_NAMEbash
ngc registry model download-version nim/colabfold/msa-search:uniref30_2302-m18v1若要使用单个手动下载的数据库(或自建MMSeqs2数据库),请从NGC下载并通过指向挂载路径,而非使用配置参数:
NIM_MODEL_NAMEbash
ngc registry model download-version nim/colabfold/msa-search:uniref30_2302-m18v1then mount the directory and set -e NIM_MODEL_NAME=/databases
然后挂载目录并设置 -e NIM_MODEL_NAME=/databases
`NIM_MODEL_NAME` **replaces** the profile databases entirely — the NIM uses only what is
under that directory (discovered by scanning for `**/*.idx`). Mount multiple databases under
one parent to combine them. NGC-downloaded databases are pre-indexed for GPU Server; custom
databases must be indexed with `mmseqs createindex` first. Individually downloadable NGC model
versions: `uniref30_2302-m18v1`, `colabfold_envdb_202108-m18v1`, `pdb70_220313-m18v1`,
`pdb100_230517-m18v1`, `pdb_20251028_zip-m18v1`.
`NIM_MODEL_NAME`会**完全替代**配置中的数据库——NIM仅使用该目录下的数据库(通过扫描`**/*.idx`文件发现)。可将多个数据库挂载到同一父目录下以组合使用。从NGC下载的数据库已针对GPU Server预索引;自定义数据库需先使用`mmseqs createindex`创建索引。可单独下载的NGC模型版本包括:`uniref30_2302-m18v1`、`colabfold_envdb_202108-m18v1`、`pdb70_220313-m18v1`、`pdb100_230517-m18v1`、`pdb_20251028_zip-m18v1`。Recommended: Parallel Download For Any Database Set (Fast Deployment)
推荐方案:并行下载任意数据库集(快速部署)
This is the recommended way to download the databases at all — for any profile,
including the full set. Task-specific profiles cut what you
download; this parallel downloader cuts how long that download takes. Use it whether
you need one database or all of them. The gain is largest for the profile, which is ~490 GB
dominated by two very large files (a ~241 GB GPU index and a ~134 GB sequence DB).
databases:alldatabases:uniref30The NIM's built-in downloader parallelizes across files () but pulls
each file over roughly one connection. The NGC CDN throttles a single connection to ~20–25
MB/s, so while the downloader is fetching one of the two giant files, most of its parallel
slots sit idle and throughput collapses to that single-flow rate. Measured on an H100 node,
the built-in path did not reach in over 80 minutes.
max_parallel_files=10/health/readyA range-parallel downloader splits each file into many byte-range segments (the NGC CDN
advertises ), so a single 241 GB file is pulled over 16 connections at
once — ~15× the single-flow rate. Same node, fetched the full ~490 GB in ~13.5
minutes.
accept-ranges: bytesaria2cWorkflow (download once with aria2, then start the NIM against the files via ):
NIM_MODEL_NAMEbash
undefined无论选择哪种配置(包括完整的集),这都是下载数据库的推荐方式。 任务专属配置减少下载内容;并行下载器缩短下载时间。无论需要单个还是全部数据库,均可使用此方法。对于配置(约490 GB,包含两个超大文件:241 GB的GPU索引和134 GB的序列数据库),提速效果最为显著。
databases:alldatabases:uniref30NIM内置下载器仅在文件间并行(),但每个文件仅通过约一个连接下载。NGC CDN对单个连接限速约20–25 MB/s,因此当下载器处理两个超大文件之一时,大部分并行槽位处于空闲状态,吞吐量降至单流速率。基于H100节点测试,内置下载路径耗时超80分钟仍未完成检查。
max_parallel_files=10/health/ready范围并行下载器将每个文件拆分为多个字节范围段(NGC CDN支持),因此单个241 GB文件可同时通过16个连接下载——速率约为单流的15倍。同一节点上,下载完整的~490 GB数据仅需约13.5分钟。
accept-ranges: bytesaria2c工作流(使用aria2下载一次,然后通过基于文件启动NIM):
NIM_MODEL_NAMEbash
undefined1) Get presigned file URLs for the individual database model version from NGC.
1) 从NGC获取单个数据库模型版本的预签名文件URL。
(Requires NGC_API_KEY. The response arrays urls
and filepath
are positionally paired.)
urlsfilepath(需要NGC_API_KEY。响应中的urls
和filepath
数组按位置对应。)
urlsfilepathcurl -s -H "Authorization: Bearer $NGC_API_KEY"
'https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/uniref30_2302-m18v1/files'
-o files.json
'https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/uniref30_2302-m18v1/files'
-o files.json
curl -s -H "Authorization: Bearer $NGC_API_KEY"
'https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/uniref30_2302-m18v1/files'
-o files.json
'https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/uniref30_2302-m18v1/files'
-o files.json
2) Build an aria2 input file (URL + target filename per entry) and download in parallel.
2) 构建aria2输入文件(每个条目包含URL和目标文件名)并并行下载。
python3 - <<'PY'
import json
d = json.load(open("files.json"))
lines = []
for url, path in zip(d["urls"], d["filepath"]):
lines += [url.strip(), " dir=/data/fast-db", f" out={path}"]
open("aria.in", "w").write("\n".join(lines) + "\n")
PY
aria2c -i aria.in
--max-concurrent-downloads=4 --max-connection-per-server=16 --split=16
--min-split-size=1M --continue=true --file-allocation=none
--max-concurrent-downloads=4 --max-connection-per-server=16 --split=16
--min-split-size=1M --continue=true --file-allocation=none
python3 - <<'PY'
import json
d = json.load(open("files.json"))
lines = []
for url, path in zip(d["urls"], d["filepath"]):
lines += [url.strip(), " dir=/data/fast-db", f" out={path}"]
open("aria.in", "w").write("\n".join(lines) + "\n")
PY
aria2c -i aria.in
--max-concurrent-downloads=4 --max-connection-per-server=16 --split=16
--min-split-size=1M --continue=true --file-allocation=none
--max-concurrent-downloads=4 --max-connection-per-server=16 --split=16
--min-split-size=1M --continue=true --file-allocation=none
3) Start the NIM against the downloaded directory. NIM_MODEL_NAME makes the NIM discover
3) 基于已下载目录启动NIM。NIM_MODEL_NAME使NIM通过扫描**/*.idx
发现数据库,完全绕过配置/Blob缓存。
**/*.idxdatabases by scanning for **/*.idx, bypassing the profile/blob cache entirely.
—
docker run -d --name msa-search --runtime=nvidia --gpus all
-e NGC_API_KEY
-e NIM_MODEL_NAME=/databases
-v /data/fast-db:/databases
-p 8000:8000
nvcr.io/nim/colabfold/msa-search:2
-e NGC_API_KEY
-e NIM_MODEL_NAME=/databases
-v /data/fast-db:/databases
-p 8000:8000
nvcr.io/nim/colabfold/msa-search:2
For **all databases** (equivalent to `databases:all`), repeat step 1 for each individual DB
version and download them into sibling directories under one parent, then point
`NIM_MODEL_NAME` at that parent — the NIM discovers every DB by scanning `**/*.idx`:
```bashdocker run -d --name msa-search --runtime=nvidia --gpus all
-e NGC_API_KEY
-e NIM_MODEL_NAME=/databases
-v /data/fast-db:/databases
-p 8000:8000
nvcr.io/nim/colabfold/msa-search:2
-e NGC_API_KEY
-e NIM_MODEL_NAME=/databases
-v /data/fast-db:/databases
-p 8000:8000
nvcr.io/nim/colabfold/msa-search:2
若要下载**全量数据库**(等同于`databases:all`),请为每个单独的数据库版本重复步骤1,并将它们下载到同一父目录下的子目录中,然后将`NIM_MODEL_NAME`指向该父目录——NIM会通过扫描`**/*.idx`发现所有数据库:
```bashfetch each DB's file list into /data/all-db/<db>/ ... then one aria2c per list, e.g.:
获取每个数据库的文件列表并保存到/data/all-db/<db>/... 然后为每个列表运行aria2c,例如:
for V in uniref30_2302-m18v1 colabfold_envdb_202108-m18v1 pdb70_220313-m18v1
pdb100_230517-m18v1 pdb_20251028_zip-m18v1; do curl -s -H "Authorization: Bearer $NGC_API_KEY"
"https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/$V/files"
-o "files_$V.json"
pdb100_230517-m18v1 pdb_20251028_zip-m18v1; do curl -s -H "Authorization: Bearer $NGC_API_KEY"
"https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/$V/files"
-o "files_$V.json"
build an aria2 input from files_$V.json (dir=/data/all-db) and run aria2c on it
done
for V in uniref30_2302-m18v1 colabfold_envdb_202108-m18v1 pdb70_220313-m18v1
pdb100_230517-m18v1 pdb_20251028_zip-m18v1; do curl -s -H "Authorization: Bearer $NGC_API_KEY"
"https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/$V/files"
-o "files_$V.json"
pdb100_230517-m18v1 pdb_20251028_zip-m18v1; do curl -s -H "Authorization: Bearer $NGC_API_KEY"
"https://api.ngc.nvidia.com/v2/org/nim/team/colabfold/models/msa-search/$V/files"
-o "files_$V.json"
基于files_$V.json构建aria2输入文件(dir=/data/all-db)并运行aria2c
done
then launch once against the parent:
然后基于父目录启动一次服务:
docker run -d ... -e NIM_MODEL_NAME=/databases -v /data/all-db:/databases ...
docker run -d ... -e NIM_MODEL_NAME=/databases -v /data/all-db:/databases ...
The per-connection CDN throttle is the same for every database, so parallel download helps
the full set proportionally — the more you download, the more absolute time it saves.
Notes:
- The presigned URLs expire (typically within a day) — build the aria2 input and start the
download promptly after fetching `files.json`.
- Keep the downloaded directory's internal layout intact (e.g. `uniref30_2302/…`); the
`filepath` values already encode it. The NIM needs the `.idx` file plus its companion files
and the small `.UNIREF30_READY` / `*.tar.gz.unpacked` markers.
- The bottleneck is the CDN's per-connection cap, not local disk or CPU — a fast NVMe volume
writes far faster than the network delivers. Raising `--split` / `--max-connection-per-server`
helps only up to the node's aggregate egress ceiling.
- Best of all: download the profile once, then **persist the cache volume** (or this
`fast-db` directory) and mount it on future nodes for a ~20 s warm start with no re-download.
CDN对每个连接的限速适用于所有数据库,因此并行下载对全量集的提速比例一致——下载内容越多,节省的绝对时间越多。
注意事项:
- 预签名URL会过期(通常在一天内)——获取`files.json`后请立即构建aria2输入文件并开始下载。
- 请保持下载目录的内部结构完整(例如`uniref30_2302/…`);`filepath`值已包含该结构。NIM需要`.idx`文件及其配套文件,以及小型的`.UNIREF30_READY`/`*.tar.gz.unpacked`标记文件。
- 瓶颈在于CDN的单连接限速,而非本地磁盘或CPU——快速NVMe卷的写入速度远快于网络传输速度。提高`--split`/`--max-connection-per-server`参数仅在节点总出口带宽范围内有效。
- 最佳实践:下载配置一次后,**持久化缓存卷**(或此`fast-db`目录),并在后续节点上挂载,即可实现约20秒的暖启动,无需重新下载。Standard MSA Request
标准MSA请求
Use exact case-sensitive database names and response keys.
python
import os
import requests
HOSTED = True
url = (
"https://health.api.nvidia.com/v1/biology/colabfold/msa-search/predict"
if HOSTED else "http://localhost:8000/biology/colabfold/msa-search/predict"
)
headers = {"Content-Type": "application/json"}
if HOSTED:
headers["Authorization"] = f"Bearer {os.getenv('NGC_API_KEY')}"
payload = {
"sequence": "SGSMKTAISLPDETFDRVSRRASELGMSRSEFFTKAAQR",
"databases": ["Uniref30_2302", "colabfold_envdb_202108"],
"e_value": 0.0001,
"output_alignment_formats": ["a3m"],
}
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/colabfold/msa-search/predict"
if HOSTED else "http://localhost:8000/biology/colabfold/msa-search/predict"
)
headers = {"Content-Type": "application/json"}
if HOSTED:
headers["Authorization"] = f"Bearer {os.getenv('NGC_API_KEY')}"
payload = {
"sequence": "SGSMKTAISLPDETFDRVSRRASELGMSRSEFFTKAAQR",
"databases": ["Uniref30_2302", "colabfold_envdb_202108"],
"e_value": 0.0001,
"output_alignment_formats": ["a3m"],
}
response = requests.post(url, headers=headers, json=payload, timeout=300)
response.raise_for_status()
result = response.json()Paired MSA Request
配对MSA请求
Use paired search for protein complexes; payload field is plural,
and output is .
sequencesalignments_by_chainpython
url = (
"https://health.api.nvidia.com/v1/biology/colabfold/msa-search/paired/predict"
if HOSTED else "http://localhost:8000/biology/colabfold/msa-search/paired/predict"
)
payload = {
"sequences": [chain_a_sequence, chain_b_sequence],
"e_value": 0.0001,
"output_alignment_formats": ["a3m"],
}请使用配对搜索分析蛋白质复合物;请求体字段为复数形式,输出为。
sequencesalignments_by_chainpython
url = (
"https://health.api.nvidia.com/v1/biology/colabfold/msa-search/paired/predict"
if HOSTED else "http://localhost:8000/biology/colabfold/msa-search/paired/predict"
)
payload = {
"sequences": [chain_a_sequence, chain_b_sequence],
"e_value": 0.0001,
"output_alignment_formats": ["a3m"],
}Local Template Search
本地模板搜索
Use local Docker for structural templates. Set unless
was changed.
max_msa_sequences=500NIM_GLOBAL_MAX_MSA_DEPTHpython
url = "http://localhost:8000/biology/colabfold/msa-search/structure-templates/predict"
headers = {"Content-Type": "application/json"}
payload = {
"sequence": "VLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGKKVADALTNAVA",
"structural_template_databases": ["pdb70_220313"],
"max_structures": 20,
"max_msa_sequences": 500,
}请使用本地Docker进行结构模板搜索。除非修改了,否则请设置。
NIM_GLOBAL_MAX_MSA_DEPTHmax_msa_sequences=500python
url = "http://localhost:8000/biology/colabfold/msa-search/structure-templates/predict"
headers = {"Content-Type": "application/json"}
payload = {
"sequence": "VLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGKKVADALTNAVA",
"structural_template_databases": ["pdb70_220313"],
"max_structures": 20,
"max_msa_sequences": 500,
}Save Outputs
保存输出结果
python
undefinedpython
undefinedStandard MSA: result["alignments"][database][format]["alignment"]
标准MSA:result["alignments"][database][format]["alignment"]
for db_name, formats in result.get("alignments", {}).items():
for fmt_name, data in formats.items():
with open(f"msa_{db_name}.{fmt_name}", "w", encoding="utf-8") as handle:
handle.write(data["alignment"])
for db_name, formats in result.get("alignments", {}).items():
for fmt_name, data in formats.items():
with open(f"msa_{db_name}.{fmt_name}", "w", encoding="utf-8") as handle:
handle.write(data["alignment"])
Paired MSA: one alignment set per chain
配对MSA:每条链对应一组比对结果
for chain_id, chain_data in result.get("alignments_by_chain", {}).items():
for db_name, formats in chain_data.items():
for fmt_name, data in formats.items():
with open(f"msa_chain_{chain_id}_{db_name}.{fmt_name}", "w", encoding="utf-8") as handle:
handle.write(data["alignment"])
for chain_id, chain_data in result.get("alignments_by_chain", {}).items():
for db_name, formats in chain_data.items():
for fmt_name, data in formats.items():
with open(f"msa_chain_{chain_id}_{db_name}.{fmt_name}", "w", encoding="utf-8") as handle:
handle.write(data["alignment"])
Template search: save mmCIF structures and M8 hit tables
模板搜索:保存mmCIF结构和M8命中表
for name, cif in result.get("structures", {}).items():
open(f"template_{name}.cif", "w", encoding="utf-8").write(cif)
for name, hit_table in result.get("search_hits", {}).items():
open(f"template_hits_{name}.m8", "w", encoding="utf-8").write(hit_table)
A3M output can feed OpenFold3, AlphaFold2, or RoseTTAFold. For alignment depth,
template, and sequence sanity checks, read `references/validation.md`.for name, cif in result.get("structures", {}).items():
open(f"template_{name}.cif", "w", encoding="utf-8").write(cif)
for name, hit_table in result.get("search_hits", {}).items():
open(f"template_hits_{name}.m8", "w", encoding="utf-8").write(hit_table)
A3M格式输出可用于OpenFold3、AlphaFold2或RoseTTAFold。如需了解比对深度、模板和序列合理性检查,请阅读`references/validation.md`。Limits And Troubleshooting
限制与故障排除
- Sequence length: 1-4096 amino acids; works since v2.3.0.
X - : 1-500; local GPU server default must match
max_msa_sequences.NIM_GLOBAL_MAX_MSA_DEPTH - Paired MSA requires at least two sequences.
- Local URL 404 usually means an accidental prefix.
/v1/ - First local run can take hours while databases populate .
LOCAL_NIM_CACHE
- 序列长度:1-4096个氨基酸;v2.3.0版本开始支持。
X - :1-500;本地GPU服务器默认值必须与
max_msa_sequences匹配。NIM_GLOBAL_MAX_MSA_DEPTH - 配对MSA至少需要两条序列。
- 本地URL返回404通常意味着意外添加了前缀。
/v1/ - 首次本地运行可能耗时数小时,因为数据库需要填充。
LOCAL_NIM_CACHE