Skip to content

Commit

Permalink
Merge pull request #1243 from nextstrain/fix/runaway
Browse files Browse the repository at this point in the history
fix: prevent run-away bandwith
  • Loading branch information
corneliusroemer authored Sep 6, 2023
2 parents b3640c9 + 78b8096 commit 1288299
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages_rs/nextclade/src/align/seed_alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ pub fn create_alignment_band(
// post: deal with the terminal trapezoid and allow of terminal bandwidth

let mut bands = Vec::<TrapezoidDirectParams>::with_capacity(2 * chain.len() + 2);

// make initial trapezoid starting at 0 and extending into match by terminal_bandwidth
let mut current_seed = &chain[0];
let mut look_back_length = terminal_bandwidth;
Expand Down Expand Up @@ -265,8 +264,8 @@ pub fn create_alignment_band(
current_band = TrapezoidDirectParams {
ref_start: current_ref_end,
ref_end: next_seed.ref_pos as isize + look_forward_length,
min_offset: mean_offset - look_back_length - excess_bandwidth,
max_offset: mean_offset + look_back_length + excess_bandwidth,
min_offset: mean_offset - max(look_back_length, excess_bandwidth),
max_offset: mean_offset + max(look_back_length, excess_bandwidth),
};
current_seed = next_seed;
}
Expand Down

1 comment on commit 1288299

@vercel
Copy link

@vercel vercel bot commented on 1288299 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.