60 Commits

Author SHA1 Message Date
zly
d66abf1596 refactor(docker): rename postgres service to avoid DNS conflicts
- Rename service from 'postgres' to 'bttoxinpostgres'
- Rename container from 'bttoxin-postgres' to 'bttoxinpostgres'
- Update DATABASE_URL references to use new container name
- Prevents DNS collision with other projects on shared frontend network

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 21:04:36 +08:00
zly
41a6fa976c chore: remove .claude/ from git tracking
Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 20:33:37 +08:00
zly
8e0deb1691 feat: add base_prokka tool and CRISPR-Cas analysis source code
- Add base_prokka genome annotation tool with pixi config
- Add CRISPR-Cas analysis src (CRISPRCasFinder.pl, environment config)
- Add test data and documentation

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 20:31:00 +08:00
zly
ef09a1c5d5 chore: add .claude/ to gitignore
Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 20:26:47 +08:00
zly
963215de2d Fix(pipeline): prevent nested zip packaging and update CRISPR dependencies
- Add filter to skip .zip and .tar.gz files when creating result archive
- Update CRISPR feature with CASFinder dependencies (hmmer, blast, vmatch, etc.)
- Add install-casfinder task for macsydata installation
- Remove obsolete CRISPR test files

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 20:06:41 +08:00
zly
e44692600c Fix(pipeline): optimize docker build, fix zip structure, and update UI
- Docker:
  - Explicitly install pixi environments (digger, pipeline, webbackend) during build to prevent runtime network/DNS failures.
  - Optimize pnpm config (copy method) to fix EAGAIN errors.
- Backend:
  - Refactor ZIP bundling: use flat semantic directories (1_Toxin_Mining, etc.).
  - Fix "nested zip" issue by cleaning existing archives before bundling.
  - Exclude raw 'context' directory from final download.
- Frontend:
  - Update TutorialView documentation to match new result structure.
  - Improve TaskMonitor progress bar precision (1 decimal place).
  - Update i18n (en/zh) for new file descriptions.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-21 20:43:28 +08:00
zly
452e15c806 Fix(docker): optimize pnpm build and explicitly set image tag
- Update Dockerfile:
  - Add `package-import-method copy` to pnpm config to resolve EAGAIN errors during build.
  - Optimize pnpm network concurrency settings.
- Update docker-compose.yml:
  - Explicitly set `image: hotwa/bttoxin-app:latest` for services.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-21 00:40:34 +08:00
zly
c75c85c53b Refactor: Unified pipeline execution, simplified UI, and fixed Docker config
- Backend: Refactored tasks.py to directly invoke run_single_fna_pipeline.py for consistency.
- Backend: Changed output format to ZIP and added auto-cleanup of intermediate files.
- Backend: Fixed language parameter passing in API and tasks.
- Frontend: Removed CRISPR Fusion UI elements from Submit and Monitor views.
- Frontend: Implemented simulated progress bar for better UX.
- Frontend: Restored One-click load button and added result file structure documentation.
- Docker: Fixed critical Restarting loop by removing incorrect image directive in docker-compose.yml.
- Docker: Optimized Dockerfile to correct .pixi environment path issues and prevent accidental deletion of frontend assets.
2026-01-20 20:25:25 +08:00
zly
5067169b0b update location 2026-01-18 22:37:19 +08:00
zly
c9be0694ab Update shotter math documentation with Logit Prior algorithm 2026-01-18 20:34:03 +08:00
zly
e23731f6ca Update docs with new directory structure
- Updated AGENTS.md and README.md to reflect:
  - Removal of motia-backend
  - Moving bttoxin_digger_v5_repro to tools/reproduction/
  - Added crispr_cas to structure
