seqan / seqan3

The modern C++ library for sequence analysis. Contains version 3 of the library and API docs.
https://www.seqan.de
Other
406 stars 81 forks source link

Incorrect begin/end of alignment for banded alignment #3266

Closed paoloshasta closed 1 month ago

paoloshasta commented 1 month ago

Does this problem persist on the current main?

Is there an existing issue for this?

Current Behavior

When I do a banded alignment, I get incorrect values for begin/end of the alignment. For example, the attached program outputs:

Using configGeneral: 
{sequence1 id: 0, sequence2 id: 0, score: 4, begin: (0,24), end: (6,30), 
alignment:
(CGTCTA,CGTGTA)}

Using configBanded: 
{sequence1 id: 0, sequence2 id: 0, score: 4, begin: (0,5), end: (6,11), 
alignment:
(CGTCTA,CGTGTA)}

Expected Behavior

I expect the same begin/end values whether I use banded alignment or not.

Steps To Reproduce

I am using the attached test program on Ubuntu 22.04 and compiling it as follows:

g++ -O3 -DNDEBUG -Wall -Wextra -std=c++20 -I /home/paolo/seqan3/include -isystem /home/paolo/seqan3/submodules/sdsl-lite/include -isystem /home/paolo/seqan3/submodules/cereal/include -pthread -O0 -ggdb3 seqan3test1.cpp

Environment

- Operating system: Ubuntu 22.04
- SeqAn version: Commit ca4d668390e35b4045ccd02d070927f8178ed2ce
- Compiler: g++ 11.4.0

Anything else?

Here is the test program. Added .txt extension for posting.

seqan3test1.cpp.txt

rrahn commented 1 month ago

@paoloshasta thanks for reporting this and adding a test file. I will look into this.

rrahn commented 1 month ago

@paoloshasta this one should be fixed now in the current main branch. Best regards.

paoloshasta commented 1 month ago

Thank you for the quick response. I got the latest commit and verified the fix.

I am converting some old code (in the Shasta assembler) that uses seqan2 to use seqan3 instead. I bumped into seqan2 bugs which cannot be fixed because the seqan2 code base is no longer maintained. Given your quick response I am encouraged that if I bump into seqan3 bugs I can report them here and they will be looked at quickly.