forked from voutcn/megahit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
asm_core.cpp
76 lines (68 loc) · 2.38 KB
/
asm_core.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
/*
* MEGAHIT
* Copyright (C) 2014 - 2015 The University of Hong Kong & L3 Bioinformatics Limited
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* contact: Dinghua Li <[email protected]> */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "utils.h"
#include "definitions.h"
int main_assemble(int argc, char **argv);
int main_local(int argc, char **argv);
int main_iterate(int argc, char **argv);
int main_build_lib(int argc, char **argv);
void show_help(const char *program_name) {
fprintf(stderr, "Usage: %s <sub_program> [sub options]\n"
" sub-programs:\n"
" assemble assemble from SdBG\n"
" local local asssembly\n"
" iterate extract iterative edges\n"
" buildlib build read library\n"
" dumpversion dump version\n"
" kmax the largest k value supported\n",
program_name);
}
int main(int argc, char **argv) {
if (argc < 2) {
show_help(argv[0]);
exit(1);
}
if (strcmp(argv[1], "assemble") == 0) {
return main_assemble(argc - 1, argv + 1);
}
else if (strcmp(argv[1], "local") == 0) {
return main_local(argc - 1 , argv + 1);
}
else if (strcmp(argv[1], "iterate") == 0) {
return main_iterate(argc - 1, argv + 1);
}
else if (strcmp(argv[1], "buildlib") == 0) {
return main_build_lib(argc - 1, argv + 1);
}
else if (strcmp(argv[1], "dumpversion") == 0) {
printf("%s\n", PACKAGE_VERSION);
return 0;
}
else if (strcmp(argv[1], "kmax") == 0) {
printf("%d\n", kMaxK);
}
else {
show_help(argv[0]);
exit(1);
}
return 0;
}