def generate_idx(maxlen, nedit):
    """
    generate all possible nedit edits of a string. each item has the form
    ((index1, index2), 'A', 'G')  for nedit=2
    index1 will be replaced by 'A', index2 by 'G'

    this covers all edits < nedit as well since some of the specified
    substitutions will not change the base
    """
    ALPHABET = ["A", "C", "G", "T", "N"]
    indexlists = []
    ALPHABETS = [ALPHABET for x in range(nedit)]
    return list(itertools.product(itertools.combinations(range(maxlen), nedit),
                                  *ALPHABETS))