Beispiel #1
0
    def test_run_metaquast_cmd_list_invalid_num_args(self):
        """ test that run_megahit correctly raises a Type Error when an invalid number of arguments is used in place of
         required input """

        # program path
        with self.assertRaises(TypeError):
            exec_metaquast.run_metaquast(self.metaquast_path)
    def test_run_metaquast_cmd_list_invalid_num_args(self):
        """ test that run_megahit correctly raises a Type Error when an invalid number of arguments is used in place of
         required input """

        # program path
        with self.assertRaises(TypeError):
            exec_metaquast.run_metaquast(self.metaquast_path)
    def test_run_metaquast_icarus_generated(self):
        """ test that quast subproccess call generates icarus html report when run_metaquast is passed valid arguments
        for the metaquast file path, output directory, and input contigs indicating completion of the
        metaquast process """

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        exec_metaquast.run_metaquast(self.metaquast_path, self.output_dir, input_contigs)

        self.assertTrue(os.stat(self.icarus_html).st_size > 0)
    def test_run_metaquast_metaquast_log_generated(self):
        """ test that quast subproccess call generates metquast log file when run_metaquast is passed valid arguments
        for the metaquast file path, output directory, and input contigs indicating that a process has been run and that
        input files were modified """

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        exec_metaquast.run_metaquast(self.metaquast_path, self.output_dir, input_contigs)

        self.assertTrue(os.stat(self.metaquast_log).st_size>0)
Beispiel #5
0
    def test_run_metaquast_icarus_generated(self):
        """ test that quast subproccess call generates icarus html report when run_metaquast is passed valid arguments
        for the metaquast file path, output directory, and input contigs indicating completion of the
        metaquast process """

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        exec_metaquast.run_metaquast(self.metaquast_path, self.output_dir,
                                     input_contigs)

        self.assertTrue(os.stat(self.icarus_html).st_size > 0)
Beispiel #6
0
    def test_run_metaquast_metaquast_log_generated(self):
        """ test that quast subproccess call generates metquast log file when run_metaquast is passed valid arguments
        for the metaquast file path, output directory, and input contigs indicating that a process has been run and that
        input files were modified """

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        exec_metaquast.run_metaquast(self.metaquast_path, self.output_dir,
                                     input_contigs)

        self.assertTrue(os.stat(self.metaquast_log).st_size > 0)
    def test_run_metaquast_krona_charts_generated(self):
        """ test that quast subproccess call generates krona charts when run_metaquast is passed valid arguments for
        the metaquast file path, output directory, and input contigs indicating completion of the metaquast process """

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        exec_metaquast.run_metaquast(self.metaquast_path, self.output_dir, input_contigs)

        # check to see that the krona charts exist
        krona_chart_list = os.listdir(self.krona_charts)
        self.assertTrue(len(krona_chart_list) > 0)
Beispiel #8
0
    def test_run_metaquast_krona_charts_generated(self):
        """ test that quast subproccess call generates krona charts when run_metaquast is passed valid arguments for
        the metaquast file path, output directory, and input contigs indicating completion of the metaquast process """

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        exec_metaquast.run_metaquast(self.metaquast_path, self.output_dir,
                                     input_contigs)

        # check to see that the krona charts exist
        krona_chart_list = os.listdir(self.krona_charts)
        self.assertTrue(len(krona_chart_list) > 0)
    def test_run_metaquast_not_aligned_files_generated(self):
        """ test that quast subproccess call generates directory containing reports without alignment when
        run_metaquast is passed valid arguments for the metaquast file path, output directory, and input contigs
        indicating completion of the metaquast process """

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        exec_metaquast.run_metaquast(self.metaquast_path, self.output_dir, input_contigs)

        # check that the not-aligned directory contains files
        not_aligned_file_list = os.listdir(self.not_aligned)
        self.assertTrue(len(not_aligned_file_list) > 0)
