seq-lang/seq

Levenshtein distance

rutlang opened this issue · 5 comments

I can't seem to replicate the result of @ with the align function (I'd like to get the Levenshtein distance but do not need CIGAR). a=0 b=1 gapo=1, as the manual indicated, gives me values different from those of @.

Hi @rutlang, are you passing gape=1 as well? e.g.

from bio import *
q = s'AAACCCGGGTTT'
t = s'TAACCCAGGGTTTAAA'
print q @ t  # score = -5
print q.align(t, a=0, b=1, gapo=0, gape=1, score_only=True)  # score = -5

I messed with this a bit and got it to seemingly work with a=0, b=1, gapo=0, gape=1

Hi @arshaji @markhend, thanks for the quick reply. It did not occur to me that one can set a penalty for gap extension sans a penalty for gap opening. But it works.

Hi @rutlang. Would it be OK if we closed this issue?

Hi @markhend, yes, the (non-) issue was resolved. a=0, b=1, gapo=0, gape=1 was exactly what I was looking for. Thanks.