update location
This commit is contained in:
141
tools/bttoxin_digger/README.md
Normal file
141
tools/bttoxin_digger/README.md
Normal file
@@ -0,0 +1,141 @@
|
||||
# BtToxin_Digger (pixi) reproduction & Docker Image
|
||||
|
||||
This repo is a **reproducible runtime environment** for BtToxin_Digger 1.0.10, packaged as a Docker image based on `ghcr.io/prefix-dev/pixi`.
|
||||
|
||||
It includes:
|
||||
1. **BtToxin_Digger 1.0.10** (installed via Pixi)
|
||||
2. **BLAST+ 2.16.0** (compatible with v5 databases)
|
||||
3. **Pre-bundled BtToxin Database** (baked into the image)
|
||||
|
||||
## License / Citation / Disclaimer
|
||||
|
||||
- **BtToxin_Digger** is developed by its original authors; cite the upstream publication if you use it in research.
|
||||
- **This repository** only provides an environment wrapper (pixi/docker); it does not modify BtToxin_Digger source code.
|
||||
|
||||
## 1. Quick Start with Docker
|
||||
|
||||
The easiest way to run this is using the included `docker-compose.yml` or the global project configuration.
|
||||
|
||||
### Build the Image
|
||||
|
||||
```bash
|
||||
# In this directory
|
||||
docker compose build
|
||||
```
|
||||
|
||||
### Run Analysis
|
||||
|
||||
Place your input `.fna` files in `examples/inputs` (or mount your own directory), then run:
|
||||
|
||||
```bash
|
||||
# Run help
|
||||
docker compose run --rm digger-repro pixi run BtToxin_Digger --help
|
||||
|
||||
# Run analysis on a specific file
|
||||
# Note: Input path must match the internal mount point (/app/jobs)
|
||||
docker compose run --rm digger-repro pixi run BtToxin_Digger \
|
||||
--SeqPath /app/jobs \
|
||||
--Scaf_suffix .fna \
|
||||
--threads 4
|
||||
```
|
||||
|
||||
### Directory Mounting
|
||||
|
||||
- `/app/jobs`: Mount your input sequence files here.
|
||||
- `/app/data`: Mount your desired output directory here (if using absolute paths in arguments).
|
||||
|
||||
## 2. Docker Image Construction
|
||||
|
||||
The image is built using `docker/Dockerfile`.
|
||||
|
||||
### Base Image
|
||||
Uses `ghcr.io/prefix-dev/pixi:latest` to ensure a consistent conda-compatible environment.
|
||||
|
||||
### Database Integration
|
||||
The external database (`external_dbs/bt_toxin`) is **copied into the image** during build time.
|
||||
Target location: `/app/.pixi/envs/default/bin/BTTCMP_db/bt_toxin`
|
||||
|
||||
This replaces the default database shipped with the bioconda package, ensuring:
|
||||
1. Latest toxin definitions are used.
|
||||
2. BLAST v5 indices are compatible with the installed BLAST+ 2.16.0.
|
||||
|
||||
### Environment Definition (`pixi.toml`)
|
||||
- `bttoxin_digger = "==1.0.10"`
|
||||
- `perl = "==5.26.2"` (Legacy requirement)
|
||||
- `blast = "==2.16.0"` (Upgraded for v5 DB support)
|
||||
- `channel-priority = "disabled"`
|
||||
|
||||
## 3. Development / Manual Usage
|
||||
|
||||
If you want to run without Docker using local Pixi:
|
||||
|
||||
```bash
|
||||
# Install environment
|
||||
pixi install
|
||||
|
||||
# Link the database (required manually if not using Docker)
|
||||
# The Dockerfile does this automatically by copying files.
|
||||
ENV_BIN=.pixi/envs/default/bin
|
||||
rm -rf "$ENV_BIN/BTTCMP_db/bt_toxin"
|
||||
ln -sfn $(pwd)/external_dbs/bt_toxin "$ENV_BIN/BTTCMP_db/bt_toxin"
|
||||
|
||||
# Run
|
||||
pixi run BtToxin_Digger --help
|
||||
```
|
||||
|
||||
## 4. Repository Layout
|
||||
|
||||
```
|
||||
.
|
||||
├── docker/
|
||||
│ └── Dockerfile # Docker build definition
|
||||
├── docker-compose.yml # Local test orchestration
|
||||
├── external_dbs/ # Database source (copied into image)
|
||||
│ └── bt_toxin/ # The actual database files
|
||||
├── pixi.toml # Environment dependencies
|
||||
├── pixi.lock # Exact version lock
|
||||
└── examples/ # Test inputs and outputs
|
||||
```
|
||||
|
||||
## 5. Updating the Database (Important for Future Updates)
|
||||
|
||||
The database consists of two parts in `external_dbs/bt_toxin`:
|
||||
1. **`seq/` Directory**: Contains the raw FASTA sequence files (e.g., `bt_toxin20251104.fas`).
|
||||
2. **`db/` Directory**: Contains the BLAST indices (`.phr`, `.pin`, `.psq`) generated from the sequences.
|
||||
|
||||
**Relationship**: The files in `db/` are **generated from** the FASTA files in `seq/` using `makeblastdb`. The filename of the source FASTA (e.g., `bt_toxin20251104.fas`) is embedded in the `db` files metadata.
|
||||
|
||||
### How to Update (e.g., for 2026/2027 data)
|
||||
|
||||
If a new database version is released (e.g., from https://github.com/liaochenlanruo/BtToxin_Digger), follow these steps:
|
||||
|
||||
1. **Download New Sequences**:
|
||||
Place the new FASTA file (e.g., `bt_toxin2026xxxx.fas`) into `external_dbs/bt_toxin/seq/`.
|
||||
|
||||
2. **Generate New Indices (Critical Step)**:
|
||||
You must regenerate the indices in `external_dbs/bt_toxin/db/`. You can use a temporary container or local BLAST+ to do this.
|
||||
|
||||
```bash
|
||||
# Example using the local pixi environment (if installed)
|
||||
# Or use a container with blast installed
|
||||
makeblastdb \
|
||||
-in external_dbs/bt_toxin/seq/bt_toxin2026xxxx.fas \
|
||||
-dbtype prot \
|
||||
-out external_dbs/bt_toxin/db/bt_toxin \
|
||||
-parse_seqids
|
||||
```
|
||||
|
||||
*Note: The `-out` parameter must end with `bt_toxin` to match what the tool expects.*
|
||||
|
||||
3. **Rebuild Docker Image**:
|
||||
The Dockerfile copies `external_dbs/bt_toxin` into the image. You must rebuild it to include the changes.
|
||||
|
||||
```bash
|
||||
docker compose build --no-cache
|
||||
```
|
||||
|
||||
4. **Verify**:
|
||||
Check the database version inside the new container:
|
||||
```bash
|
||||
docker compose run --rm digger-repro pixi run blastdbcmd -db /app/.pixi/envs/default/bin/BTTCMP_db/bt_toxin/db/bt_toxin -info
|
||||
```
|
||||
Reference in New Issue
Block a user