-
Notifications
You must be signed in to change notification settings - Fork 6
/
bench_blight.cpp
87 lines (76 loc) · 2.58 KB
/
bench_blight.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include "blight.h"
using namespace std;
using namespace chrono;
int main(int argc, char** argv) {
char ch;
string input, inputfof, query;
uint k(31);
uint m1(10);
uint m2(0);
uint m3(5);
uint c(1);
uint bit(0);
bool full(false), dump(false), hash(false);
while ((ch = getopt(argc, argv, "hdag:q:k:m:n:s:t:b:e:f:")) != -1) {
switch (ch) {
case 'h': hash = true; break;
case 'a': full = true; break;
case 'd': dump = true; break;
case 'q': query = optarg; break;
case 'g': input = optarg; break;
case 'f': inputfof = optarg; break;
case 'k': k = stoi(optarg); break;
case 'm': m1 = stoi(optarg); break;
case 'n': m2 = stoi(optarg); break;
case 's': m3 = stoi(optarg); break;
case 't': c = stoi(optarg); break;
case 'b': bit = stoi(optarg); break;
}
}
if (input == "" and query != "") {
input = query;
}
if ((input == "" and inputfof == "") or k == 0) {
cout << "Core arguments:" << endl
<< " -g graph file" << endl
<< " -q query file" << endl
<< " -k k value used for graph (31) " << endl
<< "By default only presence benchmark is performed \nUse -h for hash benchmark or -a for a complete test and verification" << endl
<< "Performances arguments:" << endl
<< " -m minimizer size (10)" << endl
//~ << " -n to create 4^n mphf (m). More mean slower construction but better index, must be <=m" << endl
<< " -s to use 4^s files (4). More reduce memory usage and use more files, must be <=n" << endl
<< " -t core used (1)" << endl
<< " -b bit saved to encode positions (0). Will reduce the memory usage of b bit per kmer but query have to check 2^b kmers" << endl;
return 0;
}
{
cout << "I use -k " + to_string(k) + " -m " + to_string(m1) + " -n " + to_string(m2) + " -s " + to_string(m3) + " -t " + to_string(c) + " -b "
+ to_string(bit)
<< endl;
kmer_Set_Light ksl(k, c, m1, m3, bit);
if (input != "") {
cout << "Build index from file " << input << " in directory wdir (if it does not exists please create it)" << endl;
ksl.construct_index(input, "wdir");
}
if (not query.empty()) {
cout << "NEW TESTS" << endl;
if (hash) {
ksl.file_query_hases(query, false);
} else {
ksl.file_query_all_test(query, full);
}
}
if (dump) {
cout << "DUMP" << endl;
ksl.dump_and_destroy("index.txt.gz");
if (not query.empty()) {
kmer_Set_Light ksl2("index.txt.gz");
for (uint i(0); i < 1; ++i)
ksl2.file_query_all_test(query, full);
}
}
cout << "I am glad you are here with me. Here at the end of all things." << endl;
}
return 0;
}