This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This script repairs insertions and deletions in a sequence by replacing them | |
with the correct value from a reference sequence, but keeps replacements. | |
The algorithm calculates a Levenshtein matrix first and then retraces the path | |
of least distances from the bottom right to the top left. Depending on the | |
movement along that path, it indentifies the different types of modifications | |
and fixes them if they are insertions or deletions. | |
Examples: |