Esempio n. 1
0
 def test_training_info_deallocation(self):
     p = Pyrodigal(meta=False)
     with warnings.catch_warnings():
         warnings.simplefilter("ignore")
         p.train(str(self.record.seq))
     genes = p.find_genes(str(self.record.seq))
     del p  # normally should not deallocate training info since it's RC
     self.assertEqual(genes[0].translate(), str(self.proteins[0].seq))
Esempio n. 2
0
 def test_empty_sequence(self):
     p = Pyrodigal(meta=False)
     with warnings.catch_warnings():
         warnings.simplefilter("ignore")
         p.train(str(self.record.seq[:20000]))
     genes = p.find_genes("")
     self.assertEqual(len(genes), 0)
     self.assertRaises(StopIteration, next, iter(genes))
Esempio n. 3
0
 def test_short_sequences(self):
     seq = "AATGTAGGAAAAACAGCATTTTCATTTCGCCATTTT"
     p = Pyrodigal(meta=False)
     with warnings.catch_warnings():
         warnings.simplefilter("ignore")
         p.train(str(self.record.seq[:20000]))
     for i in range(1, len(seq)):
         genes = p.find_genes(seq[:i])
         self.assertEqual(len(genes), 0)
         self.assertRaises(StopIteration, next, iter(genes))
Esempio n. 4
0
 def find_genes(cls, seq):
     p = Pyrodigal(meta=False)
     with warnings.catch_warnings():
         warnings.simplefilter("ignore")
         p.train(seq)
     return p.find_genes(seq)