I need to calculate the edit distance between DNA sequences in order to group similar sequences together. If sequences have a distance that is larger than some threshold they are considered different and I don't care what the actual value is, so naturally I want to set an upper bound on the Levenshtein distance and for the function to stop when passing it. The vat majority of comparisons are supposed to end with that result.
I found that there are some fast implementation in cython/C wrapped in python, for example python-Levenshtein and editdistance, but to my surprise nor these nor others I found have an option to set an upper bound, which I thought would be basic. I could use an all python implementation and modify it, but it would be much slower than a C implementation.
Does anyone know of a python tool that would allow that, or of a way to tweak the implementation so it would stop after some threshold?
Thanks