MCPcopy Create free account
hub / github.com/BirolLab/abyss / generateSpacedSeedsPatterns

Function generateSpacedSeedsPatterns

RResolver/BloomFilters.cpp:19–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17btllib::SeedBloomFilter *g_spacedSeedsBloom = nullptr;
18
19static std::vector<std::string>
20generateSpacedSeedsPatterns(const int count, const int size, const int misses)
21{
22 assert(count < size);
23 assert(misses < count);
24 assert(misses > 0);
25
26 std::vector<std::string> seeds;
27 auto randomEngine = std::mt19937();
28 std::vector<int> seedsPermutation;
29
30 for (int i = 0; i < count; i++) {
31 seeds.push_back(std::string(size, '1'));
32 seedsPermutation.push_back(i);
33 }
34
35 for (int i = 0; i < (size + 1) / 2; i++) {
36 std::shuffle(seedsPermutation.begin(), seedsPermutation.end(), randomEngine);
37 for (int j = 0; j < count; j++) {
38 char c = j < misses ? '0' : '1';
39 seeds[seedsPermutation[j]][i] = c;
40 }
41 if (i < size / 2) {
42 for (int j = 0; j < count; j++) {
43 seeds[count - j - 1][size - i - 1] = seeds[j][i];
44 }
45 }
46 }
47
48 return seeds;
49}
50
51void
52QCSpacedSeedsPatterns(const std::vector<std::string>& patterns)

Callers 1

buildFiltersFunction · 0.85

Calls 3

push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected