Example #1
0
 def test_simple_phylo_inference ( self ) :
     """
     Test of the phylogenetic inference method for all the available
     configurations with supported input and output formats.
     """
     for keyword in viewkeys(Inference.get_keywords(raxml_exe)) :
         self.standard_test('fasta', 'newick', keyword)
Example #2
0
    def standard_test(self, informat, outformat, params):
        """
        Standard testing procedure used by all tests.

        Arguments :
            informat  ( string )
                Input file format.
            outformat  ( string )
                Output file format.
            params  ( string )
                Arguments passed to the phylogenetic inference tool.
        """
        infile = '{}/f001.mafft_default.aln'.format(informat.capitalize())
        outfile = 'tmp_test.tree'
        self.add_file_to_clean(outfile)
        # Check the input
        self.assertTrue(os.path.isfile(infile))
        self.assertEqual(len(list(SeqIO.parse(infile, informat))), 50)
        # Generate the phylogeny
        t, score = Inference.get_phylogeny(fasttree_exe,
                                           infile,
                                           informat,
                                           args=params,
                                           outfile=outfile,
                                           outfile_format=outformat)
        # Check the output
        self.assertTrue(os.path.isfile(outfile))
    def standard_test ( self, informat, outformat, params ) :
        """
        Standard testing procedure used by all tests.

        Arguments :
            informat  ( string )
                Input file format.
            outformat  ( string )
                Output file format.
            params  ( string )
                Arguments passed to the phylogenetic inference tool.
        """
        infile = '{}/f001.mafft_default.aln'.format(informat.capitalize())
        outfile = 'tmp_test.tree'
        self.add_file_to_clean(outfile)
        # Check the input
        self.assertTrue(os.path.isfile(infile))
        self.assertEqual(len(list(SeqIO.parse(infile, informat))), 50)
        # Generate the phylogeny
        t, score = Inference.get_phylogeny(raxml_exe, infile, informat,
            args=params, outfile=outfile, outfile_format=outformat)
        # Check the output
        self.assertTrue(os.path.isfile(outfile))