/
main.cpp
38 lines (29 loc) · 839 Bytes
/
main.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
#include <map>
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include "fasta_reader.hpp"
#include "sam_reader.hpp"
#include "resistome.hpp"
#include "args.hpp"
using namespace std;
int main(const int argc, const char *argv[]) {
if(argc != 17) {
usage();
exit(EXIT_FAILURE);
}
struct cmd_args args;
args = parse_command_line(argc, argv);
fasta_reader fr(args.ref_fp);
map<string, record> records = fr.read();
sam_reader sr(args.sam_fp);
vector<struct alignment> alignments = sr.read();
annotation_reader ar(args.annot_fp);
map<string, annotation_fields> annotations = ar.read();
resistome res;
res.process_gene_level(records, alignments);
res.process_resistome(records, annotations, args.threshold);
res.write_resistome(args, utility::samplename(args.sam_fp), records);
return 0;
}