Skip to content

Commit

Permalink
detect: Use Record::alignment_end
Browse files Browse the repository at this point in the history
  • Loading branch information
zaeleus committed May 16, 2024
1 parent 641c24e commit f6c1ed0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 40 deletions.
11 changes: 5 additions & 6 deletions src/detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use noodles::{
bam,
core::Position,
gff,
sam::{self, header::ReferenceSequences},
sam::{self, alignment::Record, header::ReferenceSequences},
};

use crate::{count::get_tree, Entry, Features, SegmentPosition, StrandSpecification};
Expand Down Expand Up @@ -142,8 +142,6 @@ pub fn detect_specification<P>(
where
P: AsRef<Path>,
{
use crate::record::alignment_end;

let mut reader = File::open(src).map(bam::io::Reader::new)?;
reader.read_header()?;

Expand All @@ -166,10 +164,11 @@ where
};

let alignment_start = record.alignment_start().transpose()?;
let cigar = record.cigar();
let alignment_end = record.alignment_end().transpose()?;

let start = alignment_start.expect("missing alignment start");
let end = alignment_end(alignment_start, &cigar).expect("missing alignment end")?;
let (Some(start), Some(end)) = (alignment_start, alignment_end) else {
panic!("missing alignment context");
};

if flags.is_segmented() {
counts.paired += 1;
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub mod feature;
mod gff;
mod match_intervals;
pub mod normalization;
pub mod record;
pub mod record_pairs;

pub use self::cli::Cli;
Expand Down
33 changes: 0 additions & 33 deletions src/record.rs

This file was deleted.

0 comments on commit f6c1ed0

Please sign in to comment.