예제 #1
0
 def test_unclassifiable_sequence(self):
     query_file = StringIO(
         ">MostlyTs\nTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT"
         "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTATTTTTTTTTTTTTTTTTTTTTTTTTTTTTT"
         "TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT\n")
     res = mothur_classify_file(
         query_file,  self.ref_file.name, self.tax_file.name)
     exp_res = {
         'MostlyTs': (['Unknown'], 0.0),
         }
     self.assertEqual(res, exp_res)
예제 #2
0
 def test_mothur_classify_file(self):
     query_file = StringIO(mothur_seqs)
     res = mothur_classify_file(
         query_file,  self.ref_file.name, self.tax_file.name)
     exp_res = {
         'A': (['k__Bacteria', 'p__Firmicutes', 'c__Clostridia',
                'o__Clostridale', 'f__Eubacteriaceae', 'g__Eubacterium',
                's__Eubacteriumfoedans'], 1.0),
         'Very': (['k__Bacteria', 'p__Bacteriodetes'], 1.0),
         '01': (['k__Bacteria', 'p__Firmicutes'], 1.0),
         }
     self.assertEqual(res, exp_res)
예제 #3
0
 def __call__(self, seq_path, result_path=None, log_path=None):
     seq_file = open(seq_path)
     percent_confidence = int(self.Params['Confidence'] * 100)
     result = mothur.mothur_classify_file(
         query_file=seq_file,
         ref_fp=self.Params['reference_sequences_fp'],
         tax_fp=self.Params['id_to_taxonomy_fp'],
         cutoff=percent_confidence,
         iters=self.Params['Iterations'],
         ksize=self.Params['KmerSize'],
         output_fp=result_path,
     )
     if log_path:
         self.writeLog(log_path)
     return result
예제 #4
0
 def __call__(self, seq_path, result_path=None, log_path=None):
     seq_file = open(seq_path)
     percent_confidence = int(self.Params['Confidence'] * 100)
     result = mothur.mothur_classify_file(
         query_file=seq_file,
         ref_fp=self.Params['reference_sequences_fp'],
         tax_fp=self.Params['id_to_taxonomy_fp'],
         cutoff=percent_confidence,
         iters=self.Params['Iterations'],
         ksize=self.Params['KmerSize'],
         output_fp=result_path,
     )
     if log_path:
         self.writeLog(log_path)
     return result