Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editops missing replace operations in some cases #73

Closed
danylofitel opened this issue Jul 17, 2021 · 2 comments
Closed

editops missing replace operations in some cases #73

danylofitel opened this issue Jul 17, 2021 · 2 comments

Comments

@danylofitel
Copy link

Sample strings:
TCTTTGGAGCACAAAACCAGTTGAAACATCAAATTCGTTTGATGTACTGAAGTCAGAGGACGCGCAGGGA
TCTTTGGAGCACAAAACCAGTTGAAACATCATTATTCCTTCGTTTGATGTACTGAAGTCAGAGGACGCGCAGGGA

In this case TTATT was inserted and AA was replaced with CC, but editops only returns one replace of C to A.

Expected output:
[('insert', 31, 31), ('insert', 31, 32), ('insert', 32, 34), ('insert', 32, 35), ('insert', 32, 36), ('replace', 32, 37), ('replace', 33, 38)]

Actual output:
[('insert', 31, 31), ('insert', 31, 32), ('insert', 32, 34), ('insert', 32, 35), ('insert', 32, 36), ('replace', 32, 37)]

@maxbachmann
Copy link

maxbachmann commented Jul 28, 2021

I do not see anything incorrect in this output. The Levenshtein distance between these two strings is 6 (similar to the count of editops). Why should we insert an A and then replace an A. The editops describe the following transformation:

AA
TTATTCC

2 insertions in the beginning

TTAA
TTATTCC

3 Insertions after the first A

TTATTCA
TTATTCC

Replacement of the last A

TTATTCC
TTATTCC

Note that editops will just return one of multiple optimal paths.

@danylofitel
Copy link
Author

My bad, you're right, the output is completely correct. I was actually looking at the output formatted differently (nothing to do with the library, custom code), the bug was actually in that formatting. Thanks for checking this! I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants