diff --git a/src/read.rs b/src/read.rs index e6a4f92ae9b9ab98cc7906682d1088a4ec0ed1f7..75c3cb76c0680674b6431500e3b9eb683d452770 100644 --- a/src/read.rs +++ b/src/read.rs @@ -118,7 +118,7 @@ impl Fragments { pub fn next_chr(&mut self) { loop { self.get_chr(); - if !self.check_name() { + if self.check_name() { break; } } @@ -141,7 +141,7 @@ impl Fragments { while self.chr_id < chr_id { self.next_chr(); } - if chr_pos > self.chr_seq.len() as u32 - self.fragment_len { + if chr_pos > self.chr_seq.len() as u32 { panic!( "Fragments::get_single() pos {} not present in chromosome {}:{} of size {}", chr_pos, @@ -171,7 +171,7 @@ impl Fragments { while self.chr_id < chr_id { self.next_chr(); } - if chr_pos >= self.chr_seq.len() as u32 - self.fragment_len { + if chr_pos >= self.chr_seq.len() as u32 { panic!( "Fragments::get() pos {} not present in chromosome {} of size {}", chr_pos, @@ -306,7 +306,7 @@ impl Read { /// # Return /// String fn build_name(read_number: u64, paired: bool, first: bool) -> String { - let mut read_name = String::from("bigwig2bam:0:0:0:"); + let mut read_name = String::from("bigwig2bam:0:1:3:"); read_name.push_str(&read_number.to_string()); if paired { if first {