Beispiel #10
0
    def test_run_metaquast_not_aligned_files_generated(self):
        """ test that quast subproccess call generates directory containing reports without alignment when
        run_metaquast is passed valid arguments for the metaquast file path, output directory, and input contigs
        indicating completion of the metaquast process """

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        exec_metaquast.run_metaquast(self.metaquast_path, self.output_dir,
                                     input_contigs)

        # check that the not-aligned directory contains files
        not_aligned_file_list = os.listdir(self.not_aligned)
        self.assertTrue(len(not_aligned_file_list) > 0)
    def test_run_metaquast_cmd_list_no_args(self):
        """ test that run_metaquast correctly raises a Value Error when invalid empty string is used in place of
        required input """

        # arguments to be formatted
        null_metaquast_path = ''
        # non-existent fasta files
        null_fa = []
        # option for output directory omitted
        null_outdir = None

        # catch a value exception when strings are empty
        with self.assertRaises(ValueError):
            exec_metaquast.run_metaquast(null_metaquast_path, null_outdir, null_fa)
Beispiel #12
0
    def test_run_metaquast_cmd_list_no_args(self):
        """ test that run_metaquast correctly raises a Value Error when invalid empty string is used in place of
        required input """

        # arguments to be formatted
        null_metaquast_path = ''
        # non-existent fasta files
        null_fa = []
        # option for output directory omitted
        null_outdir = None

        # catch a value exception when strings are empty
        with self.assertRaises(ValueError):
            exec_metaquast.run_metaquast(null_metaquast_path, null_outdir,
                                         null_fa)
    def test_run_metaquast_txt_summary_generated(self):
        """ test that quast subproccess call generates directory containing text based summary reports when
        run_metaquast is passed valid arguments for the metaquast file path, output directory, and input contigs
        indicating completion of the metaquast process """

        _TEXT_DIR = "TXT"

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        exec_metaquast.run_metaquast(self.metaquast_path, self.output_dir, input_contigs)

        # check that txt output is available for future pipeline summary
        text_summary_dir = os.path.join(self.summary, _TEXT_DIR)
        txt_summary_list = os.listdir(text_summary_dir)

        self.assertTrue(len(txt_summary_list) > 0)
Beispiel #14
0
    def test_run_metaquast_txt_summary_generated(self):
        """ test that quast subproccess call generates directory containing text based summary reports when
        run_metaquast is passed valid arguments for the metaquast file path, output directory, and input contigs
        indicating completion of the metaquast process """

        _TEXT_DIR = "TXT"

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        exec_metaquast.run_metaquast(self.metaquast_path, self.output_dir,
                                     input_contigs)

        # check that txt output is available for future pipeline summary
        text_summary_dir = os.path.join(self.summary, _TEXT_DIR)
        txt_summary_list = os.listdir(text_summary_dir)

        self.assertTrue(len(txt_summary_list) > 0)
    def test_run_metaquast_good_stdout(self):
        """ test that quast subproccess call reports successful completion message to stdout when run_metaquast
        is passed valid arguments for the metaquast file path, output directory, and input contigs """

        _SUCCESSFUL_COMPLETION = 'MetaQUAST finished.'

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        stdout, _ = exec_metaquast.run_metaquast(self.metaquast_path, self.output_dir, input_contigs)

        # print(stdout)
        self.assertNotEqual(stdout.find(_SUCCESSFUL_COMPLETION), -1)
Beispiel #16
0
    def test_run_metaquast_good_stdout(self):
        """ test that quast subproccess call reports successful completion message to stdout when run_metaquast
        is passed valid arguments for the metaquast file path, output directory, and input contigs """

        _SUCCESSFUL_COMPLETION = 'MetaQUAST finished.'

        # input file names
        input_contigs = [self.meta_fa_1, self.meta_fa_2]
        stdout, _ = exec_metaquast.run_metaquast(self.metaquast_path,
                                                 self.output_dir,
                                                 input_contigs)

        # print(stdout)
        self.assertNotEqual(stdout.find(_SUCCESSFUL_COMPLETION), -1)