def test_bam_filter_by_tax_id(self): temp_dir = tempfile.gettempdir() input_dir = util.file.get_test_input_path(self) taxonomy_dir = os.path.join(util.file.get_test_input_path(), "TestMetagenomicsSimple", "db", "taxonomy") filtered_bam = util.file.mkstempfname('.bam') args = [ os.path.join(input_dir, "input.bam"), os.path.join(input_dir, "input.kraken-reads.tsv.gz"), filtered_bam, os.path.join(taxonomy_dir, "nodes.dmp"), os.path.join(taxonomy_dir, "names.dmp"), "--taxIDs", "186538" ] args = metagenomics.parser_filter_bam_to_taxa( argparse.ArgumentParser()).parse_args(args) args.func_main(args) expected_bam = os.path.join(input_dir, "expected.bam") assert_equal_bam_reads(self, filtered_bam, expected_bam)
def test_bam_filter_by_tax_id(self): temp_dir = tempfile.gettempdir() input_dir = util.file.get_test_input_path(self) taxonomy_dir = os.path.join(util.file.get_test_input_path(),"TestMetagenomicsSimple","db","taxonomy") filtered_bam = util.file.mkstempfname('.bam') args = [ os.path.join(input_dir,"input.bam"), os.path.join(input_dir,"input.kraken-reads.tsv.gz"), filtered_bam, os.path.join(taxonomy_dir,"nodes.dmp"), os.path.join(taxonomy_dir,"names.dmp"), "--taxIDs", "186538" ] args = metagenomics.parser_filter_bam_to_taxa(argparse.ArgumentParser()).parse_args(args) args.func_main(args) expected_bam = os.path.join(input_dir,"expected.bam") assert_equal_bam_reads(self, filtered_bam, expected_bam)