Skip to content

Comments

feat(bam): add public constructors for IterAlignedBlocks and IterIntrons#506

Open
VedantMadane wants to merge 2 commits intorust-bio:masterfrom
VedantMadane:add-public-constructors
Open

feat(bam): add public constructors for IterAlignedBlocks and IterIntrons#506
VedantMadane wants to merge 2 commits intorust-bio:masterfrom
VedantMadane:add-public-constructors

Conversation

@VedantMadane
Copy link

Adds public constructors for IterAlignedBlocks and IterIntrons structs to allow external construction without BamRecordExtensions access.

Resolves issue #472. Previously these public structs had private fields making external construction impossible.

Changes:

  • IterAlignedBlocks::new(pos, cigar)
  • IterIntrons::new(pos, cigar)
  • Documentation and tests included

Example: let iter = IterAlignedBlocks::new(100, cigar_vec);

@johanneskoester
Copy link
Contributor

Good idea! May I ask you to fix the clippy errors?

@coveralls
Copy link

Pull Request Test Coverage Report for Build 21205858316

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 66 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-1.7%) to 80.122%

Files with Coverage Reduction New Missed Lines %
src/bam/mod.rs 1 83.77%
src/bam/header.rs 2 81.36%
src/bam/ext.rs 3 91.96%
src/bcf/mod.rs 3 78.28%
src/bam/buffer.rs 4 53.85%
src/bcf/record.rs 4 82.54%
src/bcf/buffer.rs 5 62.32%
src/bam/record_serde.rs 12 82.12%
src/bam/record.rs 32 75.6%
Totals Coverage Status
Change from base Build 20368714287: -1.7%
Covered Lines: 2753
Relevant Lines: 3436

💛 - Coveralls

- Add IterAlignedBlocks::new(pos, cigar) constructor
- Add IterIntrons::new(pos, cigar) constructor
- Allow external construction without BamRecordExtensions
- Add comprehensive documentation and examples
- Add unit tests for both constructors

Resolves issue rust-bio#472: Add public constructor for public structs
@VedantMadane VedantMadane force-pushed the add-public-constructors branch from 5937284 to 12e00d8 Compare January 31, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants