Skip to content

Commit 1f92f6e

Browse files
druvusclaude
andcommitted
docs: update documentation for dependency checking and pre-flight validation
Add check-deps command to installation guides, new dependency management section to README, missing dependencies troubleshooting entries, changelog entries for unreleased features, and update test counts to 902/40. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 63d44c0 commit 1f92f6e

6 files changed

Lines changed: 112 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- **Dependency Checking**: New `nanorunner check-deps` command that reports the status
12+
of all required and optional dependencies with conda install instructions.
13+
- **Pre-flight Validation**: Automatic validation before long-running operations
14+
(`generate`, `download`) catches missing tools (badread, nanosim, datasets CLI)
15+
before work begins, with actionable error messages.
16+
- **Subprocess Error Wrapping**: External tool failures (badread, nanosim) now produce
17+
clear error messages including exit codes, stderr output, and install hints instead
18+
of bare tracebacks.
19+
- **Centralized Install Hints**: New `deps.py` module provides a single source of truth
20+
for dependency install instructions, replacing scattered hardcoded strings.
21+
- **Robust Backend Detection**: `is_available()` for badread and nanosim now verifies
22+
tools can actually start (catches broken installs where the binary exists but
23+
dependencies like edlib are missing).
24+
1025
### Changed
26+
- **Install Instructions**: Standardized all install hints to use conda/bioconda
27+
channels instead of pip (e.g., `conda install -c conda-forge -c bioconda badread`).
1128
- **Breaking: Pipeline Adapters**: Removed `miniknife` adapter (fictional pipeline
1229
with no published tool). Renamed `nanometanf` adapter to `nanometa` to align with
1330
the published Nanometa Live tool. Both built-in adapters (`nanometa`, `kraken`) are

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ pip install -e .[enhanced,dev]
6969
```bash
7070
nanorunner --version # Should output: nanorunner 2.0.2
7171
nanorunner --help # Display all available subcommands
72+
nanorunner check-deps # Check all dependencies and show install hints
7273
nanorunner list-profiles # Show built-in configuration profiles
7374
nanorunner list-generators # Show available read generation backends
7475
nanorunner list-mocks # Show available mock communities
@@ -391,14 +392,28 @@ Built-in adapters provide validation for multiple bioinformatics workflows:
391392
- **kraken**: Kraken2/KrakenUniq taxonomic classification pipeline
392393
- **Generic**: Customizable adapter for arbitrary pipeline requirements
393394

395+
## Dependency Management
396+
397+
NanoRunner's core functionality (replay mode, built-in read generation) has no external dependencies beyond the Python standard library. Optional tools extend its capabilities:
398+
399+
| Dependency | Purpose | Install |
400+
|-----------|---------|---------|
401+
| psutil | Enhanced resource monitoring | `conda install -c conda-forge psutil` |
402+
| numpy | Vectorized read generation | `conda install -c conda-forge numpy` |
403+
| badread | Nanopore read simulation with error models | `conda install -c conda-forge -c bioconda badread` |
404+
| nanosim | Statistical read simulation | `conda install -c conda-forge -c bioconda nanosim` |
405+
| datasets | NCBI genome downloads (`--species`, `--mock`) | `conda install -c conda-forge ncbi-datasets-cli` |
406+
407+
Use `nanorunner check-deps` to see the status of all dependencies and install instructions for missing ones. Pre-flight validation catches missing dependencies before long-running operations begin, providing actionable error messages.
408+
394409
## Technical Requirements
395410

396411
- **Python**: Version 3.9 or higher
397412
- **Core dependencies**: Standard library only for basic functionality (including built-in read generation)
398413
- **Enhanced features**: Optional psutil dependency for resource monitoring
399414
- **Optional read generators**: badread and/or NanoSim for higher-fidelity read simulation
400415
- **Platform compatibility**: POSIX-compliant operating systems (Linux, macOS, Unix)
401-
- **Testing**: 730 tests across 37 test files
416+
- **Testing**: 902 tests across 40 test files
402417

403418
## Development and Contribution
404419

@@ -457,7 +472,8 @@ Common issues and solutions:
457472
- **Python version errors**: Ensure Python 3.9+ is installed
458473
- **Permission denied**: Use `--user` flag or check target directory permissions
459474
- **Import errors**: Verify installation with `pip show nanorunner`
460-
- **Enhanced monitoring unavailable**: Install with `pip install "nanorunner[enhanced] @ git+..."`
475+
- **Missing dependencies**: Run `nanorunner check-deps` to identify missing tools and install instructions
476+
- **Enhanced monitoring unavailable**: Install psutil with `conda install -c conda-forge psutil`
461477

462478
For detailed troubleshooting steps, see [docs/troubleshooting.md](docs/troubleshooting.md).
463479

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Comprehensive guides and references for the NanoRunner nanopore sequencing simul
3838
- **[Testing Guide](testing.md)**: Comprehensive guide covering test categories, running tests, organization, and contributing
3939

4040
### Current Status
41-
- **Test Count**: 730 tests across 37 test files
41+
- **Test Count**: 902 tests across 40 test files
4242
- **Coverage**: 97% on core components
4343

4444
## Quick Links

docs/quickstart.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ nanorunner --version
2222

2323
nanorunner --help
2424
# Shows all available subcommands
25+
26+
nanorunner check-deps
27+
# Shows status of all dependencies with install hints for missing ones
2528
```
2629

