def get_mismatch_type(a_base, b_base):
    """
    For two given nucleotide values (A, T, C, G, and -) representing a mismatch
    or indel, return the type of mismatch. For substitutions, return transition
    or transversion. Otherwise, return insertion or deletion.
    """
    type_string = "".join(sorted((a_base, b_base)))

    if type_string in ("AG", "CT"):
        return "transition"
    elif type_string in ("AC", "AT", "CG", "GT"):
        return "transversion"
    elif a_base == "-":
        return "insertion"
    elif b_base == "-":
        return "deletion"
    else:
        raise Exception("Unrecognized mismatch type: %s" % type_string)