Repository navigation
Replace bio with an own FASTQ reader; trim minimap2 features - #85
Merged
Merged
Conversation
bio was used only for its FASTQ reader and record type, yet brought in about 60 crates (nalgebra, ndarray, statrs, petgraph, regex, ...). The new reader in src/fastq.rs yields the same records on well-formed input, so FASTQ output stays byte-identical to v0.14.1 (checked by the digest test), and handles malformed input better: - mismatched sequence/quality lengths are an error instead of a panic later in trimming - wrapped records pair qualities by length; a one-line sequence takes exactly one quality line - empty reads and blank lines are accepted - parse errors name the line and exit 1 instead of panicking The header is kept whole, so the id/description reassembly goes away. Also drops the unused approx dependency. Runtime crates 125 -> 61, lockfile 172 -> 95 packages, clean release build 41 s -> 27 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
That feature only provides Aligner::map_file, which chopper does not use, and pulls in needletail, buffer-redux and bytecount. The contamination filter builds its index with with_index and aligns with map, both unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # Cargo.lock
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.
Follows #84 (merged).
What
Replaces
biowith a ~150-line FASTQ reader of our own (src/fastq.rs), and buildsminimap2without its defaultmap-filefeature. chopper usedbioonly for its FASTQ reader and record type.minimap2'smap-filefeature only providesAligner::map_file, which chopper doesn't call, and it pulls in a second FASTQ parser (needletail). The unusedapproxdependency is removed too.Cargo.lockpackages-t 4Behaviour
Valid FASTQ: unchanged. The v0.14.1 digest test from #84 passes on the new reader, and in 26 further runs against the v0.14.1 binary (every trim approach, the filters, gzip input,
-t 1and-t 4) stdout and stderr were identical. Likebio, the reader trims trailing whitespace from each line and accepts CRLF.Malformed FASTQ: deliberately better.
@r\n\n+\n\n)@, non-UTF-8 headerError: problem parsing FASTQ input at line N: ..., exit 1The header is now kept whole instead of being split into id and description at the first space, so the reassembly that
record_to_stringneeded (see the old CLAUDE.md note) is gone. CLAUDE.md is updated.Tests
make ci: 72 unit tests (10 new for the reader) and 19 end-to-end tests pass, plus the 4 ignored smoke tests and clippy-D warnings.🤖 Generated with Claude Code