Skip to content

potential bug: band boundary hit when trailing in-dels are present at the end of a simple stripe alignment #1654

@mmolari

Description

@mmolari

Hello! Reporting a small potential bug that I ran into while using Nextalign on another project.

In my case the code was slightly different, but I believe that the issue could be reproduced by performing a banded alignment of these two sequences

    let ref_str = "------------------------------TTGGCCCCGGTGCTGTCCGTCAACACGTCGTCGTCCGGCGACCTACCTGGTCTCAAAGGAGGTTTTGTTAAATGAATTAGATGGGTAAGGTTACCACGTCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
    let qry_str = "GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGTTGGCCCCGGTGCTGTCCGTCAACACGTCGTCGTCCGGCGACCTACCTGGTCTCAAAGGAGGTTTTGTTAAATGAATTAGATGGGTAAGGTTACCACGTCA------------------------------";

with band shift = -30 and band width = 1, with a simple stripe alignment (e.g. using align_aa, interpreting them as amino-acid alignments) results in a hit_boundary warning.

let qry_str = qry_str.replace('-', "");
let ref_str = ref_str.replace('-', "");

let qry_seq = to_aa_seq(&qry_str).unwrap();
let ref_seq = to_aa_seq(&ref_str).unwrap();

let gap_open_close = get_gap_open_close_scores_flat(&ref_seq, &params);
let band_width = 1;
let shift = -30;
let alignment = align_aa(&qry_seq, &ref_seq, &gap_open_close, band_width, shift, &params).unwrap();
assert!(!alignment.hit_boundary);

It might be desirable to avoid this, and not consider trailing indels as a boundary hit. If so, in my case this was solved by applying the following changes to the score_matrix function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededneeds triageMark for review and label assignmentt:bugType: bug, error, something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions