@classmethod
def _edit_distance_from_alignment_strings(cls, str1, str2):
    """Input should be seqs output by _needleman_wunsch().
        Returns the edit distance between the sequences"""
    assert len(str1) == len(str2)
    edit_distance = 0
    in_gap = False
    for i, char1 in enumerate(str1):
        if char1 == '-' or str2[i] == '-':
            if not in_gap:
                in_gap = True
                edit_distance += 1
        else:
            in_gap = False
            if char1 != str2[i]:
                edit_distance += 1
    return edit_distance
