Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if sequences in self.mat:
return self.mat[sequences]
# search in symmetric matrix
if self.symmetric:
sequences = tuple(reversed(sequences))
if sequences in self.mat:
return self.mat[sequences]
# if identity then return match_cost
if self._ident(*sequences):
return self.match_cost
# not found
return self.mismatch_cost
prefix = Prefix()
postfix = Postfix()
length = Length()
identity = Identity()
matrix = Matrix()
def __call__(self, *sequences):
s = sequences[0]
sequences = [reversed(s) for s in sequences]
result = reversed(super(Postfix, self).__call__(*sequences))
if isinstance(s, string_types):
return ''.join(result)
if isinstance(s, bytes):
return b''.join(result)
return list(result)