def updateSNPs(self, snp, is_negative_strand, pos):
        '''update SNPs.'''

        contig = snp.chromosome
        lcontig = self.mFasta.getLength(contig)
        reference_base = snp.reference_base

        if snp.genotype in 'ACGTacgt':
            # homozygous substitution
            self.mVariantType.append("O")
        else:
            # heterozygous substitution
            self.mVariantType.append("E")

        # switch reference strand codon to correct strand
        if reference_base != "*" and is_negative_strand:
            reference_base = Genomics.complement(reference_base)

        # collect all possible variants of reference codons
        for reference_codon in self.mReferenceCodons:

            self.mReferenceAAs.append(Genomics.translate(reference_codon))

            # process single base changes
            variant_bases = Genomics.resolveAmbiguousNA(snp.genotype)

            if reference_codon[pos] != reference_base:
                raise ValueError("base mismatch at %i (codon=%s,%i): codon:%s != genome:%s; `%s`" %
                                 (snp.pos, reference_codon, pos, reference_codon[pos], reference_base, ";".join(map(str, snp))))

            for variant_base in variant_bases:
                if is_negative_strand:
                    variant_base = Genomics.complement(variant_base)

        self.mVariantAAs.extend([Genomics.translate(x)
                                 for x in self.mVariantCodons])
dataset/ETHPy150Open CGATOxford/cgat/scripts/snp2table.py/BaseAnnotatorCodon.updateSNPs/original