-
Notifications
You must be signed in to change notification settings - Fork 2
/
msumsoptions.h
87 lines (71 loc) · 1.81 KB
/
msumsoptions.h
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
#ifndef MSUMSOPTIONS_H
#define MSUMSOPTIONS_H
#include <string>
#include "sputil.h"
#include "options.h"
class MSUMSOptions
{
public:
string inputfilename;
string statfilename;
string maskfilename;
bool printPerLocus;
typedef OpList::Collector OLIter;
OpList popList, statList, groupStatList;
private:
bool printHelp;
bool listStats;
OLIter keepS, dropS, keepP, dropP, groupSt;
OptionParser p;
UnaryOption<string> o_ifn;
UnaryOption<string> o_sfn;
UnaryOption<string> o_mfn;
SwitchOption o_ppl;
SwitchOption o_hlp;
SwitchOption o_list;
NaryOption<string, OLIter> o_ds;
NaryOption<string, OLIter> o_ks;
NaryOption<string, OLIter> o_dp;
NaryOption<string, OLIter> o_kp;
NaryOption<string, OLIter> o_ms;
public:
MSUMSOptions()
: inputfilename("spinput.txt"), statfilename("ABCstat.txt"),
maskfilename(""),
printPerLocus(false), printHelp(false), listStats(false),
keepS(statList, "+"), dropS(statList, "-"),
keepP(popList, "+"), dropP(popList, "-"),
groupSt(groupStatList),
o_ifn(p, 'i', "init", inputfilename), o_sfn(p, 'o', "output", statfilename),
o_mfn(p, 'k', "mask", maskfilename),
o_ppl(p, 'l', "print_per_locus", printPerLocus),
o_hlp(p, 'h', "help", printHelp),
o_list(p, 'a', "list_stats", listStats),
o_ds(p, 's', "dropStats", dropS), o_ks(p, 'S', "keepStats", keepS),
o_dp(p, 'p', "dropPops", dropP), o_kp(p, 'P', "keepPops", keepP),
o_ms(p, 'm', "multiStats", groupSt)
{}
void do_print_help();
void do_list_stats();
void process(int argc, char * argv[])
{
try {
p.parse(argv+1, argc-1);
} catch (ArgException & e)
{
error(string("Error in main: unknown command line argument: ") +
e.what());
}
if (printHelp)
{
do_print_help();
exit(0);
}
if (listStats)
{
do_list_stats();
exit(0);
}
}
};
#endif // MSUMSOPTIONS_H