cmuts test
Purpose
cmuts test runs the integration test suite to verify that cmuts is installed correctly and functioning as expected. The tests validate mutation counting accuracy across various scenarios.
Usage
Options
| Option | Description |
|---|---|
--quick |
Run only fast tests, skipping slow stress tests |
--cram |
Run only CRAM format tests |
-k EXPR |
Run tests matching the given expression (pytest syntax) |
-v |
Increase verbosity |
Examples
Run all tests:
Run quick tests only (recommended for CI):
Run only CRAM-specific tests:
Run tests matching a pattern:
Test Categories
The test suite includes several categories of tests:
Edge Case Tests
Deterministic tests with specific, controlled inputs to verify correct behavior in boundary conditions:
- Minimal single-read processing
- Short reads at minimum length threshold
- High MAPQ and PHRED filtering
- Quality window averaging
- Mutation type filtering (mismatches, insertions, deletions)
- Collapse distance handling
- Multiple references
CRAM Format Tests
Tests specifically for CRAM file format support:
- Basic CRAM processing
- CRAM with quality filters
Random Fuzzing Tests
Tests with randomly generated parameters to catch edge cases:
- Random BAM file processing
- Random CRAM file processing
Stress Tests (Slow)
Large-scale tests marked with @pytest.mark.slow:
- Large reference sequences
- Many references
- High coverage scenarios
- Extended fuzzing with many iterations
Requirements
The test suite requires:
pytest(install viapip install pytest)samtools(for BAM/CRAM conversion)h5py(for HDF5 comparison)numpy(for numerical comparison)
Output
Tests output a summary showing passed/failed tests:
============================= test session starts ==============================
...
tests/python/test_core.py::TestEdgeCases::test_minimal_single_read PASSED
tests/python/test_core.py::TestEdgeCases::test_short_reads_at_min_length PASSED
...
============================= 85 passed in 15.10s ==============================
Validation Criteria
Each test validates that:
- Counts match: The mutation counts from
cmuts corematch the expected counts generated bycmuts generate - No crashes: Processing completes without errors
- Correct filtering: Quality and length filters are applied correctly