Skip to content

Commit

Permalink
adding an assertion of equal batch sizes for paired-end reads. Fail i…
Browse files Browse the repository at this point in the history
…f different sizes
  • Loading branch information
guilhermesena1 committed Sep 22, 2022
1 parent 2476354 commit 138aef1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/abismal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1689,6 +1689,16 @@ map_paired_ended(const bool VERBOSE,
the_byte = rl1.get_current_byte();
}

if (reads1.size() != reads2.size()) {
throw runtime_error(
"paired-end batch sizes differ. Batch 1: "
+ to_string(reads1.size()) +
", batch 2: " + to_string(reads2.size()) +
". Are you sure your paired-end inputs "
"have the same number of reads?"
);
}

size_t max_batch_read_length = 0;
update_max_read_length(max_batch_read_length, reads1);
update_max_read_length(max_batch_read_length, reads2);
Expand Down Expand Up @@ -1840,6 +1850,16 @@ map_paired_ended_rand(const bool VERBOSE, const bool allow_ambig,
the_byte = rl1.get_current_byte();
}

if (reads1.size() != reads2.size()) {
throw runtime_error(
"paired-end batch sizes differ. Batch 1: "
+ to_string(reads1.size()) +
", batch 2: " + to_string(reads2.size()) +
". Are you sure your paired-end inputs "
"have the same number of reads?"
);
}

size_t max_batch_read_length = 0;
update_max_read_length(max_batch_read_length, reads1);
update_max_read_length(max_batch_read_length, reads2);
Expand Down

0 comments on commit 138aef1

Please sign in to comment.