示例#1
0
 def testCodonContent(self):
     """
     Codons must only contain the letters A, T, G, C.
     """
     for codons in CODONS.values():
         for codon in codons:
             self.assertTrue(all(letter in 'ACGT' for letter in codon))
示例#2
0
 def testStopCodonsNotInCodonTable(self):
     """
     The stop codons must not be in the main table.
     """
     for stop in STOP_CODONS:
         for codons in CODONS.values():
             self.assertNotIn(stop, codons)
示例#3
0
 def testStopCodonsNotInCodonTable(self):
     """
     The stop codons must not be in the main table.
     """
     for stop in STOP_CODONS:
         for codons in CODONS.values():
             self.assertNotIn(stop, codons)
示例#4
0
 def testCodonContent(self):
     """
     Codons must only contain the letters A, T, G, C.
     """
     for codons in CODONS.values():
         for codon in codons:
             self.assertTrue(all(letter in 'ACGT' for letter in codon))
示例#5
0
 def testCodonsAreNotAbbrev3s(self):
     """
     No codon can be the same as an amino acid 3-letter abbreviation (or
     else our find function may not be unambiguous in what it returns).
     """
     for codons in CODONS.values():
         self.assertFalse(
             any(codon.title() in ABBREV3_TO_ABBREV1 for codon in codons))
示例#6
0
 def testCodonsAreNotAbbrev3s(self):
     """
     No codon can be the same as an amino acid 3-letter abbreviation (or
     else our find function may not be unambiguous in what it returns).
     """
     for codons in CODONS.values():
         self.assertFalse(
             any(codon.title() in ABBREV3_TO_ABBREV1 for codon in codons))
示例#7
0
 def testDistinct(self):
     """
     All nucleotide triples must be distinct.
     """
     seen = set()
     for codons in CODONS.values():
         for codon in codons:
             seen.add(codon)
     self.assertEqual(61, len(seen))
示例#8
0
 def testDistinct(self):
     """
     All nucleotide triples must be distinct.
     """
     seen = set()
     for codons in CODONS.values():
         for codon in codons:
             seen.add(codon)
     self.assertEqual(61, len(seen))
示例#9
0
    def testAllCodonsPresent(self):
        """
        All possible codons must be present, as either coding for an AA
        or as a stop codon.
        """
        combinations = set(''.join(x) for x in product('ACGT', 'ACGT', 'ACGT'))
        for codons in CODONS.values():
            for codon in codons:
                combinations.remove(codon)

        # Just the stop codons should be left.
        self.assertEqual(set(STOP_CODONS), combinations)
示例#10
0
    def testAllCodonsPresent(self):
        """
        All possible codons must be present, as either coding for an AA
        or as a stop codon.
        """
        combinations = set(
            ''.join(x) for x in product('ACGT', 'ACGT', 'ACGT'))
        for codons in CODONS.values():
            for codon in codons:
                combinations.remove(codon)

        # Just the stop codons should be left.
        self.assertEqual(set(STOP_CODONS), combinations)
示例#11
0
 def testCodonLength(self):
     """
     All codons must be three bases long.
     """
     for codons in CODONS.values():
         self.assertTrue(all(len(codon) == 3 for codon in codons))
示例#12
0
 def testNumberCodons(self):
     """
     The table must contain 61 codons. This is 4^3 - 3. I.e., all possible
     combinations of 3 bases minus the three stop codons.
     """
     self.assertEqual(61, sum(len(codons) for codons in CODONS.values()))
示例#13
0
 def testCodonLength(self):
     """
     All codons must be three bases long.
     """
     for codons in CODONS.values():
         self.assertTrue(all(len(codon) == 3 for codon in codons))
示例#14
0
 def testNumberCodons(self):
     """
     The table must contain 61 codons. This is 4^3 - 3. I.e., all possible
     combinations of 3 bases minus the three stop codons.
     """
     self.assertEqual(61, sum(len(codons) for codons in CODONS.values()))
示例#15
0
 def testNumberCodons(self):
     """
     The table must contain the right number of codons.
     """
     self.assertEqual(44, sum(len(codons) for codons in CODONS.values()))
示例#16
0
 def testNumberCodons(self):
     """
     The table must contain the right number of codons.
     """
     self.assertEqual(44, sum(len(codons) for codons in CODONS.values()))