2026-01-17 13:13:31 +08:00
zly
166af50219 Move digger reproduction env to tools/reproduction/
- Moved bttoxin_digger_v5_repro to tools/reproduction/bttoxin_digger
- Updated docker-compose.yml to point to the new location
- This declutters the root directory while preserving the reproduction environment
2026-01-17 13:11:16 +08:00
zly
33f44e2df0 Remove Motia dependencies and references from frontend 2026-01-17 13:06:17 +08:00
zly
194f4d2fcb Remove motia-backend module
This module is no longer needed as requested.
2026-01-17 13:02:47 +08:00
zly
3ed9558bac docs: add AGENTS.md for BtToxin_Digger reproduction guide 2026-01-17 12:38:24 +08:00
zly
700bdb8307 feat(digger): containerize BtToxin_Digger with v5 database integration
- Added Dockerfile and docker-compose.yml for BtToxin_Digger
- Integrated external v5 BLAST database into the container image
- Updated main docker-compose.yml to include the digger service
- Updated documentation with database update instructions
2026-01-17 12:14:39 +08:00
zly
6f2365981d chore: update pixi lockfile with new dependencies 2026-01-14 15:59:29 +08:00
zly
59d7f8e051 feat(worker): integrate CRISPR-Cas pipeline execution logic 2026-01-14 15:57:12 +08:00
zly
92b01b408f feat(frontend): integrate CRISPR controls and fix i18n 2026-01-14 15:55:41 +08:00
zly
e652c0975b docs: add frontend crispr integration tasks to plan 2026-01-14 15:48:45 +08:00
zly
7090676f46 feat(backend): implement CRISPR-Cas API parameters and database schema 2026-01-14 15:47:35 +08:00
zly
74ca20707c feat(crispr): implement CRISPR-Cas detection and fusion analysis module 2026-01-14 15:34:45 +08:00
zly
a43269be50 feat: enable swagger ui at /api/docs 2026-01-14 15:25:31 +08:00
zly
e3c524c351 feat(deploy): enable automatic lets encrypt certificates 2026-01-14 15:18:00 +08:00
zly
29bedcbe94 chore: update .gitignore to exclude ralph agent state files 2026-01-14 14:58:20 +08:00
zly
96598b9d25 fix(backend): serve frontend at root path and move meta info to /api/meta 2026-01-14 14:57:11 +08:00
zly
39765e4782 docs: update fix plan with network configuration fix 2026-01-14 14:42:27 +08:00
zly
65ba1d938d refactor(docker): standardize docker network name to 'frontend'
- Replace 'traefik-network' with 'frontend' in docker-compose.traefik.yml
- Replace 'traefik-network' with 'frontend' in switch-to-traefik.sh
- Replace 'your-main-network' with 'frontend' in DOCKER_DEPLOYMENT.md examples
- Ensure consistency across Docker configuration and documentation

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 14:39:57 +08:00
zly
9835b6e341 feat(deploy): fix docker deployment and add backend i18n
- Docker Deployment Fixes:
  - Switch base images to docker.m.daocloud.io to resolve registry 401 errors
  - Add Postgres and Redis services to docker-compose.traefik.yml
  - Fix frontend build: replace missing icons (Globe->Location, Chart->TrendCharts)
  - Fix frontend build: resolve pnpm CI/TTY issues and frozen lockfile errors
  - Add missing backend dependencies (sqlalchemy, psycopg2, redis-py, celery, docker-py) in pixi.toml
  - Ensure database tables are created on startup (lifespan event)

- Backend Internationalization (i18n):
  - Add backend/app/core/i18n.py for locale handling
  - Update API endpoints (jobs, tasks, uploads, results) to return localized messages
  - Support 'Accept-Language' header (en/zh)

