Пример #1
0
    def test_clusters_from_uc_file(self):
        """ clusters_from_uc_file functions as expected """

        expected_clusters = {'s2':['s2','s3']}
        expected_failures = ['s1']
        expected_new_seeds = ['s2']
        self.assertEqual(clusters_from_uc_file(self.uc_lines1),
         (expected_clusters,expected_failures,expected_new_seeds))
Пример #2
0
    def test_clusters_from_uc_file(self):
        """ clusters_from_uc_file functions as expected """

        expected_clusters = {'s2':['s2','s3']}
        expected_failures = ['s1']
        expected_new_seeds = ['s2']
        self.assertEqual(clusters_from_uc_file(self.uc_lines1),
         (expected_clusters,expected_failures,expected_new_seeds))
Пример #3
0
    def test_clusters_from_uc_file_multiple_hits(self):
        """ clusters_from_uc_file handles error_on_multiple_hits correctly
        """
        # when a query hits multiple hits and error_on_multiple_hits=True
        # an error should be raised
        self.assertRaises(UclustParseError,
                          clusters_from_uc_file,
                          self.uc_lines_w_multiple_hits_per_query,
                          error_on_multiple_hits=True)

        # when a query hits multiple hits and error_on_multiple_hits=False
        # the query should show up in multiple clusters
        actual = clusters_from_uc_file(self.uc_lines_w_multiple_hits_per_query,
                                       error_on_multiple_hits=False)
        expected_clusters = {'s2': ['s2', 's3'], 's4': ['s4', 's3']}
        expected_failures = ['s1']
        expected_new_seeds = ['s2', 's4']
        self.assertEqual(
            actual, (expected_clusters, expected_failures, expected_new_seeds))
Пример #4
0
 def test_clusters_from_uc_file_multiple_hits(self):
     """ clusters_from_uc_file handles error_on_multiple_hits correctly
     """
     # when a query hits multiple hits and error_on_multiple_hits=True
     # an error should be raised
     self.assertRaises(UclustParseError,
                       clusters_from_uc_file,
                       self.uc_lines_w_multiple_hits_per_query,
                       error_on_multiple_hits=True)
     
     # when a query hits multiple hits and error_on_multiple_hits=False
     # the query should show up in multiple clusters
     actual = clusters_from_uc_file(self.uc_lines_w_multiple_hits_per_query,
                                    error_on_multiple_hits=False)
     expected_clusters = {'s2':['s2','s3'],
                          's4':['s4','s3']}
     expected_failures = ['s1']
     expected_new_seeds = ['s2','s4']
     self.assertEqual(actual,
      (expected_clusters,expected_failures,expected_new_seeds))