def group_fasta(fa):
    """
    return:
        {>id: ATCG..., }
    """
    ids = []
    seqs = []
    seq = ''
    with open(fa, 'r') as fo:
        n = 0
        while True:
            line = fo.readline().strip('\n')

            if line.startswith('>'):
                ids.append(line)
                if seq:
                    seqs.append(seq)
                seq = ''
            else:
                if line:
                    seq += line

            if line == '':
                seqs.append(seq)
                break

            n += 1
    seqmap = dict(zip(ids, seqs))
    return seqmap