def test_compile_mothur_script(self): """Mothur._compile_mothur_script() should return valid Mothur script""" app = Mothur() app._input_filename = 'test.fasta' observed_script = app._compile_mothur_script() expected_script = ( '#unique.seqs(fasta=test.fasta); ' 'dist.seqs(fasta=test.unique.fasta); ' 'read.dist(column=test.unique.dist, name=test.names); ' 'cluster(method=furthest)') self.assertEqual(observed_script, expected_script)
def test_get_help(self): """Mothur.getHelp() should return help string""" expected_help = ( 'See manual, available on the MOTHUR wiki:\n' 'http://schloss.micro.umass.edu/mothur/' ) self.assertEqual(Mothur.getHelp(), expected_help)
def test_get_result_paths(self): """Mothur._get_result_paths() should guess correct output paths""" app = Mothur() app._input_filename = 'test.fasta' observed_paths = { 'distance matrix': app._derive_dist_path(), 'otu list': app._derive_list_path(), 'rank abundance': app._derive_rank_abundance_path(), 'species abundance': app._derive_species_abundance_path(), 'unique names': app._derive_names_path(), 'unique seqs': app._derive_unique_path(), } expected_paths = { 'distance matrix': 'test.unique.dist', 'otu list': 'test.unique.fn.list', 'rank abundance': 'test.unique.fn.rabund', 'species abundance': 'test.unique.fn.sabund', 'unique names': 'test.names', 'unique seqs': 'test.unique.fasta', } self.assertEqual(observed_paths, expected_paths)