- Documentation:
  - Update DOCKER_DEPLOYMENT.md with new architecture and troubleshooting
  - Update AGENTS.md with latest stack details and deployment steps
  - Update @fix_plan.md status

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 12:38:54 +08:00
zly
c0f2de02ca docs: update fix_plan.md - mark CRISPR-Cas tasks complete 2026-01-14 09:49:08 +08:00
zly
89ed5cfa1a feat(crispr): reserve CRISPR-Cas module infrastructure for future implementation\n\n- Add [feature.crispr] environment to pixi.toml (commented, ready to activate)\n- Create comprehensive CRISPR implementation plan document\n- Document 4-phase implementation roadmap:\n * Phase 1: CRISPR detection using CRISPRCasFinder\n * Phase 2: Spacer-toxin gene association analysis\n * Phase 3: Integration with shoter scoring (reserved parameters)\n * Phase 4: Enhanced visualization\n- Define data structures, API contracts, and usage examples\n- Document scientific background and testing strategy\n\nStatus: RESERVED - not yet implemented, all infrastructure prepared for future activation.\n\nCo-Authored-By: Claude <noreply@anthropic.com> 2026-01-13 23:55:12 +08:00
zly
029e49bf6a docs: update fix_plan.md with Docker deployment tasks 2026-01-13 23:50:06 +08:00
zly
1a1ba71777 feat(docker): add SPA static file serving and fix Dockerfile paths\n\n- Add backend/app/main_spa.py with FastAPI static file serving for SPA\n- Fix Dockerfile.traefik to use correct backend path (backend.app.main_spa)\n- Remove web/ references (project has backend/ at root)\n- Frontend dist files served from /app/frontend/dist\n- Health check endpoint at /health\n- Supports Traefik reverse proxy at bttiaw.hzau.edu.cn\n\nCo-Authored-By: Claude <noreply@anthropic.com> 2026-01-13 23:49:19 +08:00
zly
af83b5fba8 docs: update fix_plan.md - mark B3.3 protein support as complete 2026-01-13 23:45:55 +08:00
zly
80e7d1ffb6 feat(scripts): add protein file (.faa) support to pipeline\n\n- Add detect_sequence_type() function for automatic file type detection\n- Rename run_single_fna_pipeline() to run_single_file_pipeline()\n- Add backward compatibility alias for existing callers\n- Add --input CLI argument (preferred over --fna)\n- Support .faa protein files alongside .fna/.fa/.fasta genome files\n- Auto-detect sequence type and pass correct suffix to BtToxin_Digger\n- Update documentation with protein file examples\n\nCo-Authored-By: Claude <noreply@anthropic.com> 2026-01-13 23:45:34 +08:00
zly
7379c98fac docs: update fix_plan.md with completed backend tasks 2026-01-13 23:41:45 +08:00
zly
d4f0e27af8 feat(backend): add missing API endpoints, concurrency control, and queue management\n\n- Add /api/v1/tasks router for task management\n- Add DELETE endpoint for task deletion\n- Add GET /download endpoint for result bundling (tar.gz)\n- Add GET /queue endpoint for queue position queries\n- Create ConcurrencyManager service with Redis Semaphore (16 concurrent limit)\n- Add QUEUED status to JobStatus enum\n- Update Job model with queue_position, current_stage, progress_percent fields\n- Add scoring parameters (min_identity, min_coverage, etc.) to jobs API\n- Implement pipeline stages: digger -> shoter -> plots -> bundle\n- Add update_queue_positions Celery task for periodic queue updates\n- Clean up duplicate code in main.py\n\nCo-Authored-By: Claude <noreply@anthropic.com> 2026-01-13 23:41:15 +08:00
zly
1df699b338 docs: add ralph-runner Claude Skill
- SKILL.md: Complete documentation for Ralph automation
- scripts/status.sh: Check project and Ralph status
- scripts/start.sh: Start Ralph loop with options
- scripts/commit.sh: Git commit helper
- README.md: Skill usage guide

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 17:31:51 +08:00
zly
75c7db8684 docs: add Ralph project structure
- PROMPT.md: Ralph development instructions with BtToxin Pipeline specifics
- specs/requirements.md: Technical specifications (API, file formats, concurrency)
- @AGENT.md: Build, test, and deployment commands

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 17:26:23 +08:00
zly
547328ad44 feat(frontend): add i18n support and navigation
- Install vue-i18n and configure locales (zh/en)
- Add complete navigation bar with 5 items: Home, About, Submit, Status, Tool Guide
- Add language switcher (中文/EN) with localStorage persistence
- Create HomeView with hero section, features, and quick links
- Create AboutView with features and usage guide
- Create ToolInfoView explaining BtToxin_Shoter principles (no formulas, no Digger)
- Update TaskSubmitForm: single file upload, genome/protein toggle, tooltips
- Update TaskMonitorView: i18n, queue status display
- Add queue_position field to TaskStatusResponse type

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:57:03 +08:00
zly
e19f51c660 docs: add @fix_plan.md task list
- Add high/medium/low priority tasks
- Cover frontend i18n, upload, status pages
- Cover backend FastAPI, concurrency, multi-format support
- Include CRISPR-Cas design预留

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:50:44 +08:00
zly
fe353fc0bc chore: 初始版本提交 - 简化架构 + 轮询改造
- 移除 Motia Streams 实时通信,改用 3 秒轮询
- 简化前端代码,移除冗余组件
- 简化后端架构,准备 FastAPI 重构
- 更新 pixi.toml 环境配置
- 保留 bttoxin_digger_v5_repro 作为参考文档

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:50:09 +08:00
4c9a7d0978 docs: 添加中文文档,新增前端和后端代码
- 新增 README_CN.md 中文文档
- 新增 frontend/ Vue 3 前端项目
- 新增 web/ FastAPI 后端项目

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 22:31:06 +08:00
4267bda227 feat: 添加 frontend 和 webbackend 开发环境配置
- 新增 frontend 环境:Vue 3 + Vite + Element Plus
- 新增 webbackend 环境:FastAPI
- 更新 README 开发文档

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 22:29:37 +08:00
665506e1a5 docs: add pipeline architecture diagrams
- Add bttoxin-pipeline.png and .svg workflow diagrams
2026-01-08 17:00:14 +08:00
a5cb891d0e chore: clean up obsolete test data files
- Remove ncbi_dataset download files
- Remove outdated test documentation
2026-01-08 16:59:42 +08:00
8d11216481 docs: update README and add pixi-based tests
- Add property-based tests for PixiRunner
- Add HAN055.fna test data file
- Update README with pixi installation and usage guide
- Update .gitignore for pixi and test artifacts
- Update CLI to remove Docker-related arguments
2026-01-08 16:59:17 +08:00
ae4c6351d9 feat: migrate from Docker to pixi for BtToxin_Digger execution
- Add pixi.toml with digger and pipeline environments
- Implement PixiRunner class replacing DockerContainerManager
- Add run_digger_stage.py for standalone digger execution
- Update run_single_fna_pipeline.py to use PixiRunner
- Remove docker dependency from pyproject.toml
- Delete docker_client.py (no longer needed)

