-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
63 lines (51 loc) · 1.69 KB
/
Copy pathmain.cpp
File metadata and controls
63 lines (51 loc) · 1.69 KB
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
#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <tuple>
#include <fstream>
#include "defines.h"
#include "declarations.h"
using std::cout; using std::endl;
using std::string; using std::unordered_map;
using std::unordered_multimap;
using std::vector; using std::to_string;
using std::set; using std::map;
using std::pair; using std::unordered_set;
using std::make_tuple; using std::tuple;
using std::get; using std::max;
using std::min; using std::make_pair;
using std::ofstream;
typedef unsigned long long ull;
void dispatch(unordered_map<string, string> &ref_map,
unordered_map<string, unordered_map<string, string> > &long_map,
unordered_map<string, unordered_multimap<ull, ull> > &ref_hashmap,
vector<string> const &id_vec)
{
vector<string> answers;
for (auto const & id: id_vec) {
vector<string> concats = concat_longs(ref_map[id], long_map[id], ref_hashmap[id], id, ref_map[id].length());
find_answers(ref_map[id], concats, id, answers);
}
ofstream ofs;
ofs.open("../logs/answers.txt");
for (const auto& x: answers) {
ofs << x << endl;
}
ofs.close();
}
int main()
{
unordered_map<string, string> ref_map;
unordered_map<string, unordered_map<string, string> > long_map;
unordered_map<string, unordered_multimap<ull, ull> > ref_hashmap;
vector<string> id_vec;
read_fasta(ref_map, long_map, id_vec);
make_hashmap(ref_map, ref_hashmap, SEED_LEN_A);
dispatch(ref_map, long_map, ref_hashmap, id_vec);
cout << "Done" << endl;
return 0;
}