-
Notifications
You must be signed in to change notification settings - Fork 4
/
dicey.cpp
96 lines (88 loc) · 3.1 KB
/
dicey.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#define _SECURE_SCL 0
#define _SCL_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#define BOOST_DISABLE_ASSERTS
#ifdef PROFILE
#include "gperftools/profiler.h"
#endif
#include "bed.h"
#include "version.h"
#include "index.h"
#include "blacklist.h"
#include "chop.h"
#include "hunter.h"
#include "silica.h"
#include "mapbam.h"
#include "padlock.h"
using namespace dicey;
inline void
displayUsage() {
std::cout << "Usage: dicey <command> <arguments>" << std::endl;
std::cout << std::endl;
std::cout << "Commands:" << std::endl;
std::cout << std::endl;
std::cout << " index index FASTA reference file" << std::endl;
std::cout << " hunt search DNA sequences" << std::endl;
std::cout << " search in-silico PCR" << std::endl;
std::cout << " padlock padlock probe design" << std::endl;
std::cout << std::endl;
std::cout << std::endl;
std::cout << "Mappability:" << std::endl;
std::cout << std::endl;
std::cout << " chop chop reference into paired-end / single-end reads" << std::endl;
std::cout << " mappability2 parse BAM from mapped chopped reads (requires chop + map before)" << std::endl;
std::cout << " blacklist blacklist certain regions in mappability map" << std::endl;
std::cout << std::endl;
std::cout << std::endl;
}
int main(int argc, char **argv) {
if (argc < 2) {
printTitle("Dicey");
displayUsage();
return 0;
}
if ((std::string(argv[1]) == "version") || (std::string(argv[1]) == "--version") || (std::string(argv[1]) == "--version-only") || (std::string(argv[1]) == "-v")) {
std::cout << "Dicey version: v" << diceyVersionNumber << std::endl;
std::cout << " using Boost: v" << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << std::endl;
std::cout << " using HTSlib: v" << hts_version() << std::endl;
return 0;
}
else if ((std::string(argv[1]) == "help") || (std::string(argv[1]) == "--help") || (std::string(argv[1]) == "-h") || (std::string(argv[1]) == "-?")) {
printTitle("Dicey");
displayUsage();
return 0;
}
else if ((std::string(argv[1]) == "warranty") || (std::string(argv[1]) == "--warranty") || (std::string(argv[1]) == "-w")) {
displayWarranty();
return 0;
}
else if ((std::string(argv[1]) == "license") || (std::string(argv[1]) == "--license") || (std::string(argv[1]) == "-l")) {
bsd();
return 0;
}
else if ((std::string(argv[1]) == "index")) {
return index(argc-1,argv+1);
}
else if ((std::string(argv[1]) == "hunt")) {
return hunter(argc-1,argv+1);
}
else if ((std::string(argv[1]) == "padlock")) {
return padlock(argc-1,argv+1);
}
else if ((std::string(argv[1]) == "search")) {
return silica(argc-1,argv+1);
}
else if ((std::string(argv[1]) == "mappability2")) {
return mapbam(argc-1,argv+1);
}
else if ((std::string(argv[1]) == "chop")) {
return chop(argc-1,argv+1);
}
else if ((std::string(argv[1]) == "blacklist")) {
return blacklist(argc-1,argv+1);
} else {
std::cerr << "Unrecognized command " << std::string(argv[1]) << std::endl;
return 1;
}
}