BREAKING CHANGE: Docker is no longer required. Use 'pixi install' instead.
2026-01-08 16:58:45 +08:00
1c0e8f90a5 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)
2026-01-04 14:37:49 +08:00
5883e13c56 feat(shotter): 实现 Shotter v1 活性评估与单 FNA 流程,新增 API/CLI/绘图与报告
- 新增 scripts/bttoxin_shoter.py:从 BPPRC 正样本 CSV 构建 name/亚家族/家族特异性索引,
  解析 BtToxin_Digger All_Toxins.txt,计算 per-hit 权重并以 noisy-OR 合成菌株×目标目/物种分数,
  输出 TSV/JSON;含 HMM 加成与配对毒素规则(Vip1/Vip2,Vpa/Vpb),other/unknown 桶。
- 新增端到端工具链:
  - scripts/run_single_fna_pipeline.py:Digger → Shotter → Plot → 打包
  - scripts/plot_shotter.py:绘制热图并生成论文式/摘要式报告
  - scripts/bttoxin_api.py 与 bttoxin/api.py:纯 Python API;bttoxin/cli.py 暴露 bttoxin-run
  - pyproject.toml:项目打包与 CLI 入口
- docs(README): 增加输入文件格式与结果解读,补充单目录写入方案
- chore(gitignore): 忽略 runs/ 与 tests/output
- ci: 移除 .woodpecker/test.yml
2025-12-01 10:11:26 +08:00