[med-svn] r15619 - trunk/packages/qiime/trunk/debian/patches

Andreas Tille tille at moszumanska.debian.org
Thu Dec 26 23:29:30 UTC 2013


Author: tille
Date: 2013-12-26 23:29:30 +0000 (Thu, 26 Dec 2013)
New Revision: 15619

Added:
   trunk/packages/qiime/trunk/debian/patches/exclude_tests_that_need_to_fail.patch
Modified:
   trunk/packages/qiime/trunk/debian/patches/series
Log:
Try to get rid of calls to uclust in test cases which is not distributable in Debian and since we can not run the tests (there are more tests to exclude but for the moment I'll drop the strategy here.


Added: trunk/packages/qiime/trunk/debian/patches/exclude_tests_that_need_to_fail.patch
===================================================================
--- trunk/packages/qiime/trunk/debian/patches/exclude_tests_that_need_to_fail.patch	                        (rev 0)
+++ trunk/packages/qiime/trunk/debian/patches/exclude_tests_that_need_to_fail.patch	2013-12-26 23:29:30 UTC (rev 15619)
@@ -0,0 +1,923 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Thu, 26 Dec 2013 07:39:57 +0100
+Description: Exclude tests that need to fail
+ uclust is non-free and can not be packaged.  The QIIME package just contains
+ a wrapper telling this fact the user and thus the tests will fail.  To avoid
+ useless failures these tests are excluded.
+
+
+--- a/tests/test_align_seqs.py
++++ b/tests/test_align_seqs.py
+@@ -134,20 +134,20 @@ class InfernalAlignerTests(SharedSetupTe
+          LoadSeqs(data=infernal_test1_expected_alignment,aligned=Alignment,\
+             moltype=DNA)
+ 
+-    def test_call_infernal_test1_file_output(self):
+-        """InfernalAligner writes correct output files for infernal_test1 seqs
+-        """
+-        # do not collect results; check output files instead
+-        actual = self.infernal_test1_aligner(\
+-         self.infernal_test1_input_fp, result_path=self.result_fp,
+-         log_path=self.log_fp)
+-         
+-        self.assertTrue(actual == None,\
+-         "Result should be None when result path provided.")
+-         
+-        expected_aln = self.infernal_test1_expected_aln
+-        actual_aln = LoadSeqs(self.result_fp,aligned=Alignment)
+-        self.assertEqual(actual_aln,expected_aln)
++#    def test_call_infernal_test1_file_output(self):
++#        """InfernalAligner writes correct output files for infernal_test1 seqs
++#        """
++#        # do not collect results; check output files instead
++#        actual = self.infernal_test1_aligner(\
++#         self.infernal_test1_input_fp, result_path=self.result_fp,
++#         log_path=self.log_fp)
++#         
++#        self.assertTrue(actual == None,\
++#         "Result should be None when result path provided.")
++#         
++#        expected_aln = self.infernal_test1_expected_aln
++#        actual_aln = LoadSeqs(self.result_fp,aligned=Alignment)
++#        self.assertEqual(actual_aln,expected_aln)
+ 
+     def test_call_infernal_test1(self):
+         """InfernalAligner: functions as expected when returing objects
+@@ -221,84 +221,84 @@ class PyNastAlignerTests(SharedSetupTest
+         self.pynast_test1_expected_fail = \
+          LoadSeqs(data=pynast_test1_expected_failure,aligned=False)
+ 
+-    def test_call_pynast_test1_file_output(self):
+-        """PyNastAligner writes correct output files for pynast_test1 seqs
+-        """
+-        # do not collect results; check output files instead
+-        actual = self.pynast_test1_aligner(\
+-         self.pynast_test1_input_fp, result_path=self.result_fp,
+-         log_path=self.log_fp, failure_path=self.failure_fp)
+-         
+-        self.assertTrue(actual == None,\
+-         "Result should be None when result path provided.")
+-         
+-        expected_aln = self.pynast_test1_expected_aln
+-        actual_aln = LoadSeqs(self.result_fp,aligned=DenseAlignment)
+-        self.assertEqual(actual_aln,expected_aln)
+-
+-        actual_fail = LoadSeqs(self.failure_fp,aligned=False)
+-        self.assertEqual(actual_fail.toFasta(),\
+-                         self.pynast_test1_expected_fail.toFasta())
+-
+-
+-    def test_call_pynast_test1_file_output_alt_params(self):
+-        """PyNastAligner writes correct output files when no seqs align
+-        """
+-        aligner = PyNastAligner({
+-                'template_filepath': self.pynast_test1_template_fp,
+-                'min_len':1000})
+-                
+-        actual = aligner(\
+-         self.pynast_test1_input_fp, result_path=self.result_fp,
+-         log_path=self.log_fp, failure_path=self.failure_fp)
+-         
+-        self.assertTrue(actual == None,\
+-         "Result should be None when result path provided.")
+-        
+-        self.assertEqual(getsize(self.result_fp),0,\
+-         "No alignable seqs should result in an empty file.")
+-
+-        # all seqs reported to fail
+-        actual_fail = LoadSeqs(self.failure_fp,aligned=False)
+-        self.assertEqual(actual_fail.getNumSeqs(),3)
+-
+-    def test_call_pynast_test1(self):
+-        """PyNastAligner: functions as expected when returing objects
+-        """
+-        actual_aln = self.pynast_test1_aligner(self.pynast_test1_input_fp)
+-        expected_aln = self.pynast_test1_expected_aln
+-
+-        expected_names = ['1 description field 1..23', '2 1..23']
+-        self.assertEqual(actual_aln.Names, expected_names)
+-        self.assertEqual(actual_aln, expected_aln)
+-        
+-    def test_call_pynast_template_aln_with_dots(self):
+-        """PyNastAligner: functions when template alignment contains dots
+-        """
+-        pynast_aligner = PyNastAligner({
+-                'template_filepath': self.pynast_test_template_w_dots_fp,
+-                'min_len': 15,
+-                })
+-        actual_aln = pynast_aligner(self.pynast_test1_input_fp)
+-        expected_aln = self.pynast_test1_expected_aln
+-
+-        expected_names = ['1 description field 1..23', '2 1..23']
+-        self.assertEqual(actual_aln.Names, expected_names)
+-        self.assertEqual(actual_aln, expected_aln)
+-        
+-    def test_call_pynast_template_aln_with_lower(self):
+-        """PyNastAligner: functions when template alignment contains lower case
+-        """
+-        pynast_aligner = PyNastAligner({
+-                'template_filepath': self.pynast_test_template_w_lower_fp,
+-                'min_len': 15,
+-                })
+-        actual_aln = pynast_aligner(self.pynast_test1_input_fp)
+-        expected_aln = self.pynast_test1_expected_aln
+-
+-        expected_names = ['1 description field 1..23', '2 1..23']
+-        self.assertEqual(actual_aln.Names, expected_names)
+-        self.assertEqual(actual_aln, expected_aln)
++#    def test_call_pynast_test1_file_output(self):
++#        """PyNastAligner writes correct output files for pynast_test1 seqs
++#        """
++#        # do not collect results; check output files instead
++#        actual = self.pynast_test1_aligner(\
++#         self.pynast_test1_input_fp, result_path=self.result_fp,
++#         log_path=self.log_fp, failure_path=self.failure_fp)
++#         
++#        self.assertTrue(actual == None,\
++#         "Result should be None when result path provided.")
++#         
++#        expected_aln = self.pynast_test1_expected_aln
++#        actual_aln = LoadSeqs(self.result_fp,aligned=DenseAlignment)
++#        self.assertEqual(actual_aln,expected_aln)
++#
++#        actual_fail = LoadSeqs(self.failure_fp,aligned=False)
++#        self.assertEqual(actual_fail.toFasta(),\
++#                         self.pynast_test1_expected_fail.toFasta())
++
++
++#    def test_call_pynast_test1_file_output_alt_params(self):
++#        """PyNastAligner writes correct output files when no seqs align
++#        """
++#        aligner = PyNastAligner({
++#                'template_filepath': self.pynast_test1_template_fp,
++#                'min_len':1000})
++#                
++#        actual = aligner(\
++#         self.pynast_test1_input_fp, result_path=self.result_fp,
++#         log_path=self.log_fp, failure_path=self.failure_fp)
++#         
++#        self.assertTrue(actual == None,\
++#         "Result should be None when result path provided.")
++#        
++#        self.assertEqual(getsize(self.result_fp),0,\
++#         "No alignable seqs should result in an empty file.")
++#
++#        # all seqs reported to fail
++#        actual_fail = LoadSeqs(self.failure_fp,aligned=False)
++#        self.assertEqual(actual_fail.getNumSeqs(),3)
++
++#    def test_call_pynast_test1(self):
++#        """PyNastAligner: functions as expected when returing objects
++#        """
++#        actual_aln = self.pynast_test1_aligner(self.pynast_test1_input_fp)
++#        expected_aln = self.pynast_test1_expected_aln
++#
++#        expected_names = ['1 description field 1..23', '2 1..23']
++#        self.assertEqual(actual_aln.Names, expected_names)
++#        self.assertEqual(actual_aln, expected_aln)
++        
++#    def test_call_pynast_template_aln_with_dots(self):
++#        """PyNastAligner: functions when template alignment contains dots
++#        """
++#        pynast_aligner = PyNastAligner({
++#                'template_filepath': self.pynast_test_template_w_dots_fp,
++#                'min_len': 15,
++#                })
++#        actual_aln = pynast_aligner(self.pynast_test1_input_fp)
++#        expected_aln = self.pynast_test1_expected_aln
++#
++#        expected_names = ['1 description field 1..23', '2 1..23']
++#        self.assertEqual(actual_aln.Names, expected_names)
++#        self.assertEqual(actual_aln, expected_aln)
++        
++#    def test_call_pynast_template_aln_with_lower(self):
++#        """PyNastAligner: functions when template alignment contains lower case
++#        """
++#        pynast_aligner = PyNastAligner({
++#                'template_filepath': self.pynast_test_template_w_lower_fp,
++#                'min_len': 15,
++#                })
++#        actual_aln = pynast_aligner(self.pynast_test1_input_fp)
++#        expected_aln = self.pynast_test1_expected_aln
++#
++#        expected_names = ['1 description field 1..23', '2 1..23']
++#        self.assertEqual(actual_aln.Names, expected_names)
++#        self.assertEqual(actual_aln, expected_aln)
+ 
+     def test_call_pynast_template_aln_with_U(self):
+         """PyNastAligner: error message when template contains bad char
+@@ -309,43 +309,43 @@ class PyNastAlignerTests(SharedSetupTest
+                 })
+         self.assertRaises(KeyError,pynast_aligner,self.pynast_test1_input_fp)
+         
+-    def test_call_pynast_alt_pairwise_method(self):
+-        """PyNastAligner: alternate pairwise alignment method produces correct alignment
+-        """
+-        aligner = PyNastAligner({
+-                'pairwise_alignment_method': 'muscle',
+-                'template_filepath': self.pynast_test1_template_fp,
+-                'min_len': 15,
+-                })
+-        actual_aln = aligner(self.pynast_test1_input_fp)
+-        expected_aln = self.pynast_test1_expected_aln
+-        self.assertEqual(actual_aln, expected_aln)
+-        
+-    def test_call_pynast_test1_alt_min_len(self):
+-        """PyNastAligner: returns no result when min_len too high
+-        """
+-        aligner = PyNastAligner({
+-                'template_filepath': self.pynast_test1_template_fp,
+-                'min_len':1000})
+-        
+-        actual_aln = aligner(\
+-         self.pynast_test1_input_fp)
+-        expected_aln = {}
+-
+-        self.assertEqual(actual_aln, expected_aln)
+-        
+-    def test_call_pynast_test1_alt_min_pct(self):
+-        """PyNastAligner: returns no result when min_pct too high
+-        """
+-        aligner = PyNastAligner({
+-                'template_filepath': self.pynast_test1_template_fp,
+-                'min_len':15,
+-                'min_pct':100.0})
+-        
+-        actual_aln = aligner(self.pynast_test1_input_fp)
+-        expected_aln = {}
+-
+-        self.assertEqual(actual_aln, expected_aln) 
++#    def test_call_pynast_alt_pairwise_method(self):
++#        """PyNastAligner: alternate pairwise alignment method produces correct alignment
++#        """
++#        aligner = PyNastAligner({
++#                'pairwise_alignment_method': 'muscle',
++#                'template_filepath': self.pynast_test1_template_fp,
++#                'min_len': 15,
++#                })
++#        actual_aln = aligner(self.pynast_test1_input_fp)
++#        expected_aln = self.pynast_test1_expected_aln
++#        self.assertEqual(actual_aln, expected_aln)
++        
++#    def test_call_pynast_test1_alt_min_len(self):
++#        """PyNastAligner: returns no result when min_len too high
++#        """
++#        aligner = PyNastAligner({
++#                'template_filepath': self.pynast_test1_template_fp,
++#                'min_len':1000})
++#        
++#        actual_aln = aligner(\
++#         self.pynast_test1_input_fp)
++#        expected_aln = {}
++#
++#        self.assertEqual(actual_aln, expected_aln)
++        
++#    def test_call_pynast_test1_alt_min_pct(self):
++#        """PyNastAligner: returns no result when min_pct too high
++#        """
++#        aligner = PyNastAligner({
++#                'template_filepath': self.pynast_test1_template_fp,
++#                'min_len':15,
++#                'min_pct':100.0})
++#        
++#        actual_aln = aligner(self.pynast_test1_input_fp)
++#        expected_aln = {}
++#
++#        self.assertEqual(actual_aln, expected_aln) 
+         
+     def tearDown(self):
+         """
+--- a/tests/test_assign_taxonomy.py
++++ b/tests/test_assign_taxonomy.py
+@@ -134,53 +134,53 @@ class UclustConsensusTaxonAssignerTests(
+             if exists(d):
+                 rmtree(d)
+     
+-    def test_uclust_assigner_write_to_file(self):
+-        """UclustConsensusTaxonAssigner returns without error, writing results
+-        """
+-        params = {'id_to_taxonomy_fp':self.id_to_tax1_fp,
+-                  'reference_sequences_fp':self.refseqs1_fp}
+-        
+-        t = UclustConsensusTaxonAssigner(params)
+-        result = t(seq_path=self.inseqs1_fp,
+-                   result_path=self.output_txt_fp,
+-                   uc_path=self.output_uc_fp,
+-                   log_path=self.output_log_fp)
+-        del t
+-        # result files exist after the UclustConsensusTaxonAssigner
+-        # no longer exists
+-        self.assertTrue(exists(self.output_txt_fp))
+-        self.assertTrue(exists(self.output_uc_fp))
+-        self.assertTrue(exists(self.output_log_fp))
+-        
+-        # check that result has the expected lines
+-        output_lines = list(open(self.output_txt_fp,'U'))
+-        self.assertTrue('q1\tA;F;G\t1.00\t1\n' in output_lines)
+-        self.assertTrue('q2\tA;H;I;J\t1.00\t1\n' in output_lines)
++#    def test_uclust_assigner_write_to_file(self):
++#        """UclustConsensusTaxonAssigner returns without error, writing results
++#        """
++#        params = {'id_to_taxonomy_fp':self.id_to_tax1_fp,
++#                  'reference_sequences_fp':self.refseqs1_fp}
++#        
++#        t = UclustConsensusTaxonAssigner(params)
++#        result = t(seq_path=self.inseqs1_fp,
++#                   result_path=self.output_txt_fp,
++#                   uc_path=self.output_uc_fp,
++#                   log_path=self.output_log_fp)
++#        del t
++#        # result files exist after the UclustConsensusTaxonAssigner
++#        # no longer exists
++#        self.assertTrue(exists(self.output_txt_fp))
++#        self.assertTrue(exists(self.output_uc_fp))
++#        self.assertTrue(exists(self.output_log_fp))
++#        
++#        # check that result has the expected lines
++#        output_lines = list(open(self.output_txt_fp,'U'))
++#        self.assertTrue('q1\tA;F;G\t1.00\t1\n' in output_lines)
++#        self.assertTrue('q2\tA;H;I;J\t1.00\t1\n' in output_lines)
+ 
+-    def test_uclust_assigner(self):
+-        """UclustConsensusTaxonAssigner returns without error, returning dict
+-        """
+-        params = {'id_to_taxonomy_fp':self.id_to_tax1_fp,
+-                  'reference_sequences_fp':self.refseqs1_fp}
+-        
+-        t = UclustConsensusTaxonAssigner(params)
+-        result = t(seq_path=self.inseqs1_fp,
+-                   result_path=None,
+-                   uc_path=self.output_uc_fp,
+-                   log_path=self.output_log_fp)
+-                   
+-        self.assertEqual(result['q1'],(['A','F','G'],1.0,1))
+-        self.assertEqual(result['q2'],(['A','H','I','J'],1.0,1))
+-
+-        # no result paths provided
+-        t = UclustConsensusTaxonAssigner(params)
+-        result = t(seq_path=self.inseqs1_fp,
+-                   result_path=None,
+-                   uc_path=None,
+-                   log_path=None)
+-                   
+-        self.assertEqual(result['q1'],(['A','F','G'],1.0,1))
+-        self.assertEqual(result['q2'],(['A','H','I','J'],1.0,1))
++#    def test_uclust_assigner(self):
++#        """UclustConsensusTaxonAssigner returns without error, returning dict
++#        """
++#        params = {'id_to_taxonomy_fp':self.id_to_tax1_fp,
++#                  'reference_sequences_fp':self.refseqs1_fp}
++#        
++#        t = UclustConsensusTaxonAssigner(params)
++#        result = t(seq_path=self.inseqs1_fp,
++#                   result_path=None,
++#                   uc_path=self.output_uc_fp,
++#                   log_path=self.output_log_fp)
++#                   
++#        self.assertEqual(result['q1'],(['A','F','G'],1.0,1))
++#        self.assertEqual(result['q2'],(['A','H','I','J'],1.0,1))
++#
++#        # no result paths provided
++#        t = UclustConsensusTaxonAssigner(params)
++#        result = t(seq_path=self.inseqs1_fp,
++#                   result_path=None,
++#                   uc_path=None,
++#                   log_path=None)
++#                   
++#        self.assertEqual(result['q1'],(['A','F','G'],1.0,1))
++#        self.assertEqual(result['q2'],(['A','H','I','J'],1.0,1))
+     
+     def test_get_consensus_assignment(self):
+         """_get_consensus_assignment fuctions as expected """
+--- a/tests/test_pick_otus.py
++++ b/tests/test_pick_otus.py
+@@ -2478,40 +2478,40 @@ class UclustOtuPickerTests(TestCase):
+         exp = {0:['s1','s4','s6','s2','s3','s5']}
+         self.assertEqual(obs,exp)
+         
+-    def test_abundance_sort(self):
+-        """UclustOtuPicker: abundance sort functions as expected
+-        """
+-        #enable abundance sorting with suppress sort = False (it gets
+-        # set to True internally, otherwise uclust's length sort would
+-        # override the abundance sorting)
+-        seqs = [('s1 comment1','ACCTTGTTACTTT'),  # three copies
+-                ('s2 comment2','ACCTTGTTACTTTC'), # one copy
+-                ('s3 comment3','ACCTTGTTACTTTCC'),# two copies
+-                ('s4 comment4','ACCTTGTTACTTT'),
+-                ('s5 comment5','ACCTTGTTACTTTCC'),
+-                ('s6 comment6','ACCTTGTTACTTT')]
+-        seqs_fp = self.seqs_to_temp_fasta(seqs)
+-        
+-        # abundance sorting changes order 
+-        app = UclustOtuPicker(params={'Similarity':0.80,
+-                                      'enable_rev_strand_matching':False,
+-                                      'suppress_sort':False,
+-                                      'presort_by_abundance':True,
+-                                      'save_uc_files':False})
+-        obs = app(seqs_fp)
+-        exp = {0:['s1','s4','s6','s3','s5','s2']}
+-        self.assertEqual(obs,exp)
+-        
+-        # abundance sorting changes order -- same results with suppress_sort =
+-        # True b/c (it gets set to True to when presorting by abundance)
+-        app = UclustOtuPicker(params={'Similarity':0.80,
+-                                      'enable_rev_strand_matching':False,
+-                                      'suppress_sort':True,
+-                                      'presort_by_abundance':True,
+-                                      'save_uc_files':False})
+-        obs = app(seqs_fp)
+-        exp = {0:['s1','s4','s6','s3','s5','s2']}
+-        self.assertEqual(obs,exp)
++#    def test_abundance_sort(self):
++#        """UclustOtuPicker: abundance sort functions as expected
++#        """
++#        #enable abundance sorting with suppress sort = False (it gets
++#        # set to True internally, otherwise uclust's length sort would
++#        # override the abundance sorting)
++#        seqs = [('s1 comment1','ACCTTGTTACTTT'),  # three copies
++#                ('s2 comment2','ACCTTGTTACTTTC'), # one copy
++#                ('s3 comment3','ACCTTGTTACTTTCC'),# two copies
++#                ('s4 comment4','ACCTTGTTACTTT'),
++#                ('s5 comment5','ACCTTGTTACTTTCC'),
++#                ('s6 comment6','ACCTTGTTACTTT')]
++#        seqs_fp = self.seqs_to_temp_fasta(seqs)
++#        
++#        # abundance sorting changes order 
++#        app = UclustOtuPicker(params={'Similarity':0.80,
++#                                      'enable_rev_strand_matching':False,
++#                                      'suppress_sort':False,
++#                                      'presort_by_abundance':True,
++#                                      'save_uc_files':False})
++#        obs = app(seqs_fp)
++#        exp = {0:['s1','s4','s6','s3','s5','s2']}
++#        self.assertEqual(obs,exp)
++#        
++#        # abundance sorting changes order -- same results with suppress_sort =
++#        # True b/c (it gets set to True to when presorting by abundance)
++#        app = UclustOtuPicker(params={'Similarity':0.80,
++#                                      'enable_rev_strand_matching':False,
++#                                      'suppress_sort':True,
++#                                      'presort_by_abundance':True,
++#                                      'save_uc_files':False})
++#        obs = app(seqs_fp)
++#        exp = {0:['s1','s4','s6','s3','s5','s2']}
++#        self.assertEqual(obs,exp)
+ 
+     def test_call_default_params(self):
+         """UclustOtuPicker.__call__ returns expected clusters default params"""
+@@ -2542,35 +2542,35 @@ class UclustOtuPickerTests(TestCase):
+         self.assertEqual(obs_otu_ids, exp_otu_ids)
+         self.assertEqual(obs_clusters, exp_clusters)
+         
+-    def test_call_default_params_suppress_sort(self):
+-        """UclustOtuPicker.__call__ returns expected clusters default params"""
+-
+-        # adapted from test_app.test_cd_hit.test_cdhit_clusters_from_seqs
+-        
+-        exp_otu_ids = range(10)
+-        exp_clusters = [['uclust_test_seqs_0'],
+-                        ['uclust_test_seqs_1'],
+-                        ['uclust_test_seqs_2'],
+-                        ['uclust_test_seqs_3'],
+-                        ['uclust_test_seqs_4'],
+-                        ['uclust_test_seqs_5'],
+-                        ['uclust_test_seqs_6'],
+-                        ['uclust_test_seqs_7'],
+-                        ['uclust_test_seqs_8'],
+-                        ['uclust_test_seqs_9']]
+-        
+-        app = UclustOtuPicker(params={'save_uc_files':False,
+-                                      'suppress_sort':True})
+-        obs = app(self.tmp_seq_filepath1)
+-        obs_otu_ids = obs.keys()
+-        obs_otu_ids.sort()
+-        obs_clusters = obs.values()
+-        obs_clusters.sort()
+-        # The relation between otu ids and clusters is abitrary, and 
+-        # is not stable due to use of dicts when parsing clusters -- therefore
+-        # just checks that we have the expected group of each
+-        self.assertEqual(obs_otu_ids, exp_otu_ids)
+-        self.assertEqual(obs_clusters, exp_clusters)
++#    def test_call_default_params_suppress_sort(self):
++#        """UclustOtuPicker.__call__ returns expected clusters default params"""
++#
++#        # adapted from test_app.test_cd_hit.test_cdhit_clusters_from_seqs
++#        
++#        exp_otu_ids = range(10)
++#        exp_clusters = [['uclust_test_seqs_0'],
++#                        ['uclust_test_seqs_1'],
++#                        ['uclust_test_seqs_2'],
++#                        ['uclust_test_seqs_3'],
++#                        ['uclust_test_seqs_4'],
++#                        ['uclust_test_seqs_5'],
++#                        ['uclust_test_seqs_6'],
++#                        ['uclust_test_seqs_7'],
++#                        ['uclust_test_seqs_8'],
++#                        ['uclust_test_seqs_9']]
++#        
++#        app = UclustOtuPicker(params={'save_uc_files':False,
++#                                      'suppress_sort':True})
++#        obs = app(self.tmp_seq_filepath1)
++#        obs_otu_ids = obs.keys()
++#        obs_otu_ids.sort()
++#        obs_clusters = obs.values()
++#        obs_clusters.sort()
++#        # The relation between otu ids and clusters is abitrary, and 
++#        # is not stable due to use of dicts when parsing clusters -- therefore
++#        # just checks that we have the expected group of each
++#        self.assertEqual(obs_otu_ids, exp_otu_ids)
++#        self.assertEqual(obs_clusters, exp_clusters)
+ 
+ 
+     def test_call_default_params_save_uc_file(self):
+@@ -2627,69 +2627,69 @@ class UclustOtuPickerTests(TestCase):
+         self.assertEqual(obs_otu_ids, exp_otu_ids)
+         self.assertEqual(obs_clusters, exp_clusters)
+         
+-    def test_call_alt_threshold(self):
+-        """UclustOtuPicker.__call__ returns expected clusters with alt threshold
+-        """
+-        # adapted from test_app.test_cd_hit.test_cdhit_clusters_from_seqs
+-        
+-        exp_otu_ids = range(9)
+-        exp_clusters = [['uclust_test_seqs_0'],
+-                        ['uclust_test_seqs_1'],
+-                        ['uclust_test_seqs_2'],
+-                        ['uclust_test_seqs_3'],
+-                        ['uclust_test_seqs_4'],
+-                        ['uclust_test_seqs_5'],
+-                        ['uclust_test_seqs_6','uclust_test_seqs_8'],
+-                        ['uclust_test_seqs_7'],
+-                        ['uclust_test_seqs_9']]
+-
+-        app = UclustOtuPicker(params={'Similarity':0.90,
+-                                      'suppress_sort':False,
+-                                      'presort_by_abundance':False,
+-                                      'save_uc_files':False})
+-        obs = app(self.tmp_seq_filepath1)
+-        obs_otu_ids = obs.keys()
+-        obs_otu_ids.sort()
+-        obs_clusters = obs.values()
+-        obs_clusters.sort()
+-        # The relation between otu ids and clusters is abitrary, and 
+-        # is not stable due to use of dicts when parsing clusters -- therefore
+-        # just checks that we have the expected group of each
+-        self.assertEqual(obs_otu_ids, exp_otu_ids)
+-        self.assertEqual(obs_clusters, exp_clusters)
+-        
+-        
+-    def test_call_otu_id_prefix(self):
+-        """UclustOtuPicker.__call__ returns expected clusters with alt threshold
+-        """
+-        # adapted from test_app.test_cd_hit.test_cdhit_clusters_from_seqs
+-        
+-        exp_otu_ids = ['my_otu_%d' % i for i in range(9)]
+-        exp_clusters = [['uclust_test_seqs_0'],
+-                        ['uclust_test_seqs_1'],
+-                        ['uclust_test_seqs_2'],
+-                        ['uclust_test_seqs_3'],
+-                        ['uclust_test_seqs_4'],
+-                        ['uclust_test_seqs_5'],
+-                        ['uclust_test_seqs_6','uclust_test_seqs_8'],
+-                        ['uclust_test_seqs_7'],
+-                        ['uclust_test_seqs_9']]
+-
+-        app = UclustOtuPicker(params={'Similarity':0.90,
+-                                      'suppress_sort':False,
+-                                      'presort_by_abundance':False,
+-                                      'new_cluster_identifier':'my_otu_',
+-                                      'save_uc_files':False})
+-        obs = app(self.tmp_seq_filepath1)
+-        obs_otu_ids = obs.keys()
+-        obs_otu_ids.sort()
+-        obs_clusters = obs.values()
+-        obs_clusters.sort()
+-        # The relation between otu ids and clusters is abitrary, and 
+-        # is not stable due to use of dicts when parsing clusters -- therefore
+-        # just checks that we have the expected group of each
+-        self.assertEqual(obs_otu_ids, exp_otu_ids)
+-        self.assertEqual(obs_clusters, exp_clusters)
++#    def test_call_alt_threshold(self):
++#        """UclustOtuPicker.__call__ returns expected clusters with alt threshold
++#        """
++#        # adapted from test_app.test_cd_hit.test_cdhit_clusters_from_seqs
++#        
++#        exp_otu_ids = range(9)
++#        exp_clusters = [['uclust_test_seqs_0'],
++#                        ['uclust_test_seqs_1'],
++#                        ['uclust_test_seqs_2'],
++#                        ['uclust_test_seqs_3'],
++#                        ['uclust_test_seqs_4'],
++#                        ['uclust_test_seqs_5'],
++#                        ['uclust_test_seqs_6','uclust_test_seqs_8'],
++#                        ['uclust_test_seqs_7'],
++#                        ['uclust_test_seqs_9']]
++#
++#        app = UclustOtuPicker(params={'Similarity':0.90,
++#                                      'suppress_sort':False,
++#                                      'presort_by_abundance':False,
++#                                      'save_uc_files':False})
++#        obs = app(self.tmp_seq_filepath1)
++#        obs_otu_ids = obs.keys()
++#        obs_otu_ids.sort()
++#        obs_clusters = obs.values()
++#        obs_clusters.sort()
++#        # The relation between otu ids and clusters is abitrary, and 
++#        # is not stable due to use of dicts when parsing clusters -- therefore
++#        # just checks that we have the expected group of each
++#        self.assertEqual(obs_otu_ids, exp_otu_ids)
++#        self.assertEqual(obs_clusters, exp_clusters)
++        
++        
++#    def test_call_otu_id_prefix(self):
++#        """UclustOtuPicker.__call__ returns expected clusters with alt threshold
++#        """
++#        # adapted from test_app.test_cd_hit.test_cdhit_clusters_from_seqs
++#        
++#        exp_otu_ids = ['my_otu_%d' % i for i in range(9)]
++#        exp_clusters = [['uclust_test_seqs_0'],
++#                        ['uclust_test_seqs_1'],
++#                        ['uclust_test_seqs_2'],
++#                        ['uclust_test_seqs_3'],
++#                        ['uclust_test_seqs_4'],
++#                        ['uclust_test_seqs_5'],
++#                        ['uclust_test_seqs_6','uclust_test_seqs_8'],
++#                        ['uclust_test_seqs_7'],
++#                        ['uclust_test_seqs_9']]
++#
++#        app = UclustOtuPicker(params={'Similarity':0.90,
++#                                      'suppress_sort':False,
++#                                      'presort_by_abundance':False,
++#                                      'new_cluster_identifier':'my_otu_',
++#                                      'save_uc_files':False})
++#        obs = app(self.tmp_seq_filepath1)
++#        obs_otu_ids = obs.keys()
++#        obs_otu_ids.sort()
++#        obs_clusters = obs.values()
++#        obs_clusters.sort()
++#        # The relation between otu ids and clusters is abitrary, and 
++#        # is not stable due to use of dicts when parsing clusters -- therefore
++#        # just checks that we have the expected group of each
++#        self.assertEqual(obs_otu_ids, exp_otu_ids)
++#        self.assertEqual(obs_clusters, exp_clusters)
+         
+     def test_call_suppress_sort(self):
+         """UclustOtuPicker.__call__ handles suppress sort
+@@ -2716,131 +2716,131 @@ class UclustOtuPickerTests(TestCase):
+         self.assertEqual(obs_otu_ids, exp_otu_ids)
+         self.assertEqual(obs_clusters, exp_clusters)
+         
+-    def test_call_rev_matching(self):
+-        """UclustOtuPicker.__call__ handles reverse strand matching
+-        """
+-        exp_otu_ids = range(2)
+-        exp_clusters = [['uclust_test_seqs_0'],['uclust_test_seqs_0_rc']]
+-        app = UclustOtuPicker(params={'Similarity':0.90,
+-                                      'enable_rev_strand_matching':False,
+-                                      'suppress_sort':False,
+-                                      'presort_by_abundance':False,
+-                                      'save_uc_files':False})
+-        obs = app(self.tmp_seq_filepath3)
+-        obs_otu_ids = obs.keys()
+-        obs_otu_ids.sort()
+-        obs_clusters = obs.values()
+-        obs_clusters.sort()
+-        # The relation between otu ids and clusters is abitrary, and 
+-        # is not stable due to use of dicts when parsing clusters -- therefore
+-        # just checks that we have the expected group of each
+-        self.assertEqual(obs_otu_ids, exp_otu_ids)
+-        self.assertEqual(obs_clusters, exp_clusters)
+-        
+-        exp = {0: ['uclust_test_seqs_0','uclust_test_seqs_0_rc']}
+-        app = UclustOtuPicker(params={'Similarity':0.90,
+-                                      'enable_rev_strand_matching':True,
+-                                      'suppress_sort':False,
+-                                      'presort_by_abundance':False,
+-                                      'save_uc_files':False})
+-        obs = app(self.tmp_seq_filepath3)
+-        self.assertEqual(obs, exp)
+-        
+-    def test_call_output_to_file(self):
+-        """UclustHitOtuPicker.__call__ output to file functions as expected
+-        """
+-        
+-        tmp_result_filepath = get_tmp_filename(\
+-         prefix='UclustOtuPickerTest.test_call_output_to_file_',\
+-         suffix='.txt')
+-        
+-        app = UclustOtuPicker(params={'Similarity':0.90,
+-                                      'suppress_sort':False,
+-                                      'presort_by_abundance':False,
+-                                      'save_uc_files':False})
+-        obs = app(self.tmp_seq_filepath1,result_path=tmp_result_filepath)
+-        
+-        result_file = open(tmp_result_filepath)
+-        result_file_str = result_file.read()
+-        result_file.close()
+-        # remove the result file before running the test, so in 
+-        # case it fails the temp file is still cleaned up
+-        remove(tmp_result_filepath)
+-
+-        exp_otu_ids = map(str,range(9))
+-        exp_clusters = [['uclust_test_seqs_0'],
+-                        ['uclust_test_seqs_1'],
+-                        ['uclust_test_seqs_2'],
+-                        ['uclust_test_seqs_3'],
+-                        ['uclust_test_seqs_4'],
+-                        ['uclust_test_seqs_5'],
+-                        ['uclust_test_seqs_6','uclust_test_seqs_8'],
+-                        ['uclust_test_seqs_7'],
+-                        ['uclust_test_seqs_9']]
+-        obs_otu_ids = []
+-        obs_clusters = []
+-        for line in result_file_str.split('\n'):
+-            if line:
+-                fields = line.split('\t')
+-                obs_otu_ids.append(fields[0])
+-                obs_clusters.append(fields[1:])
+-        obs_otu_ids.sort()
+-        obs_clusters.sort()
+-        # The relation between otu ids and clusters is abitrary, and 
+-        # is not stable due to use of dicts when parsing clusters -- therefore
+-        # just checks that we have the expected group of each
+-        self.assertEqual(obs_otu_ids, exp_otu_ids)
+-        self.assertEqual(obs_clusters, exp_clusters)
+-        # confirm that nothing is returned when result_path is specified
+-        self.assertEqual(obs,None)
+-        
+-    def test_call_log_file(self):
+-        """UclustOtuPicker.__call__ writes log when expected
+-        """
+-        
+-        tmp_log_filepath = get_tmp_filename(\
+-         prefix='UclustOtuPickerTest.test_call_output_to_file_l_',\
+-         suffix='.txt')
+-        tmp_result_filepath = get_tmp_filename(\
+-         prefix='UclustOtuPickerTest.test_call_output_to_file_r_',\
+-         suffix='.txt')
+-        
+-        app = UclustOtuPicker(params={'Similarity':0.99,
+-                                      'save_uc_files':False})
+-        obs = app(self.tmp_seq_filepath1,\
+-         result_path=tmp_result_filepath,log_path=tmp_log_filepath)
+-        
+-        log_file = open(tmp_log_filepath)
+-        log_file_str = log_file.read()
+-        log_file.close()
+-        # remove the temp files before running the test, so in 
+-        # case it fails the temp file is still cleaned up
+-        remove(tmp_log_filepath)
+-        remove(tmp_result_filepath)
+-        
+-        log_file_99_exp = ["UclustOtuPicker parameters:",
+-         "Similarity:0.99","Application:uclust",
+-         "enable_rev_strand_matching:False",
+-         "suppress_sort:True",
+-         "optimal:False",
+-         'max_accepts:20',
+-         'max_rejects:500',
+-         'stepwords:20',
+-         'word_length:12',
+-         "exact:False",
+-         "Num OTUs:10",
+-         "new_cluster_identifier:None",
+-         "presort_by_abundance:True",
+-         "stable_sort:True",
+-         "output_dir:.",
+-         "save_uc_files:False",
+-         "prefilter_identical_sequences:True",
+-         "Result path: %s" % tmp_result_filepath]
+-        # compare data in log file to fake expected log file
+-        # NOTE: Since app.params is a dict, the order of lines is not
+-        # guaranteed, so testing is performed to make sure that 
+-        # the equal unordered lists of lines is present in actual and expected
+-        self.assertEqualItems(log_file_str.split('\n'), log_file_99_exp)
++#    def test_call_rev_matching(self):
++#        """UclustOtuPicker.__call__ handles reverse strand matching
++#        """
++#        exp_otu_ids = range(2)
++#        exp_clusters = [['uclust_test_seqs_0'],['uclust_test_seqs_0_rc']]
++#        app = UclustOtuPicker(params={'Similarity':0.90,
++#                                      'enable_rev_strand_matching':False,
++#                                      'suppress_sort':False,
++#                                      'presort_by_abundance':False,
++#                                      'save_uc_files':False})
++#        obs = app(self.tmp_seq_filepath3)
++#        obs_otu_ids = obs.keys()
++#        obs_otu_ids.sort()
++#        obs_clusters = obs.values()
++#        obs_clusters.sort()
++#        # The relation between otu ids and clusters is abitrary, and 
++#        # is not stable due to use of dicts when parsing clusters -- therefore
++#        # just checks that we have the expected group of each
++#        self.assertEqual(obs_otu_ids, exp_otu_ids)
++#        self.assertEqual(obs_clusters, exp_clusters)
++#        
++#        exp = {0: ['uclust_test_seqs_0','uclust_test_seqs_0_rc']}
++#        app = UclustOtuPicker(params={'Similarity':0.90,
++#                                      'enable_rev_strand_matching':True,
++#                                      'suppress_sort':False,
++#                                      'presort_by_abundance':False,
++#                                      'save_uc_files':False})
++#        obs = app(self.tmp_seq_filepath3)
++#        self.assertEqual(obs, exp)
++        
++#    def test_call_output_to_file(self):
++#        """UclustHitOtuPicker.__call__ output to file functions as expected
++#        """
++#        
++#        tmp_result_filepath = get_tmp_filename(\
++#         prefix='UclustOtuPickerTest.test_call_output_to_file_',\
++#         suffix='.txt')
++#        
++#        app = UclustOtuPicker(params={'Similarity':0.90,
++#                                      'suppress_sort':False,
++#                                      'presort_by_abundance':False,
++#                                      'save_uc_files':False})
++#        obs = app(self.tmp_seq_filepath1,result_path=tmp_result_filepath)
++#        
++#        result_file = open(tmp_result_filepath)
++#        result_file_str = result_file.read()
++#        result_file.close()
++#        # remove the result file before running the test, so in 
++#        # case it fails the temp file is still cleaned up
++#        remove(tmp_result_filepath)
++#
++#        exp_otu_ids = map(str,range(9))
++#        exp_clusters = [['uclust_test_seqs_0'],
++#                        ['uclust_test_seqs_1'],
++#                        ['uclust_test_seqs_2'],
++#                        ['uclust_test_seqs_3'],
++#                        ['uclust_test_seqs_4'],
++#                        ['uclust_test_seqs_5'],
++#                        ['uclust_test_seqs_6','uclust_test_seqs_8'],
++#                        ['uclust_test_seqs_7'],
++#                        ['uclust_test_seqs_9']]
++#        obs_otu_ids = []
++#        obs_clusters = []
++#        for line in result_file_str.split('\n'):
++#            if line:
++#                fields = line.split('\t')
++#                obs_otu_ids.append(fields[0])
++#                obs_clusters.append(fields[1:])
++#        obs_otu_ids.sort()
++#        obs_clusters.sort()
++#        # The relation between otu ids and clusters is abitrary, and 
++#        # is not stable due to use of dicts when parsing clusters -- therefore
++#        # just checks that we have the expected group of each
++#        self.assertEqual(obs_otu_ids, exp_otu_ids)
++#        self.assertEqual(obs_clusters, exp_clusters)
++#        # confirm that nothing is returned when result_path is specified
++#        self.assertEqual(obs,None)
++        
++#    def test_call_log_file(self):
++#        """UclustOtuPicker.__call__ writes log when expected
++#        """
++#        
++#        tmp_log_filepath = get_tmp_filename(\
++#         prefix='UclustOtuPickerTest.test_call_output_to_file_l_',\
++#         suffix='.txt')
++#        tmp_result_filepath = get_tmp_filename(\
++#         prefix='UclustOtuPickerTest.test_call_output_to_file_r_',\
++#         suffix='.txt')
++#        
++#        app = UclustOtuPicker(params={'Similarity':0.99,
++#                                      'save_uc_files':False})
++#        obs = app(self.tmp_seq_filepath1,\
++#         result_path=tmp_result_filepath,log_path=tmp_log_filepath)
++#        
++#        log_file = open(tmp_log_filepath)
++#        log_file_str = log_file.read()
++#        log_file.close()
++#        # remove the temp files before running the test, so in 
++#        # case it fails the temp file is still cleaned up
++#        remove(tmp_log_filepath)
++#        remove(tmp_result_filepath)
++#        
++#        log_file_99_exp = ["UclustOtuPicker parameters:",
++#         "Similarity:0.99","Application:uclust",
++#         "enable_rev_strand_matching:False",
++#         "suppress_sort:True",
++#         "optimal:False",
++#         'max_accepts:20',
++#         'max_rejects:500',
++#         'stepwords:20',
++#         'word_length:12',
++#         "exact:False",
++#         "Num OTUs:10",
++#         "new_cluster_identifier:None",
++#         "presort_by_abundance:True",
++#         "stable_sort:True",
++#         "output_dir:.",
++#         "save_uc_files:False",
++#         "prefilter_identical_sequences:True",
++#         "Result path: %s" % tmp_result_filepath]
++#        # compare data in log file to fake expected log file
++#        # NOTE: Since app.params is a dict, the order of lines is not
++#        # guaranteed, so testing is performed to make sure that 
++#        # the equal unordered lists of lines is present in actual and expected
++#        self.assertEqualItems(log_file_str.split('\n'), log_file_99_exp)
+         
+         
+     def test_map_filtered_clusters_to_full_clusters(self):

Modified: trunk/packages/qiime/trunk/debian/patches/series
===================================================================
--- trunk/packages/qiime/trunk/debian/patches/series	2013-12-26 07:53:10 UTC (rev 15618)
+++ trunk/packages/qiime/trunk/debian/patches/series	2013-12-26 23:29:30 UTC (rev 15619)
@@ -3,3 +3,4 @@
 make_qiime_accept_new_rdp_classifier
 fix_path_for_support_files
 prevent_google_addsense.patch
+exclude_tests_that_need_to_fail.patch




More information about the debian-med-commit mailing list