Skip to content

Commit

Permalink
chore: add log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rneher committed Sep 6, 2023
1 parent 7ef77d7 commit bd07478
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages_rs/nextclade/src/align/align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ pub fn align_nuc(
let mut alignment = align_pairwise(&qry_seq, ref_seq, gap_open_close, params, &stripes);

while alignment.hit_boundary && attempt < params.max_alignment_attempts {
info!("When processing sequence #{index} '{seq_name}': In nucleotide alignment: Band boundary is hit on attempt {}. Retrying with relaxed parameters. Alignment score was: {}", attempt+1, alignment.alignment_score);
// double bandwidth parameters or increase to one if 0
terminal_bandwidth = max(2 * terminal_bandwidth, 1);
excess_bandwidth = max(2 * excess_bandwidth, 1);
Expand All @@ -103,7 +104,17 @@ pub fn align_nuc(
// realign
alignment = align_pairwise(&qry_seq, ref_seq, gap_open_close, params, &stripes);
}

// report success/failure of broadening of band width
if alignment.hit_boundary {
info!("When processing sequence #{index} '{seq_name}': In nucleotide alignment: Attempted to relax band parameters {attempt} times, but still hitting the band boundary. Returning last attempt with score: {}", alignment.alignment_score);
if band_area > max_band_area {
info!(
"When processing sequence #{index} '{seq_name}': final band area {band_area} exceeded the cutoff {max_band_area}"
);
}
} else if attempt > 0 {
info!("When processing sequence #{index} '{seq_name}': In nucleotide alignment: Succeeded without hitting band boundary on attempt {}. Alignment score was: {}", attempt+1, alignment.alignment_score);
}
alignment.is_reverse_complement = is_reverse_complement;
Ok(alignment)
}
Expand Down

0 comments on commit bd07478

Please sign in to comment.