def compare_suffixes(s1, s2, wildcard_ref=False, wildcard_query=False): """ Find out whether one string is the suffix of the other one, allowing mismatches. Used to find an anchored 3' adapter when no indels are allowed. """ s1 = s1[::-1] s2 = s2[::-1] _, length, _, _, matches, errors = compare_prefixes(s1, s2, wildcard_ref, wildcard_query) return (len(s1) - length, len(s1), len(s2) - length, len(s2), matches, errors)