コード例 #1
0
ファイル: test_usage.py プロジェクト: GavinHuttley/pycogent
 def test_aminoAcids(self):
     """BaseUsage aminoAcids should give the same results as the codons"""
     known_data = {
         'AAA' : .6 * .6 * .6,
         'AAU' : .6 * .6 * .4,
         'AUA' : .6 * .4 * .6,
         'AUU' : .6 * .4 * .4,
         'UAA' : .4 * .6 * .6,
         'UAU' : .4 * .6 * .4,
         'UUA' : .4 * .4 * .6,
         'UUU' : .4 * .4 * .4,
     }
     known = CodonUsage(known_data)
     b = BaseUsage({'a':3, 'T':2, 'X':1})
     self.assertEqual(b.aminoAcids(), known.aminoAcids())
     #check that the genetic code is passed through correctly
     all_g = GeneticCode('G'*64)
     self.assertEqual(b.aminoAcids(all_g), AminoAcidUsage({'G':1}))
コード例 #2
0
 def test_aminoAcids(self):
     """BaseUsage aminoAcids should give the same results as the codons"""
     known_data = {
         'AAA': .6 * .6 * .6,
         'AAU': .6 * .6 * .4,
         'AUA': .6 * .4 * .6,
         'AUU': .6 * .4 * .4,
         'UAA': .4 * .6 * .6,
         'UAU': .4 * .6 * .4,
         'UUA': .4 * .4 * .6,
         'UUU': .4 * .4 * .4,
     }
     known = CodonUsage(known_data)
     b = BaseUsage({'a': 3, 'T': 2, 'X': 1})
     self.assertEqual(b.aminoAcids(), known.aminoAcids())
     #check that the genetic code is passed through correctly
     all_g = GeneticCode('G' * 64)
     self.assertEqual(b.aminoAcids(all_g), AminoAcidUsage({'G': 1}))