Skip to content

Commit 7acfbbc

Browse files
feat: consolidate demux env into default and add edx concordance
Remove the separate `demux` pixi environment by merging WarpDemuX dependencies into the default env and unified setup script. Rename warpdemux.smk to demux.smk and add edx_concordance rule for cross-checking WDX barcode assignment vs 3' EDX adapter identity. Update all docs and config to reflect the simplified workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4d13970 commit 7acfbbc

File tree

15 files changed

+572
-892
lines changed

15 files changed

+572
-892
lines changed

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ The pipeline supports optional barcode demultiplexing using WarpDemuX for pooled
159159

160160
### Enabling Demultiplexing
161161

162-
1. **Install demux environment**: `pixi install -e demux && pixi run -e demux install-warpdemux`
162+
1. **Install WarpDemuX**: `pixi run setup` (installs WarpDemuX along with other tools)
163163
2. **Create YAML sample file** with barcode assignments (see `config/samples-demux-example.yml`)
164164
3. **Enable in config**: Set `warpdemux.enabled: true`
165165

@@ -185,10 +185,10 @@ runs:
185185
186186
```bash
187187
# Dry run with demux config
188-
pixi run -e demux snakemake -n --configfile=config/config-demux-test.yml
188+
pixi run snakemake -n --configfile=config/config-demux-test.yml
189189

190190
# Execute with demux
191-
pixi run -e demux snakemake --configfile=config/config-demux-test.yml --cores 8
191+
pixi run snakemake --configfile=config/config-demux-test.yml --cores 8
192192
```
193193

194194
## Charged vs Uncharged Classification

cluster/slurm/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ slurm-delete-logfiles-older-than: 10 # Days
1818
# Default resources for all rules
1919
default-resources:
2020
slurm_partition: "normal" # Default CPU partition (customize for your cluster)
21-
# slurm_account: "aatrnaseq" # SLURM account/allocation (customize for your cluster)
21+
slurm_account: "gpu_rbi" # SLURM account/allocation (customize for your cluster)
2222
runtime: 120 # Default walltime in minutes (2 hours)
2323
mem_mb: 8000 # Default memory in MB (8GB)
2424
cpus_per_task: 1 # Default CPUs per task

config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ warpdemux:
6969
Run with the demux environment:
7070

7171
```bash
72-
pixi run -e demux snakemake --configfile=config/config-demux.yml --cores 8
72+
pixi run snakemake --configfile=config/config-demux.yml --cores 8
7373
```
7474

7575
See `config-demux-test.yml` for a complete example.

config/config-demux-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Test config for WarpDemuX demultiplexing
22
#
33
# This config enables WarpDemuX barcode demultiplexing.
4-
# Use with: pixi run -e demux snakemake -n --configfile=config/config-demux-test.yml
4+
# Use with: pixi run snakemake -n --configfile=config/config-demux-test.yml
55

66
# Sample file in YAML format with barcode assignments
77
samples: config/samples-demux-test.yml

docs/troubleshooting/common-errors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,10 @@ warpdemux: command not found
352352

353353
**Solution:**
354354

355-
Install the demux environment (WarpDemuX is auto-installed on first use):
355+
Install WarpDemuX via the setup command:
356356

357357
```bash
358-
pixi install -e demux
358+
pixi run setup
359359
```
360360

361361
### Invalid Barcode Kit

docs/user-guide/running-pipeline.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,14 @@ pixi run snakemake --report report.html --configfile=config/config.yml
241241

242242
## With Demultiplexing
243243

244-
For demultiplexed samples, use the `demux` environment:
244+
For demultiplexed samples, ensure WarpDemuX is installed (`pixi run setup`), then run as usual:
245245

246246
```bash
247247
# Dry run
248-
pixi run -e demux snakemake -n --configfile=config/config-demux.yml
248+
pixi run snakemake -n --configfile=config/config-demux.yml
249249

250250
# Execute
251-
pixi run -e demux snakemake --profile cluster/lsf \
251+
pixi run snakemake --profile cluster/lsf \
252252
--configfile=config/config-demux.yml
253253
```
254254

docs/workflow/demultiplexing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ Do **not** use when:
3131

3232
## Setup
3333

34-
### 1. Install Demux Environment
34+
### 1. Install WarpDemuX
3535

3636
```bash
37-
pixi install -e demux
37+
pixi run setup
3838
```
3939

40-
This installs the demux environment dependencies. WarpDemuX itself is automatically installed on first use via the environment activation script.
40+
This installs WarpDemuX along with other pipeline tools (dorado, remora).
4141

4242
### 2. Create YAML Sample File
4343

@@ -213,17 +213,17 @@ Filters raw POD5 files by sample using read ID list.
213213
### Dry Run
214214

215215
```bash
216-
pixi run -e demux snakemake -n --configfile=config/config-demux.yml
216+
pixi run snakemake -n --configfile=config/config-demux.yml
217217
```
218218

219219
### Execute
220220

