
How to measure DNA similarity with Python - atreadw
http://theautomatic.net/2018/11/28/how-to-measure-dna-similarity-with-python-and-dynamic-programming/
======
ColinWright
I'm a little surprised not to see any mention of the Levenshtein Distance[0]
here. It's the standard way of comparing strings, there are libraries to do
it[1], and it seems to be exactly what's happening here.

There's value in deriving code from scratch to understand the algorithm and
the language, but not to mention it at all seems a little odd.

[0]
[https://en.wikipedia.org/wiki/Levenshtein_distance](https://en.wikipedia.org/wiki/Levenshtein_distance)

[1]
[https://duckduckgo.com/?q=Levenshtein+distance+python+librar...](https://duckduckgo.com/?q=Levenshtein+distance+python+library)

------
ldoroud
Since you specifically mentioned DNA similarity and not strings in general, I
assume you want to align the sequences rather than just the Levenshtein
distance between them... If that is the case, I recommend using Biopython
([https://biopython.org/](https://biopython.org/)) for alignments. There are
modules for pairwise sequence alignments both global and local alignments.

