feat(io): native CBQ input support - #213
Open
alejandrogzi wants to merge 3 commits into
Open
Conversation
Add single-file CBQ read input (single-end or interleaved paired-end), detected by file header rather than extension, with parallel decoding controlled by '--readFilesNthreads'. Decoded reads are bounded by a fixed per-window record budget so peak input memory is independent of thread count and block size. Read types and base helpers shared with the FASTQ path move to a new 'reads' module.
The spill+merge test exercises the bounded-memory coordinate sorter, not CBQ input; it ships with the BAM sorter change instead.
Upstream added a call to fastq::encode_base inside index_of_barcode after the fork diverged; the move of base helpers to io::reads requires the updated path for the CBQ-era import layout to keep compiling.
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.
Adds single-file CBQ read input (single-end or interleaved paired-end), detected by file header rather than extension, decoded in parallel under
--readFilesNthreads.src/io/cbq.rs,src/io/input.rs,src/io/reads.rs; read types/base helpers shared with the FASTQ path move toreads.--readFilesCommand, or qualityless--outReadsUnmapped Fastx).Tests:
cargo test --releasegreen (640 tests on current main base).Benchmark
6af8d78e4112ac537cc2da83704911d4ce047c0593da004ebba0f8d379b761cc00b3bff4daf8c381+ uncommitted CBQ feature (incl.src/io/cbq.rs)--genomeSAsparseD 2, shared by both binaries)core-fq(upstream),our-fq,our-cbq(CBQ input +--readFilesNthreads 4), each x SE/PE**our: this fork
Datasets
Correctness
For all 4 datasets:
core-fq == our-fq == our-cbqbyte-identical SAM alignment records(header
@-lines excluded; line 3 embeds the command line and always differs).Wall time (hyperfine mean, s)
Ours is 1.4-3.8% slower than core; CBQ input adds ~0.3% over our FASTQ. All within ~2 sigma of run-to-run noise except real PE (+3.6%).
Peak RSS (/usr/bin/time -v, MB)
No systematic difference; CBQ does not inflate memory (real PE CBQ lowest of the three).
Mapping rates (written records / reads)