221221
```bash
222222
# Local
223-
pixi run -e demux snakemake --cores 12 --configfile=config/config-demux.yml
223+
pixi run snakemake --cores 12 --configfile=config/config-demux.yml
224224

225225
# Cluster
226-
pixi run -e demux snakemake --profile cluster/lsf --configfile=config/config-demux.yml
226+
pixi run snakemake --profile cluster/lsf --configfile=config/config-demux.yml
227227
```
228228

229229
## Output Structure
@@ -299,7 +299,7 @@ If barcode distribution is very unbalanced:
299299

300300
1. **Verify barcode distribution** before running full pipeline:
301301
```bash
302-
pixi run -e demux snakemake demux/read_ids/{run_id}/demux_summary.tsv.gz \
302+
pixi run snakemake demux/read_ids/{run_id}/demux_summary.tsv.gz \
303303
--configfile=config/config-demux.yml
304304
```
305305

pixi.lock

Lines changed: 376 additions & 834 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,20 @@ ont-modkit = "*"
3333
ruff = "*"
3434
yamllint = "*"
3535
nvitop = ">=1.6.2,<2"
36+
# WarpDemuX dependencies (compiled packages best from conda)
37+
dtaidistance = "*"
38+
scikit-learn = "*"
39+
scipy = "*"
40+
cython = "*"
41+
catboost = "*"
42+
ruptures = "*"
43+
bottleneck = "*"
3644

3745
[activation]
3846
scripts = ["scripts/setup-env.sh"]
3947

4048
[tasks]
41-
setup = { cmd = "bash scripts/setup-tools.sh && pixi run -e demux install-warpdemux", description = "One-time setup: install dorado, models, remora, and WarpDemuX" }
49+
setup = { cmd = "bash scripts/setup-tools.sh", description = "One-time setup: install dorado, models, remora, and WarpDemuX" }
4250
dl-test-data = { cmd = "cd .tests && bash dl_test_data.sh", description = "Download test data" }
4351
# Pipeline execution
4452
dry-run = { cmd = "snakemake -n --configfile=config/config-test.yml", description = "Dry run with test config" }
@@ -54,6 +62,9 @@ collapse-ref = { cmd = "python workflow/scripts/collapse_gtrndb_fasta.py", descr
5462
lint-snakefmt = { cmd = "snakefmt --check workflow/", description = "Check Snakemake formatting" }
5563
lint-python = { cmd = "ruff check workflow/scripts/ && ruff format --check workflow/scripts/", description = "Lint and check Python formatting" }
5664
lint-yaml = { cmd = "yamllint -d \"{extends: default, rules: {line-length: {max: 120}, document-start: disable}}\" config/ .github/", description = "Lint YAML files" }
65+
# WarpDemuX tasks
66+
install-warpdemux = { cmd = "bash -c '[ -d resources/tools/WarpDemuX ] || git clone --recursive https://github.com/KleistLab/WarpDemuX.git resources/tools/WarpDemuX' && uv pip install -e resources/tools/WarpDemuX", description = "Clone and install WarpDemuX" }
67+
dry-run-demux = { cmd = "snakemake -n --configfile=config/config-demux-test.yml", description = "Dry run demux test" }
5768

5869
# Testing feature
5970
[feature.test]
@@ -70,33 +81,6 @@ test-unit = { cmd = "pytest tests/unit/ -v --cov=workflow/scripts", description
7081
test-integration = { cmd = "pytest tests/integration/ -v", description = "Run integration tests" }
7182
test-all = { cmd = "pytest tests/ -v --cov=workflow/scripts", description = "Run all tests with coverage" }
7283

73-
# WarpDemuX demultiplexing feature
74-
[feature.demux]
75-
platforms = ["linux-64"]
76-
77-
[feature.demux.activation]
78-
scripts = ["scripts/demux-activate.sh"]
79-
80-
[feature.demux.dependencies]
81-
# WarpDemuX dependencies
82-
libstdcxx-ng = ">=12"
83-
pytorch = "*"
84-
dtaidistance = "*"
85-
scikit-learn = "*"
86-
scipy = "*"
87-
cython = "*"
88-
toml = "*"
89-
tqdm = "*"
90-
numpy = "<2"
91-
joblib = "*"
92-
bottleneck = "*"
93-
ruptures = "*"
94-
catboost = "*"
95-
96-
[feature.demux.tasks]
97-
install-warpdemux = { cmd = "bash -c '[ -d resources/tools/WarpDemuX ] || git clone --recursive https://github.com/KleistLab/WarpDemuX.git resources/tools/WarpDemuX' && uv pip install -e resources/tools/WarpDemuX", description = "Clone and install WarpDemuX" }
98-
dry-run-demux = { cmd = "snakemake -n --configfile=config/config-demux-test.yml", description = "Dry run demux test" }
99-
10084
# QC Report rendering feature
10185
[feature.report]
10286
platforms = ["linux-64"]
@@ -126,5 +110,4 @@ render-qc = { cmd = "snakemake render_all_qc_reports --configfile=config/config-
126110
[environments]
127111
default = []
128112
test = ["test"]
129-
demux = ["demux"]
130113
report = ["report"]

scripts/demux-activate.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)