Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent run-away bandwith #1243

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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