Skip to content

Commit

Permalink
Merge pull request #1239 from nextstrain/fix/allowed-mismatches
Browse files Browse the repository at this point in the history
Allowed mismatches were -1 too small due to < rather than <=
  • Loading branch information
rneher authored Sep 6, 2023
2 parents 1288299 + 609335a commit abbb586
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages_rs/nextclade/src/align/seed_match2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl SeedMatch2 {
// counter to keep track of total number of mismatches in window
let mut forward_mismatches = 0;

while forward_mismatches < config.allowed_mismatches && length < max_length {
while forward_mismatches <= config.allowed_mismatches && length < max_length {
// remove first position in queue, decrement mismatch counter in case of mismatch
if mismatch_queue.pop_front().unwrap() {
forward_mismatches = forward_mismatches.saturating_sub(1);
Expand Down Expand Up @@ -159,7 +159,7 @@ impl SeedMatch2 {
// repeat in other direction
mismatch_queue = VecDeque::from(vec![false; config.window_size]);
let mut backward_mismatches = 0;
while backward_mismatches < config.allowed_mismatches && ref_pos > 0 && qry_pos > 0 {
while backward_mismatches <= config.allowed_mismatches && ref_pos > 0 && qry_pos > 0 {
if mismatch_queue.pop_front().unwrap() {
backward_mismatches = backward_mismatches.saturating_sub(1);
}
Expand Down

1 comment on commit abbb586

@vercel
Copy link

@vercel vercel bot commented on abbb586 Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextclade – ./

nextclade.vercel.app
nextclade-git-master-nextstrain.vercel.app
nextclade-nextstrain.vercel.app

Please sign in to comment.