Skip to content

Commit

Permalink
trim back the trace to global tail patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ekg committed Aug 24, 2024
1 parent 6ecd327 commit 4d41477
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/common/wflign/src/wflign_patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,16 @@ void write_merged_alignment(
}
}

// trim Is and Ds from the end of the alignment trace, adjusting the query_pos and target_pos as needed
while (!patched.empty() && (patched.back() == 'I' || patched.back() == 'D')) {
if (patched.back() == 'I') {
--query_pos;
} else {
--target_pos;
}
patched.pop_back();
}

// Tail patching
if (query_pos < query_length || target_pos < target_length) {
alignment_t tail_aln;
Expand Down

0 comments on commit 4d41477

Please sign in to comment.