feat: 支持绑定外部 bt_toxin 数据库 (2025-11-04 更新)
- docker_client.py: run_bttoxin_digger() 新增 bttoxin_db_dir 参数,支持挂载外部数据库 - run_single_fna_pipeline.py: 新增 --bttoxin_db_dir 参数,自动检测 external_dbs/bt_toxin - README.md: 添加 bttoxin_db 更新说明和 Docker 绑定文档 - external_dbs/bt_toxin: 添加 2025-11-04 版本数据库文件 测试验证: HAN055 样本毒素命名版本号变化 (Cry2Aa9→22, Cry2Ab35→41, Cry1Ia40→42, Vip3Aa7→79)
This commit is contained in:
@@ -151,9 +151,19 @@ class DockerContainerManager:
|
||||
sequence_type: str = "nucl",
|
||||
scaf_suffix: str = ".fna",
|
||||
threads: int = 4,
|
||||
bttoxin_db_dir: Optional[Path] = None,
|
||||
**kwargs: Any,
|
||||
) -> Dict[str, Any]:
|
||||
"""在容器中运行 BtToxin_Digger 主分析(单目录方案)。"""
|
||||
"""在容器中运行 BtToxin_Digger 主分析(单目录方案)。
|
||||
|
||||
Args:
|
||||
bttoxin_db_dir: 外部 bt_toxin 数据库目录路径(可选)。
|
||||
若提供,将绑定到容器内 /usr/local/bin/BTTCMP_db/bt_toxin,
|
||||
覆盖容器内置的旧数据库。目录结构应为:
|
||||
bt_toxin/
|
||||
├── db/ (BLAST 索引文件)
|
||||
└── seq/ (序列源文件)
|
||||
"""
|
||||
|
||||
# 1) 在宿主输出目录下准备 input_files,并复制输入文件
|
||||
work_input_dir = (output_dir / "input_files").resolve()
|
||||
@@ -239,12 +249,24 @@ class DockerContainerManager:
|
||||
if kwargs.get("assemble_only"):
|
||||
base_cmd.append("--assemble_only")
|
||||
|
||||
# 2) 只挂载输出目录(含 input_files)与日志目录
|
||||
# 2) 挂载输出目录(含 input_files)、日志目录、以及可选的外部数据库
|
||||
volumes = {
|
||||
str(output_dir.resolve()): {"bind": "/workspace", "mode": "rw"},
|
||||
str(log_dir.resolve()): {"bind": "/data/logs", "mode": "rw"},
|
||||
}
|
||||
|
||||
# 绑定外部 bt_toxin 数据库(覆盖容器内置旧库)
|
||||
if bttoxin_db_dir is not None:
|
||||
db_path = Path(bttoxin_db_dir).resolve()
|
||||
if db_path.exists() and (db_path / "db").exists():
|
||||
volumes[str(db_path)] = {
|
||||
"bind": "/usr/local/bin/BTTCMP_db/bt_toxin",
|
||||
"mode": "ro",
|
||||
}
|
||||
logger.info(f"绑定外部数据库: {db_path} -> /usr/local/bin/BTTCMP_db/bt_toxin")
|
||||
else:
|
||||
logger.warning(f"外部数据库目录不存在或结构不完整: {bttoxin_db_dir}")
|
||||
|
||||
logger.info("开始 BtToxin_Digger 分析...")
|
||||
|
||||
final_cmd = base_cmd
|
||||
|
||||
Reference in New Issue
Block a user