Exemplo n.º 1
0
 def test_format_function_arguments(self):
     app = MothurClassifySeqs({
         'reference': '/home/myuser/ref-seqs.fasta',
         'taxonomy': '/home/MyUser/data/tax.txt',
         'cutoff': 80,
     })
     obs_args = app._format_function_arguments(
         ['reference', 'taxonomy', 'cutoff', 'iters'])
     exp_args = ("reference=/home/myuser/ref\\-seqs.fasta, "
                 "taxonomy=/home/MyUser/data/tax.txt, cutoff=80")
     self.assertEqual(obs_args, exp_args)
Exemplo n.º 2
0
    def test_app(self):
        app = MothurClassifySeqs({
            'reference': self.ref_file.name,
            'taxonomy': self.tax_file.name,
        })
        res = app(mothur_seqs)
        assignments = res['assignments'].read()
        self.assertEqual(assignments, mothur_assignments)

        summary = res['summary'].read()
        self.assertEqual(summary, mothur_summary)
Exemplo n.º 3
0
 def test_compile_mothur_script(self):
     app = MothurClassifySeqs({
         'reference': '/home/myuser/ref-seqs.fasta',
         'taxonomy': '/home/MyUser/data/tax.txt',
         'cutoff': 80,
     })
     app._input_filename = "/my/input.fasta"
     exp_script = ("#classify.seqs(fasta=/my/input.fasta, "
                   "reference=/home/myuser/ref\-seqs.fasta, "
                   "taxonomy=/home/MyUser/data/tax.txt, "
                   "cutoff=80)")
     self.assertEqual(app._compile_mothur_script(), exp_script)