solo: --runMode soloCellFiltering - #159
Open
BenjaminDEMAILLE wants to merge 1 commit into
Open
Conversation
Cell-calls an existing raw count matrix without aligning anything, taking the raw directory and an output prefix as STAR does: `--runMode soloCellFiltering /path/to/raw/ /path/to/out/prefix`. Cell calling is a decision about a matrix, not about reads. Re-calling with different `--soloCellFilter` parameters should not mean re-aligning 400 million reads, and a matrix produced by another tool should be callable too. The matrix is streamed into the same temp-body form the align path builds, so `called_cells` and `emptydrops_called` are the identical code here and there rather than a second implementation free to drift. Counts are rounded on the way in: a multimapper matrix carries real values, and the filters work on UMI totals. `--runMode` becomes a token list, because that is what STAR's is: the mode followed by its arguments. The mode itself is now validated rather than falling back to `alignReads`, so a typo is refused instead of quietly running something else. The standalone `emptydrops` binary still exists and still carries its own copy of the algorithm, which no longer matches this one. Removing it means moving `test/solo_genefull_compare.py` and `test/solo_genefull_h5_compare.py` to the new mode first, so it is left alone here rather than broken.
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--runMode soloCellFiltering <raw dir> <output prefix>: cell-call an existing raw count matrix without aligning anything.What changed
The mode reads
matrix.mtx,barcodes.tsvandfeatures.tsvfrom a raw directory (plain or gzipped), applies--soloCellFilter, and writes the called subset under the output prefix. No genome, no reads, no index.--runModebecomes a token list, because that is what STAR's is: the mode followed by its arguments (SoloFeature_loadRawMatrix.cppreadsrunModeIn[1]andrunModeIn[2]). The mode itself is now validated rather than falling back toalignReads, so a typo is refused instead of quietly running something else.Why
Cell calling is a decision about a matrix, not about reads. Re-calling with different
--soloCellFilterparameters should not mean re-aligning, and a matrix produced by another tool should be callable too.How it avoids a second implementation
The matrix is streamed into the same temp-body form the align path builds, so
called_cellsandemptydrops_calledare the identical code here and there rather than a copy free to drift. Counts are rounded on the way in: a--soloMultiMappersmatrix carries real values, and the cell filters work on UMI totals.Verification
Two integration tests in
tests/alignment_features.rs, run withcargo test --release --test alignment_features solo_cell_filtering:test_run_mode_solo_cell_filtering_calls_cells_from_a_raw_matrix— a 20-barcode synthetic matrix where five barcodes carry 1000 UMIs and fifteen carry 2;--soloCellFilter TopCells 5writes exactly those five, with a50 5 50matrix header and the feature list carried through.test_run_mode_solo_cell_filtering_requires_its_paths— the mode without its two paths is refused.Gate: 560 lib + 23 integration tests,
cargo clippy --all-targets -- -D warnings,cargo fmt --check, MSRV 1.89 — all green.Output-neutral for every other run mode.
Known duplication left in place
The standalone
emptydropsbinary still carries its own copy of the algorithm, which this mode supersedes. Removing it means first movingtest/solo_genefull_compare.pyandtest/solo_genefull_h5_compare.pyonto the new mode, so it is left alone here rather than broken. Happy to do that as a follow-up if you want it gone.Split out of #152 following the one-theme rule in CONTRIBUTING.md.