예제 #1
0
    def test_partition_bmtagger(self):
        outMatch = [
            os.path.join(self.tempDir, 'outMatch.{}.fastq'.format(n))
            for n in '12'
        ]
        outNoMatch = [
            os.path.join(self.tempDir, 'outNoMatch.{}.fastq'.format(n))
            for n in '12'
        ]
        myInputDir = util.file.get_test_input_path(self)
        args = taxon_filter.parser_partition_bmtagger(
            argparse.ArgumentParser()).parse_args([
                os.path.join(myInputDir, 'in1.fastq'),
                os.path.join(myInputDir, 'in2.fastq'),
                os.path.join(self.tempDir, 'humanChr1Subset'),
                os.path.join(self.tempDir,
                             'humanChr9Subset'), '--outMatch', outMatch[0],
                outMatch[1], '--outNoMatch', outNoMatch[0], outNoMatch[1]
            ])
        args.func_main(args)

        # Compare to expected
        for case in ['Match.1', 'Match.2', 'NoMatch.1', 'NoMatch.2']:
            assert_equal_contents(
                self, os.path.join(self.tempDir, 'out' + case + '.fastq'),
                os.path.join(myInputDir, 'expected.' + case + '.fastq'))
예제 #2
0
    def test_deplete_bmtagger(self):
        myInputDir = util.file.get_test_input_path(self)
        args = taxon_filter.parser_partition_bmtagger(argparse.ArgumentParser()).parse_args(
            [os.path.join(myInputDir, 'in1.fastq'), os.path.join(myInputDir, 'in2.fastq'), os.path.join(
                self.tempDir, 'humanChr1Subset'), os.path.join(self.tempDir, 'humanChr9Subset'), '--outNoMatch',
             os.path.join(self.tempDir, 'deplete.1.fastq'), os.path.join(self.tempDir, 'deplete.2.fastq')])
        args.func_main(args)

        # Compare to expected
        for case in ['1', '2']:
            assert_equal_contents(self, os.path.join(self.tempDir, 'deplete.' + case + '.fastq'),
                                  os.path.join(myInputDir, 'expected.NoMatch.' + case + '.fastq'))
예제 #3
0
    def test_partition_bmtagger(self):
        outMatch = [os.path.join(self.tempDir, 'outMatch.{}.fastq'.format(n)) for n in '12']
        outNoMatch = [os.path.join(self.tempDir, 'outNoMatch.{}.fastq'.format(n)) for n in '12']
        myInputDir = util.file.get_test_input_path(self)
        args = taxon_filter.parser_partition_bmtagger(argparse.ArgumentParser()).parse_args(
            [os.path.join(myInputDir, 'in1.fastq'), os.path.join(myInputDir, 'in2.fastq'), os.path.join(
                self.tempDir, 'humanChr1Subset'), os.path.join(self.tempDir, 'humanChr9Subset'), '--outMatch',
             outMatch[0], outMatch[1], '--outNoMatch', outNoMatch[0], outNoMatch[1]])
        args.func_main(args)

        # Compare to expected
        for case in ['Match.1', 'Match.2', 'NoMatch.1', 'NoMatch.2']:
            assert_equal_contents(self, os.path.join(self.tempDir, 'out' + case + '.fastq'),
                                  os.path.join(myInputDir, 'expected.' + case + '.fastq'))