def get_clean_seq(seq):
    """
    Collapse long stretches of N in a sequence
    :param seq: string or iterable representation of the sequence
    :return: tuple(a list containing the original sequence with 'N's collapsed and counted, total number of 'N's)
    """
    total_n = 0
    ncount = 0
    new_seq = []
    for i, n in enumerate(seq):
        if n.upper() == 'N':
            ncount += 1
            continue
        else:
            if ncount > 0:
                new_seq.append(str(ncount) + 'N')
                total_n += ncount
                ncount = 0
            new_seq.append(n)
    return new_seq, total_n