-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgencore.c
42 lines (34 loc) · 1019 Bytes
/
gencore.c
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
#include "args.h"
#include "init.h"
#include "utils.h"
#include "rfasta.h"
#include "rfastq.h"
#include "rload.h"
int main(int argc, char **argv) {
// parse and initialize arguments
struct gargs *genome_arguments;
struct pargs program_arguments;
parse(argc, argv, &genome_arguments, &program_arguments);
// initialize coefficient arrays
LCP_INIT();
// process files program
switch (program_arguments.mode) {
case FA:
read_fastas(genome_arguments, &program_arguments);
break;
case FQ:
read_fastqs(genome_arguments, &program_arguments);
break;
case LOAD:
read_lcpts(genome_arguments, &program_arguments);
break;
default:
log1(ERROR, "Invalid program mode provided. It should not happen.");
exit(1);
}
// calculate distances and store them in files
calcDistances(genome_arguments, &program_arguments);
// cleanup
free_args(genome_arguments, &program_arguments);
return 0;
}