2025-11-21 20:23:15 +08:00
2025-10-13 22:10:36 +08:00
2025-10-13 21:05:00 +08:00
2025-11-21 20:23:15 +08:00
2025-10-13 21:05:00 +08:00
2025-10-13 21:05:00 +08:00
2025-10-13 21:05:00 +08:00
2025-10-13 21:05:00 +08:00

BtToxin Pipeline

Automated Bacillus thuringiensis toxin mining system with CI/CD integration.

Quick Start (单机部署)

uv .venv

uv venv --managed-python -p 3.12 --seed .venv
uv pip install backend/requirements.txt

Prerequisites

  • Docker / Podman
  • Python 3.10+
  • Node.js 18+

Development Setup

# 1. Clone and setup
git clone <your-repo>
cd bttoxin-pipeline

# 2. 使用 Makefile 初始化与启动(单机)
make setup
make start

# 3. 初始化数据库(创建表)
make db-init

# 4. 访问服务
# API:     http://localhost:8000/docs
# Flower:  http://localhost:5555
# Frontend:http://localhost:3000

# (可选) 本地开发
# Backend: uvicorn app.main:app --reload
# Frontend: npm run dev

Architecture

Nginx (Reverse Proxy) ├── Frontend (Vue 3 Static) └── Backend (FastAPI + Swagger) ├── PostgreSQL (SQLModel via SQLAlchemy) ├── Redis (Broker/Result) ├── Celery (Worker/Beat + Flower) └── Docker Engine (BtToxin_Digger)

Documentation

  • API 文档: 浏览器打开 http://localhost:8000/docs
  • 单机编排: docker/docker-compose.yml(唯一来源)
  • 环境变量示例: backend/.env.example
  • 常用命令: make help

macOS + Podman 使用注意事项

  • Podman 在 macOS 上通过虚拟机运行,宿主目录绑定到容器时,写权限可能受限。
  • 我们已在运行逻辑中对 macOS 进行特殊处理:将输入复制到容器内 /tmp/input,在 /tmp 执行 BtToxin_Digger结束后把 Results/ 与关键输出复制回挂载的 /workspace(宿主输出目录)。
  • 如仍遇写入问题:
    • 在 Podman Desktop 的虚拟机共享目录中,添加项目路径并开启写权限。
    • 如需,启用 rootful 模式并重启:podman machine stop && podman machine set --rootful && podman machine start
    • 手动验证挂载:podman run --rm -v $(pwd)/tests/output:/workspace:rw alpine sh -lc 'echo ok > /workspace/test.txt && ls -l /workspace'

本地离线容器测试(可选)

使用 scripts/test_bttoxin_digger.py 最小测试:

uv run python scripts/test_bttoxin_digger.py

要求:tests/test_data 下存在 97-27.fnaC15.fna,测试成功后在 tests/output/Results/Toxins 看到 6 个关键文件。

单目录方案(跨平台稳定写入)

  • 运行前,程序会将输入文件复制到宿主输出目录下的 input_files/ 子目录;容器仅挂载该输出目录(读写)为 /workspace
  • 工具运行时的 --SeqPath 指向 /workspace/input_files,工作目录也固定在 /workspace;所有结果与中间文件都会落在宿主的 tests/output/ 下。

目录示例:

tests/output/
├── input_files/          # 输入文件副本
│   ├── 97-27.fna
│   └── C15.fna
├── Results/              # BtToxin_Digger 输出
│   └── Toxins/
│       ├── 97-27.list
│       ├── 97-27.gbk
│       └── ...
├── StatsFiles/           # 统计文件(如有)
├── All_Toxins.txt
└── BtToxin_Digger.log

License

MIT License

Description
Automated Bacillus thuringiensis toxin mining system with CI/CD integration.
Readme 21 MiB
Languages
Python 44%
Perl 33.7%
Vue 13.2%
TypeScript 4.4%
Shell 2.6%
Other 2%