Example #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))
Example #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)
Example #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)
Example #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))
Example #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))
Example #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))
Example #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))
Example #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))
Example #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)
Example #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)
Example #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))
Example #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()))
Example #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))
Example #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()))
Example #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()))
Example #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()))