Martinsos / edlib

Lightweight, super fast C/C++ (& Python) library for sequence alignment using edit (Levenshtein) distance.
http://martinsos.github.io/edlib
MIT License
506 stars 165 forks source link

Refactor alignment traceback #58

Open Martinsos opened 7 years ago

Martinsos commented 7 years ago

Piece of code that does normal alignment traceback (digs through blocks and moves around) is overly complicated and has too much if-else statements. It is easy for a bug to hide here and too hard to be sure that all edge cases are correctly covered. I should refactor this piece of code by better diving logic between calculation of scores, deciding on the current move and preparing structures for the next iteration. All corner cases should be described, it should be obvious how they are taken care of.