def fixSeq(sequence, protAlignment):
    """takes a nucleotide sequence and adds in gaps based on the corresponding
    protein alignment."""
    result = ''
    x = 0
    y = 0
    while y != len(protAlignment):
        if protAlignment[y] == '-':
            result += '---'
            y += 1
        else:
            result += sequence[3 * x:3 * (x + 1)].upper()
            x += 1
            y += 1
    return result
