Skip to content

Commit fb764b7

Browse files
fix: auto-install WarpDemuX on demux environment activation
- Add auto-install logic to scripts/demux-activate.sh that clones and installs WarpDemuX on first use if not already present - Remove erroneous $@ from warpdemux task in pixi.toml - Update installation instructions in docs to reflect automatic install Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 56bd30f commit fb764b7

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ The pipeline supports optional barcode demultiplexing using WarpDemuX for pooled
143143

144144
### Enabling Demultiplexing
145145

146-
1. **Install demux environment**: `pixi install -e demux && pixi run -e demux install-warpdemux`
146+
1. **Install demux environment**: `pixi install -e demux` (WarpDemuX is auto-installed on first use)
147147
2. **Create YAML sample file** with barcode assignments (see `config/samples-demux-example.yml`)
148148
3. **Enable in config**: Set `warpdemux.enabled: true`
149149

docs/troubleshooting/common-errors.md

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

353353
**Solution:**
354354

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

357357
```bash
358358
pixi install -e demux
359-
pixi run -e demux install-warpdemux
360359
```
361360

362361
### Invalid Barcode Kit

docs/workflow/demultiplexing.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ Do **not** use when:
3535

3636
```bash
3737
pixi install -e demux
38-
pixi run -e demux install-warpdemux
3938
```
4039

41-
This installs the WarpDemuX package and its dependencies.
40+
This installs the demux environment dependencies. WarpDemuX itself is automatically installed on first use via the environment activation script.
4241

4342
### 2. Create YAML Sample File
4443

pixi.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ catboost = "*"
8888

8989
[feature.demux.tasks]
9090
install-warpdemux = { cmd = "[ -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" }
91-
warpdemux = { cmd = "warpdemux $@", env = { LD_LIBRARY_PATH = "$CONDA_PREFIX/lib:$LD_LIBRARY_PATH" } }
91+
warpdemux = { cmd = "warpdemux", env = { LD_LIBRARY_PATH = "$CONDA_PREFIX/lib:$LD_LIBRARY_PATH" } }
9292
dry-run-demux = { cmd = "snakemake -n --configfile=config/config-demux-test.yml", description = "Dry run demux test" }
9393

9494
[environments]

scripts/demux-activate.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,14 @@
22
# Activation script for demux environment
33
# Ensures conda libraries take precedence over system libraries for PyTorch compatibility
44
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
5+
6+
# Auto-install WarpDemuX if not present
7+
if ! python -c "import warpdemux" 2>/dev/null; then
8+
echo "Installing WarpDemuX..."
9+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10+
REPO_DIR="$SCRIPT_DIR/../resources/tools/WarpDemuX"
11+
if [ ! -d "$REPO_DIR" ]; then
12+
git clone --recursive https://github.com/KleistLab/WarpDemuX.git "$REPO_DIR"
13+
fi
14+
uv pip install -e "$REPO_DIR"
15+
fi

0 commit comments

Comments
 (0)