def testMutationPositionStartCodon2(self): mutation_position = 3 # @formatter:off database_amr_gene_string = "ATCGATCGA" input_genome_string = "ATCAATCGA" #@formatter:on amr_gene_start = 1 mutation = CodonMutationPosition(mutation_position, database_amr_gene_string, input_genome_string, amr_gene_start) self.assertEqual(mutation.get_nucleotide_position(), 4, 'Incorrect nucleotide position') self.assertEqual(mutation.get_codon_start(), 2, 'Incorrect codon start') self.assertEqual(mutation.get_mutation_position(), 2, 'Incorrect mutation start') self.assertEqual(mutation.get_database_amr_gene_codon(), 'GAT', 'Incorrect database codon') self.assertEqual(mutation.get_input_genome_codon(), 'AAT', 'Incorrect query codon') self.assertEqual(mutation.get_database_amr_gene_mutation(), 'D', 'Incorrect database amino acid') self.assertEqual(mutation.get_input_genome_mutation(), 'N', 'Incorrect query amino acid') self.assertEqual(mutation.get_mutation_string_short(), 'D2N', 'Incorrect string')
def testMutationPositionEndCodon1(self): mutation_position = 2 # @formatter:off database_amr_gene_string = "ATCGATCGA" input_genome_string = "ATGGATCGA" #@formatter:on amr_gene_start = 1 mutation = CodonMutationPosition(mutation_position, database_amr_gene_string, input_genome_string, amr_gene_start) self.assertEqual(mutation.get_nucleotide_position(), 3, 'Incorrect nucleotide position') self.assertEqual(mutation.get_codon_start(), 1, 'Incorrect codon start') self.assertEqual(mutation.get_mutation_position(), 1, 'Incorrect mutation start') self.assertEqual(mutation.get_database_amr_gene_codon(), 'ATC', 'Incorrect database codon') self.assertEqual(mutation.get_input_genome_codon(), 'ATG', 'Incorrect query codon') self.assertEqual(mutation.get_database_amr_gene_mutation(), 'I', 'Incorrect database amino acid') self.assertEqual(mutation.get_input_genome_mutation(), 'M', 'Incorrect query amino acid') self.assertEqual(mutation.get_mutation_string_short(), 'I1M', 'Incorrect string')
def testMutationPositionGapBeforeAfter(self): mutation_position = 3 # @formatter:off database_amr_gene_string = "CCCATCGACT" input_genome_string = "-CCA--GA-T" #@formatter:on amr_gene_start = 1 mutation = CodonMutationPosition(mutation_position, database_amr_gene_string, input_genome_string, amr_gene_start) self.assertEqual(mutation.get_nucleotide_position(), 4, 'Incorrect nucleotide position') self.assertEqual(mutation.get_codon_start(), 2, 'Incorrect codon start') self.assertEqual(mutation.get_mutation_position(), 2, 'Incorrect mutation start') self.assertEqual(mutation.get_database_amr_gene_codon(), 'ATC', 'Incorrect database codon') self.assertEqual(mutation.get_input_genome_codon(), 'A--', 'Incorrect query codon') self.assertEqual(mutation.get_database_amr_gene_mutation(), 'I', 'Incorrect database amino acid') self.assertEqual(mutation.get_input_genome_mutation(), 'X', 'Incorrect query amino acid') self.assertEqual(mutation.get_mutation_string_short(), 'I2X', 'Incorrect string')
def testMutationPositionGapReferenceMiddle(self): mutation_position = 1 # @formatter:off database_amr_gene_string = "A-CG" input_genome_string = "ATCG" #@formatter:on amr_gene_start = 1 mutation = CodonMutationPosition(mutation_position, database_amr_gene_string, input_genome_string, amr_gene_start) self.assertEqual(mutation.get_nucleotide_position(), 2, 'Incorrect nucleotide position') self.assertEqual(mutation.get_codon_start(), 1, 'Incorrect codon start') self.assertEqual(mutation.get_mutation_position(), 1, 'Incorrect mutation start') self.assertEqual(mutation.get_database_amr_gene_codon(), 'A-C', 'Incorrect database codon') self.assertEqual(mutation.get_input_genome_codon(), 'ATC', 'Incorrect query codon') self.assertEqual(mutation.get_database_amr_gene_mutation(), 'X', 'Incorrect database amino acid') self.assertEqual(mutation.get_input_genome_mutation(), 'I', 'Incorrect query amino acid') self.assertEqual(mutation.get_mutation_string_short(), 'X1I', 'Incorrect string')
def testMutationPositionGapReferenceLargerPreviousCodon(self): mutation_position = 3 # @formatter:off database_amr_gene_string = "C-----GACTT" input_genome_string = "CCCATCGACTT" # @formatter:on amr_gene_start = 1 mutation = CodonMutationPosition(mutation_position, database_amr_gene_string, input_genome_string, amr_gene_start) self.assertEqual(mutation.get_nucleotide_position(), 4, 'Incorrect nucleotide position') self.assertEqual(mutation.get_codon_start(), 2, 'Incorrect codon start') self.assertEqual(mutation.get_mutation_position(), 2, 'Incorrect mutation start') self.assertEqual(mutation.get_database_amr_gene_codon(), '---', 'Incorrect database codon') self.assertEqual(mutation.get_input_genome_codon(), 'ATC', 'Incorrect query codon') self.assertEqual(mutation.get_database_amr_gene_mutation(), 'ins', 'Incorrect database amino acid') self.assertEqual(mutation.get_input_genome_mutation(), 'I', 'Incorrect query amino acid') self.assertEqual(mutation.get_mutation_string_short(), 'ins2I', 'Incorrect string')