def _check_codons(self):
        """
        If codon table is missing stop codons, then add them.
        """
        for stop_codon in self.stop_codons:
            if stop_codon in self.codon_table:
                if self.codon_table[stop_codon] != "*":
                    raise ValueError(
                        ("Codon '%s' not found in stop_codons, but codon table "
                         "indicates that it should be") % (stop_codon,))
            else:
                self.codon_table[stop_codon] = "*"

        for start_codon in self.start_codons:
            if start_codon not in self.codon_table:
                raise ValueError(
                    "Start codon '%s' missing from codon table" % (
                        start_codon,))

        for codon, amino_acid in self.codon_table.items():
            if amino_acid == "*" and codon not in self.stop_codons:
                raise ValueError(
                    "Non-stop codon '%s' can't translate to '*'" % (
                        codon,))

        if len(self.codon_table) != 64:
            raise ValueError(
                "Expected 64 codons but found %d in codon table" % (
                    len(self.codon_table,)))
If codon table is missing stop codons, then add them.