def test_parse_sam_best(self): for test in self.blast: df = FeatureAnnt.parse_sam(test[2], column='bitscore') df = df.reindex_axis(sorted(df.columns), axis=1) exp = df.reindex_axis(sorted(self.exp.columns), axis=1) pdt.assert_frame_equal(df, exp)
def test_blast(self): for test in self.tests: pred = FeatureAnnt([self.db], mkdtemp(dir=self.tmp_dir)) obs = pred(test.input, aligner=test.aligner, outfmt='tab') exp = pred._filter_best(pred.parse_tabular('%s.diamond' % test.exp)) self.assertTrue(exp.equals(obs)) obs = pred(test.input, aligner=test.aligner, outfmt='sam') exp = pred._filter_id_cov(pred.parse_sam('%s.sam' % test.exp)) self.assertTrue(exp.equals(obs))
def test_blast(self): for test in self.tests: pred = FeatureAnnt([self.db], mkdtemp(dir=self.tmp_dir)) obs = pred(test.input, aligner=test.aligner, outfmt='tab') exp = pred._filter_best( pred.parse_tabular('%s.diamond' % test.exp)) self.assertTrue(exp.equals(obs)) obs = pred(test.input, aligner=test.aligner, outfmt='sam') exp = pred._filter_id_cov(pred.parse_sam('%s.sam' % test.exp)) self.assertTrue(exp.equals(obs))
def test_filter_id_cov(self): for test in self.filter_tests2: df = FeatureAnnt.parse_sam(test.input) df_filter = FeatureAnnt._filter_id_cov(df, pident=30, cov=92) df_filter.to_csv(test.obs, sep='\t') self.assertTrue(cmp(test.exp, test.obs, shallow=False))
def test_parse_sam(self): for test in self.sam_tests: df = FeatureAnnt.parse_sam(test.input) df.to_csv(test.obs, sep='\t', index=False) self.assertTrue(cmp(test.exp, test.obs, shallow=False))