Skip to content
Snippets Groups Projects
Verified Commit 6c41148c authored by Laurent Modolo's avatar Laurent Modolo
Browse files

read.rs: prevent the creation of read outside the chromosomes

parent 5805740e
Branches
Tags
No related merge requests found
......@@ -141,7 +141,7 @@ impl Fragments {
while self.chr_id < chr_id {
self.next_chr();
}
if chr_pos > self.chr_seq.len() as u32 {
if chr_pos > self.chr_seq.len() as u32 - self.fragment_len {
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 {
if chr_pos >= self.chr_seq.len() as u32 - self.fragment_len {
panic!(
"Fragments::get() pos {} not present in chromosome {} of size {}",
chr_pos,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment