Exemple #1
0
    def test_humann_m8(self):
        """
        Test the standard humann flow on a m8 input file
        """
        
        # create a temp directory for output
        tempdir = utils.create_temp_folder("m8")
        
        # run humann test
        command = ["humann","--input",cfg.demo_m8,"--output",tempdir]
        utils.run_humann(command)
        
        # check the output files are as expected
        for expression, message in utils.check_output(cfg.expected_demo_output_files, tempdir):
            self.assertTrue(expression,message)

        # remove the temp directory
        utils.remove_temp_folder(tempdir)
Exemple #2
0
    def test_humann_fasta_bypass_prescreen(self):
        """
        Test the standard humann flow on a fasta input file
        Test with bypassing prescreen
        """
        
        # create a temp directory for output
        tempdir = utils.create_temp_folder("fasta_bypass_prescreen")
        
        # run humann test
        command = ["humann","--input",cfg.demo_fasta,"--output",tempdir,"--bypass-prescreen"]
        utils.run_humann(command)
        
        # check the output files are as expected
        for expression, message in utils.check_output(cfg.expected_demo_output_files, tempdir):
            self.assertTrue(expression,message)

        # remove the temp directory
        utils.remove_temp_folder(tempdir)
Exemple #3
0
    def test_humann_gene_families(self):
        """
        Test the standard humann flow on a gene families output file as input
        """
        
        # create a temp directory for output
        tempdir = utils.create_temp_folder("gene_families")
        
        # run humann test
        command = ["humann","--input",cfg.demo_gene_families,"--output",tempdir]
        utils.run_humann(command)
        
        # check the output files are as expected
        # it will include all output files except the gene families output file
        # since this file was used as input
        for expression, message in utils.check_output(cfg.expected_demo_output_files_genefamilies_input, tempdir):
            self.assertTrue(expression,message)

        # remove the temp directory
        utils.remove_temp_folder(tempdir)
Exemple #4
0
    def test_humann_fastq_custom_taxonomic_profile(self):
        """
        Test the standard humann flow on a fastq input file
        Test with a custom taxonomic profile
        """
        
        # create a temp directory for output
        tempdir = utils.create_temp_folder("fastq_custom_taxonomic_profile")
        
        # run humann test
        command = ["humann","--input",cfg.demo_fastq,"--output",tempdir,"--taxonomic-profile",
                   cfg.demo_bugs_list]
        utils.run_humann(command)
        
        # check the output files are as expected
        for expression, message in utils.check_output(cfg.expected_demo_output_files, tempdir):
            self.assertTrue(expression,message)

        # remove the temp directory
        utils.remove_temp_folder(tempdir)
    def test_humann_fastq_biom_output(self):
        """
        Test the standard humann flow on a fastq input file
        Test biom output is written
        """
        
        # create a temp directory for output
        tempdir = utils.create_temp_folder("fastq")
        
        # run humann test
        command = ["humann","--input",cfg.demo_fastq,"--output",tempdir,
                   "--output-format", "biom"]
        utils.run_humann(command)
        
        # check the output files are as expected
        for expression, message in utils.check_output(cfg.expected_demo_output_files_biom, tempdir):
            self.assertTrue(expression,message)

        # remove the temp directory
        utils.remove_temp_folder(tempdir)
    def test_humann_fastq_biom_output_pathways(self):
        """
        Test the standard humann flow on a fastq input file
        Test biom output is written
        Test the expected pathways are identified
        """
        
        # create a temp directory for output
        tempdir = utils.create_temp_folder("fastq")
        
        # run humann test
        command = ["humann","--input",cfg.demo_fastq,"--output",tempdir,
                   "--output-format", "biom", "--gap-fill", "off"]
        utils.run_humann(command)
        
        # check the output file of pathway abundance has the expected pathways
        pathways_file_tsv=utils.read_biom_table(os.path.join(tempdir,"demo_pathabundance.biom"))
        pathways_found=set([x.split("\t")[0].split(":")[0] for x in filter(lambda x: "PWY" in x, pathways_file_tsv)])
        
        self.assertEqual(pathways_found,cfg.expected_demo_output_files_biom_pathways)

        # remove the temp directory
        utils.remove_temp_folder(tempdir)