jeffdaily / parasail

Pairwise Sequence Alignment Library
Other
243 stars 34 forks source link

Indexing error in alphabet_aliases #107

Open shenker opened 4 months ago

shenker commented 4 months ago

Unless I'm mistaken, I believe i+=1 should be i+=2 in two places:

https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11ed7/src/traceback.c#L43-L50

https://github.com/jeffdaily/parasail/blob/600fb26151ff19899ee39a214972dcf2b9b11ed7/src/cigar_template.c#L172-L179

As is, alphabet_aliases = "AaBb" would treat a and B as equivalent. My understanding of the documentation is that alphabet_aliases = "AaBb" should imply the two equivalence pairs A/a and B/b but not a/B.

Additionally, it might be nice to explicitly specify in the documentation that you need specify only one ordering for each equivalence pair (i.e., alphabet_aliases = "AB" is equivalent to alphabet_aliases = "ABBA").

Happy to submit a PR if that would help.

jeffdaily commented 4 months ago

I'd be happy to accept a PR if you can also add a unit test that exercises the problem.