Migrate BAM I/O from rust-htslib to noodles#115
Merged
Conversation
Replace rust-htslib with a pure-Rust noodles backend behind a compatibility shim at src/rna/bam/. The shim preserves the existing Reader/IndexedReader/Record API used across dupRadar, RSeQC, preseq, Qualimap, and samtools-compatible outputs. Key changes: - Add noodles-backed BAM/SAM/CRAM readers with indexed fetch support - Preserve samtools-identical CHK checksums via packed sequence bytes - Update build docs: no cmake/htslib system deps required - All integration and unit tests pass in release mode Co-authored-by: Phil Ewels <phil.ewels@seqera.io>
Replace rust-htslib build prerequisites with noodles (pure Rust) across the website docs, Dockerfile, GitHub Actions workflows, and CHANGELOG. Co-authored-by: Phil Ewels <phil.ewels@seqera.io>
- Remove extra blank line in main.rs (cargo fmt --check) - Bump rust-version to 1.89 (required by noodles 0.111) - Update MSRV CI job to match Co-authored-by: Phil Ewels <phil.ewels@seqera.io>
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.
Summary
Closes #113.
Replaces
rust-htslib(htslib C bindings) with the pure-Rust noodles crate for all BAM/SAM/CRAM I/O. A compatibility shim atsrc/rna/bam/preserves the existingReader/IndexedReader/RecordAPI so the rest of the pipeline is unchanged.Changes
src/rna/bam/module — noodles-backed readers, records, CIGAR decoding, and test fixture writer/index helpersrust-htslibremoved;noodles0.111 added withbam,sam,cram,csi,bgzf,core, andfastafeaturesg++(preseq FFI) andlibfontconfigremainAGENTS.md,CONTRIBUTING.md, andCHANGELOG.mdOutput parity
Direct A/B comparison on
tests/data/test.bam(main vs this branch) confirms bit-identical samtools outputs (flagstat,idxstats,stats), dupRadar, preseq, RSeQC text outputs, Qualimap data files, and all PNG/SVG plots. Only metadata differs (timestamps, output paths in comments, git commit hash inCITATIONS.md).Testing
CXX=g++ cargo fmt --check CXX=g++ cargo clippy -- -D warnings CXX=g++ cargo test --releaseAll unit tests and 18 integration tests pass.