2730
---
@@ -488,7 +491,8 @@ nanorunner generate --mock zymo_d6300 -t /target
488491
# Replay with pipeline validation
489492
nanorunner replay -s /source -t /target --pipeline nanometa
490493

491-
# List options
494+
# List options and check dependencies
495+
nanorunner check-deps
492496
nanorunner list-profiles
493497
nanorunner list-adapters
494498
nanorunner list-generators

docs/testing.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This document provides a comprehensive guide to NanoRunner's test suite, includi
66

77
NanoRunner has a comprehensive test suite designed to validate both individual components and complete workflows:
88

9-
- **Total Tests**: 730 tests across 37 test files
9+
- **Total Tests**: 902 tests across 40 test files
1010
- **Runtime**: ~45 seconds for non-slow suite
1111
- **Coverage**: 97% on core components
1212

@@ -28,6 +28,7 @@ Test individual components in isolation with fast execution (<1 second per test)
2828
| `test_profiles.py` | Configuration profile system validation |
2929
| `test_mocks.py` | Mock community definitions, aliases, organism validation |
3030
| `test_species.py` | Species name resolution (GTDB/NCBI) |
31+
| `test_deps.py` | Dependency checking, install hints, pre-flight validation |
3132

3233
### Integration Tests
3334

@@ -196,6 +197,7 @@ tests/
196197
├── test_integration.py # End-to-end tests
197198
├── test_timing_integration.py # Timing integration tests
198199
├── test_edge_cases.py # Edge case tests
200+
├── test_deps.py # Dependency checking and pre-flight
199201
├── test_performance.py # Performance benchmarks
200202
└── ... # Additional coverage files
201203
```

docs/troubleshooting.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,70 @@ pip install --user git+https://github.com/FOI-Bioinformatics/nanorunner.git
7171

7272
---
7373

74+
## Missing Dependencies
75+
76+
### Check All Dependencies
77+
78+
Before investigating specific issues, run the dependency checker:
79+
80+
```bash
81+
nanorunner check-deps
82+
```
83+
84+
This shows the status of all required and optional dependencies with install instructions.
85+
86+
### Badread Not Working
87+
88+
**Symptom**: `badread exited with status 1` or `ModuleNotFoundError: No module named 'edlib'`
89+
90+
**Explanation**: Badread may be installed but missing a Python dependency (e.g., edlib). NanoRunner verifies that backends can actually start, not just that their binary exists on PATH.
91+
92+
**Solution**:
93+
```bash
94+
# Check dependency status
95+
nanorunner check-deps
96+
97+
# Reinstall badread (includes all dependencies)
98+
conda install -c conda-forge -c bioconda badread
99+
```
100+
101+
### NCBI Datasets CLI Not Found
102+
103+
**Symptom**: `datasets CLI is required` when using `--species`, `--mock`, or `--taxid`
104+
105+
**Solution**:
106+
```bash
107+
# Install NCBI datasets CLI
108+
conda install -c conda-forge ncbi-datasets-cli
109+
110+
# Verify
111+
datasets --version
112+
```
113+
114+
### NanoSim Not Working
115+
116+
**Symptom**: `nanosim exited with status 1` or backend unavailable
117+
118+
**Solution**:
119+
```bash
120+
# Install NanoSim
121+
conda install -c conda-forge -c bioconda nanosim
122+
123+
# Verify
124+
nanorunner check-deps
125+
```
126+
127+
### NumPy Not Installed
128+
129+
**Symptom**: Slower read generation performance (falls back to pure Python)
130+
131+
**Solution**:
132+
```bash
133+
conda install -c conda-forge numpy
134+
```
135+
136+
---
137+
74138
## Runtime Issues
75139

76140
### Permission Denied on Target Directory
@@ -175,13 +239,16 @@ nanorunner replay -s /source -t /target --profile high_throughput
175239
**Solution**:
176240
```bash
177241
# Install psutil
178-
pip install psutil
242+
conda install -c conda-forge psutil
179243

180244
# Or install with enhanced extras
181245
pip install "nanorunner[enhanced] @ git+https://github.com/FOI-Bioinformatics/nanorunner.git@main"
182246

183247
# Verify psutil
184248
python -c "import psutil; print('OK')"
249+
250+
# Or check all dependencies at once
251+
nanorunner check-deps
185252
```
186253

187254
### Progress Bar Not Displaying

0 commit comments

Comments
 (0)