forked from BGI-shenzhen/BamDeal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBamDeal.cpp
58 lines (50 loc) · 1.63 KB
/
BamDeal.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
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <stdio.h>
#include <string.h>
#include <zlib.h>
#include "src/convert/covert.h"
#include "src/modify/modify.h"
#include "src/statistics/statistics.h"
#include "src/visualize/visualize.h"
using namespace std;
int convert_main(int argc, char *argv[]) ;
int modify_main(int argc, char *argv[]);
int statistics_main(int argc, char *argv[]);
int visualize_main(int argc, char *argv[]);
static int AllTools_usage ()
{
cerr <<"Program: BamDeal\nVersion: 0.22\thewm2008@gmail.com\t"<<__DATE__<<endl;
cerr<<""
"\n"
"\tUsage:\n\n"
"\t\tconvert convert tools\n"
"\t\tmodify modify tools\n"
"\t\tstatistics statistics analysis tools\n"
"\t\tvisualize visualize tools for bam\n"
"\n"
"\t\tHelp Show help in detail\n"
"\n";
return 1;
}
int main(int argc, char *argv[])
{
if (argc < 2) { return AllTools_usage(); }
else if (strcmp(argv[1], "convert") == 0) { return convert_main(argc-1, argv+1) ; }
else if (strcmp(argv[1], "statistics") == 0) { return statistics_main(argc-1, argv+1) ; }
else if (strcmp(argv[1], "visualize") == 0) { return visualize_main(argc-1, argv+1) ; }
else if (strcmp(argv[1], "modify") == 0) { return modify_main(argc-1, argv+1) ; }
else if (strcmp(argv[1], "Help") == 0 || strcmp(argv[1], "help") == 0 || strcmp(argv[1], "?")== 0 || ( argv[1][0] == '-' &&( argv[1][1] =='h' || argv[1][1] =='H' || argv[1][1] =='?' ) ) || strcmp(argv[1], "less") == 0 )
{
return AllTools_usage();
}
else
{
cerr<<"BamDeal [main] unrecognized command "<<argv[1]<<endl;
return 1;
}
return 0;
}