Skip to content

Commit f6c1ed0

Browse files
committed
detect: Use Record::alignment_end
1 parent 641c24e commit f6c1ed0

File tree

3 files changed

+5
-40
lines changed

3 files changed

+5
-40
lines changed

src/detect.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use noodles::{
55
bam,
66
core::Position,
77
gff,
8-
sam::{self, header::ReferenceSequences},
8+
sam::{self, alignment::Record, header::ReferenceSequences},
99
};
1010

1111
use crate::{count::get_tree, Entry, Features, SegmentPosition, StrandSpecification};
@@ -142,8 +142,6 @@ pub fn detect_specification<P>(
142142
where
143143
P: AsRef<Path>,
144144
{
145-
use crate::record::alignment_end;
146-
147145
let mut reader = File::open(src).map(bam::io::Reader::new)?;
148146
reader.read_header()?;
149147

@@ -166,10 +164,11 @@ where
166164
};
167165

168166
let alignment_start = record.alignment_start().transpose()?;
169-
let cigar = record.cigar();
167+
let alignment_end = record.alignment_end().transpose()?;
170168

171-
let start = alignment_start.expect("missing alignment start");
172-
let end = alignment_end(alignment_start, &cigar).expect("missing alignment end")?;
169+
let (Some(start), Some(end)) = (alignment_start, alignment_end) else {
170+
panic!("missing alignment context");
171+
};
173172

174173
if flags.is_segmented() {
175174
counts.paired += 1;

src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub mod feature;
1414
mod gff;
1515
mod match_intervals;
1616
pub mod normalization;
17-
pub mod record;
1817
pub mod record_pairs;
1918

2019
pub use self::cli::Cli;

src/record.rs

-33
This file was deleted.

0 commit comments

Comments
 (0)