From 9892aae7196b3df2df11c6b69e47b0372a486b81 Mon Sep 17 00:00:00 2001 From: ivan-aksamentov Date: Thu, 12 Oct 2023 03:47:55 +0200 Subject: [PATCH] feat: bring back short sequence branch in alignment Let's use `kmer_length` instead of removed `seed_length` and adjust the coefficient to roughly match the old value. --- packages_rs/nextclade/src/align/align.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages_rs/nextclade/src/align/align.rs b/packages_rs/nextclade/src/align/align.rs index c8d29283d..41a6753c3 100644 --- a/packages_rs/nextclade/src/align/align.rs +++ b/packages_rs/nextclade/src/align/align.rs @@ -46,12 +46,12 @@ pub fn align_nuc( ); } - // if ref_len + qry_len < (10 * params.seed_length) { - // // for very short sequences, use full square - // let stripes = full_matrix(ref_len, qry_len); - // trace!("When processing sequence #{index} '{seq_name}': In nucleotide alignment: Band construction: short sequences, using full matrix"); - // return Ok(align_pairwise(qry_seq, ref_seq, gap_open_close, params, &stripes)); - // } + if ref_len + qry_len < (20 * params.kmer_length) { + // for very short sequences, use full square + let stripes = full_matrix(ref_len, qry_len); + trace!("When processing sequence #{index} '{seq_name}': In nucleotide alignment: Band construction: short sequences, using full matrix"); + return Ok(align_pairwise(qry_seq, ref_seq, gap_open_close, params, &stripes)); + } // otherwise, determine seed matches roughly regularly spaced along the query sequence let SeedMatchesResult {