Пример #1
0
    def test_partial_threshold_search(self):
        threshold = 0.1
        N = len(fps)
        result = search.SearchResults(N, fps.arena_ids)
        expected = [[] for i in range(N)]

        for i in range(0, N, 13):
            for j in range(i, N, 8):
                search.partial_threshold_tanimoto_search_symmetric(
                    result, fps, threshold, i, i + 13, j, j + 8)
                slow_threshold_search(expected, fps, threshold, i, i + 13, j,
                                      j + 8)

        _compare_search_results(self, result, expected)

        counts_before = map(len, result)
        search.fill_lower_triangle(result)
        counts_after = map(len, result)
        self.assertNotEqual(counts_before, counts_after)
        self.assertSequenceEqual(
            counts_after, search.count_tanimoto_hits_symmetric(fps, threshold))

        normal = search.threshold_tanimoto_search_symmetric(fps, threshold)
        _compare_search_results(self, result,
                                list(normal.iter_indices_and_scores()))
Пример #2
0
    def test_partial_search_in_rows(self):
        threshold = 0.2
        N = len(fps)
        result = search.SearchResults(N, fps.arena_ids)
        search.partial_threshold_tanimoto_search_symmetric(result, fps, threshold,
                                                           1, 9, 0, N)

        expected = [[] for i in range(N)]
        slow_threshold_search(expected, fps, threshold, 1, 9, 0, N)
        _compare_search_results(self, result, expected)
Пример #3
0
    def test_partial_search_in_rows(self):
        threshold = 0.2
        N = len(fps)
        result = search.SearchResults(N, fps.arena_ids)
        search.partial_threshold_tanimoto_search_symmetric(
            result, fps, threshold, 1, 9, 0, N)

        expected = [[] for i in range(N)]
        slow_threshold_search(expected, fps, threshold, 1, 9, 0, N)
        _compare_search_results(self, result, expected)
Пример #4
0
    def test_partial_threshold_search(self):
        threshold = 0.1
        N = len(fps)
        result = search.SearchResults(N, fps.arena_ids)
        expected = [[] for i in range(N)]

        for i in range(0, N, 13):
            for j in range(i, N, 8):
                search.partial_threshold_tanimoto_search_symmetric(result, fps, threshold,
                                                                   i, i+13, j, j+8)
                slow_threshold_search(expected, fps, threshold, i, i+13, j, j+8)

        _compare_search_results(self, result, expected)

        counts_before = map(len, result)
        search.fill_lower_triangle(result)
        counts_after = map(len, result)
        self.assertNotEqual(counts_before, counts_after)
        self.assertSequenceEqual(counts_after,
                                 search.count_tanimoto_hits_symmetric(fps, threshold))

        normal = search.threshold_tanimoto_search_symmetric(fps, threshold)
        _compare_search_results(self, result, list(normal.iter_indices_and_scores()))