Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Index for bam::IndexedReader #387

Merged
merged 20 commits into from
May 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
set reference for indexed cram reader
  • Loading branch information
tedil committed May 2, 2023
commit 24a1a046683031237eb98fb6a4b74c6a211b45e5
2 changes: 2 additions & 0 deletions src/bam/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2918,6 +2918,7 @@ CCCCCCCCCCCCCCCCCCC"[..],
#[test]
fn test_idxstats_cram() {
let mut reader = IndexedReader::from_path("test/test_cram.cram").unwrap();
reader.set_reference("test/test_cram.fa").unwrap();
let header = reader.header().clone();
let expected = vec![(0, (120, 2, 0)), (1, (120, 2, 0)), (2, (120, 2, 0))];
let actual = reader.index().stats(header).unwrap();
Expand All @@ -2927,6 +2928,7 @@ CCCCCCCCCCCCCCCCCCC"[..],
#[test]
fn test_number_mapped_and_unmapped_cram() {
let mut reader = IndexedReader::from_path("test/test_cram.cram").unwrap();
reader.set_reference("test/test_cram.fa").unwrap();
let expected = (2, 0);
let actual = reader.index().number_mapped_unmapped(0);
assert_eq!(expected, actual);
Expand Down