def _truncate(seq: str):
    """Removes the prefix before the first ATG.
    and any trailing nucleotides that are not
    part of a full codon.

    Args:
        seq (str): Nucleotide sequence to truncate

    Returns:
        str or None: the truncated sequence or None if
                     no start codon was found.
    """
    seq = seq.upper()
    for start in range(0, len(seq) - 2):
        codon = seq[start:start+3]
        if codon == "ATG":
            res = seq[start:]
            trailing_nuc = len(res) % 3
            if trailing_nuc > 0:
                return res[:-trailing_nuc]
            else:
                return res