Martinsos / edlib

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

Error when query or target is the empty string and task='path' #191

Open RubenBSB opened 2 years ago

RubenBSB commented 2 years ago

Description When using edlib.align with an empty query and task='path', the cigar is 'None'.

To Reproduce

result = edlib.align("", "abc", task="path")
edlib.getNiceAlignment(result, "", "abc")

This raises the following error :

Exception: The object alignResult contains an empty CIGAR string. Users must run align() with task='path'. Please check the input alignResult

Expected behavior In my opinion, the cigar should indicate 3 deletions from the target in this case :

cigar = 3D

Environment