@@ -18,37 +18,31 @@ int main(int argc, const char * argv[])
18
18
ezOptionParser opt;
19
19
20
20
opt.overview =
21
- " SNPsea: an efficient statistical assessment for enrichment\n "
22
- " of continuous or binary gene annotations within disease loci.\n "
23
- " =============================================================" ;
24
- opt.syntax = " snpsea [OPTIONS]" ;
25
- opt.example =
26
- " Steps:\n "
27
- " 1. Condition each column in --gene-matrix on the columns listed\n "
28
- " in the --condition file.\n "
21
+ " SNPsea: test trait-associated loci for enrichment\n "
22
+ " of gene measurements or binary annotations.\n "
23
+ " =================================================\n "
24
+ " 1. Condition --gene-matrix on columns listed in --condition.\n "
29
25
" 2. Test each column in --gene-matrix for enrichment of genes\n "
30
- " for the user's SNPs in --snps assigned to SNP intervals\n "
31
- " provided in --snp-intervals.\n "
32
- " 3. Replicate the test with the null matched SNP sets\n "
33
- " sampled from: --null-snps\n "
34
- " for the specified number of iterations: --max-iterations\n "
35
- " and stop testing a column after --min-observations null SNP\n "
36
- " sets with higher scores are observed.\n "
37
- " \n "
38
- " snpsea --snps file.txt \\ # or --snps random20 \n "
39
- " --gene-matrix file.gct.gz \\\n "
40
- " --null-snps file.txt \\\n "
41
- " --snp-intervals file.bed.gz \\\n "
42
- " --gene-intervals file.bed.gz \\\n "
43
- " --condition file.txt \\\n "
44
- " --out folder \\\n "
45
- " --slop 250e3 \\\n "
46
- " --threads 2 \\\n "
47
- " --null-snpsets 100 \\\n "
48
- " --min-observations 25 \\\n "
49
- " --max-iterations 1e6\n\n " ;
26
+ " within --snps assigned to intervals in --snp-intervals.\n "
27
+ " 3. Repeat with the null matched SNP set from --null-snps\n "
28
+ " for --max-iterations and stop if --min-observations null SNP\n "
29
+ " sets with higher scores are observed for that column." ;
30
+ opt.syntax = " snpsea [OPTIONS]" ;
31
+ opt.example =
32
+ " snpsea --snps file.txt \\ # or --snps random20 \n "
33
+ " --gene-matrix file.gct.gz \\\n "
34
+ " --null-snps file.txt \\\n "
35
+ " --snp-intervals file.bed.gz \\\n "
36
+ " --gene-intervals file.bed.gz \\\n "
37
+ " --condition file.txt \\\n "
38
+ " --out folder \\\n "
39
+ " --slop 250e3 \\\n "
40
+ " --threads 2 \\\n "
41
+ " --null-snpsets 100 \\\n "
42
+ " --min-observations 25 \\\n "
43
+ " --max-iterations 1e6\n\n " ;
50
44
opt.footer =
51
- " SNPsea v0.1 Copyright (C) 2013 Kamil Slowikowski"
45
+ " SNPsea " SNPSEA_VERSION " Copyright (C) 2013 Kamil Slowikowski"
52
46
" <slowikow@broadinstitute.org>\n "
53
47
" This program is free and without warranty under the GPLv3 license.\n\n " ;
54
48
@@ -57,7 +51,7 @@ int main(int argc, const char * argv[])
57
51
0 , // Required?
58
52
0 , // Number of args expected.
59
53
0 , // Delimiter if expecting multiple args.
60
- " Display usage instructions." , // Help description.
54
+ " * Display usage instructions." , // Help description.
61
55
" -h" , // Flag token.
62
56
" --help" // Flag token.
63
57
);
@@ -67,7 +61,7 @@ int main(int argc, const char * argv[])
67
61
0 , // Required?
68
62
0 , // Number of args expected.
69
63
0 , // Delimiter if expecting multiple args.
70
- " Display version and exit.\n \n" , // Help description.
64
+ " * Display version and exit.\n " , // Help description.
71
65
" -v" , // Flag token.
72
66
" --version" // Flag token.
73
67
);
@@ -77,9 +71,9 @@ int main(int argc, const char * argv[])
77
71
1 , // Required?
78
72
1 , // Number of args expected.
79
73
0 , // Delimiter if expecting multiple args.
80
- " Text file with SNP identifiers in the first column.\n "
74
+ " * Text file with SNP identifiers in the first column.\n "
81
75
" Instead of a file name, you may use 'randomN' with an integer N for"
82
- " a random SNP list of length N.\n\n " ,
76
+ " a random SNP list of length N.\n " ,
83
77
" --snps" // Flag token.
84
78
);
85
79
@@ -88,8 +82,8 @@ int main(int argc, const char * argv[])
88
82
1 , // Required?
89
83
1 , // Number of args expected.
90
84
0 , // Delimiter if expecting multiple args.
91
- " Gene matrix file in GCT format. The Name column must contain the"
92
- " same gene identifiers as in --gene-intervals.\n\n " ,
85
+ " * Gene matrix file in GCT format. The Name column must contain the"
86
+ " same gene identifiers as in --gene-intervals.\n " ,
93
87
" --gene-matrix" // Flag token.
94
88
);
95
89
@@ -98,8 +92,8 @@ int main(int argc, const char * argv[])
98
92
1 , // Required?
99
93
1 , // Number of args expected.
100
94
0 , // Delimiter if expecting multiple args.
101
- " BED file with gene intervals. The fourth column must contain the"
102
- " same gene identifiers as in --gene-matrix.\n\n " ,
95
+ " * BED file with gene intervals. The fourth column must contain the"
96
+ " same gene identifiers as in --gene-matrix.\n " ,
103
97
" --gene-intervals" // Flag token.
104
98
);
105
99
@@ -108,8 +102,8 @@ int main(int argc, const char * argv[])
108
102
1 , // Required?
109
103
1 , // Number of args expected.
110
104
0 , // Delimiter if expecting multiple args.
111
- " BED file with all known SNP intervals. The fourth column must"
112
- " contain the same SNP identifiers as in --snps and --null-snps.\n\n " ,
105
+ " * BED file with all known SNP intervals. The fourth column must"
106
+ " contain the same SNP identifiers as in --snps and --null-snps.\n " ,
113
107
" --snp-intervals" // Flag token.
114
108
);
115
109
@@ -118,9 +112,9 @@ int main(int argc, const char * argv[])
118
112
1 , // Required?
119
113
1 , // Number of args expected.
120
114
0 , // Delimiter if expecting multiple args.
121
- " Text file with SNP identifiers to sample when generating null"
115
+ " * Text file with SNP identifiers to sample when generating null"
122
116
" matched or random SNP sets. These SNPs must be a subset of"
123
- " --snp-intervals.\n\n " ,
117
+ " --snp-intervals.\n " ,
124
118
" --null-snps" // Flag token.
125
119
);
126
120
@@ -129,7 +123,7 @@ int main(int argc, const char * argv[])
129
123
1 , // Required?
130
124
1 , // Number of args expected.
131
125
0 , // Delimiter if expecting multiple args.
132
- " Create output files in this directory.\n \n" , // Help description.
126
+ " * Create output files in this directory.\n " , // Help description.
133
127
" --out" // Flag token.
134
128
);
135
129
@@ -138,10 +132,10 @@ int main(int argc, const char * argv[])
138
132
0 , // Required?
139
133
1 , // Number of args expected.
140
134
0 , // Delimiter if expecting multiple args.
141
- " Text file with a list of columns in --gene-matrix to condition on"
135
+ " * Text file with a list of columns in --gene-matrix to condition on"
142
136
" before calculating p-values. Each column in --gene-matrix is"
143
137
" projected onto each column listed in this file and its projection"
144
- " is subtracted.\n\n " ,
138
+ " is subtracted.\n " ,
145
139
" --condition" // Flag token.
146
140
);
147
141
@@ -151,8 +145,8 @@ int main(int argc, const char * argv[])
151
145
0 , // Required?
152
146
1 , // Number of args expected.
153
147
0 , // Delimiter if expecting multiple args.
154
- " If a SNP overlaps no gene intervals, extend the SNP interval this"
155
- " many nucleotides further and try again.\n [default: 250000]\n\n " ,
148
+ " * If a SNP overlaps no gene intervals, extend the SNP interval this"
149
+ " many nucleotides further and try again.\n [default: 250000]\n " ,
156
150
" --slop" , // Flag token.
157
151
vU8
158
152
);
@@ -163,7 +157,7 @@ int main(int argc, const char * argv[])
163
157
0 , // Required?
164
158
1 , // Number of args expected.
165
159
0 , // Delimiter if expecting multiple args.
166
- " Number of threads to use.\n [default: 1]\n \n" ,
160
+ " * Number of threads to use.\n [default: 1]\n " ,
167
161
" --threads" , // Flag token.
168
162
gt1
169
163
);
@@ -174,8 +168,8 @@ int main(int argc, const char * argv[])
174
168
0 , // Required?
175
169
1 , // Number of args expected.
176
170
0 , // Delimiter if expecting multiple args.
177
- " Test this many null matched SNP sets, so you can compare"
178
- " your results to a distribution of null results.\n [default: 10]\n\n " ,
171
+ " * Test this many null matched SNP sets, so you can compare"
172
+ " your results to a distribution of null results.\n [default: 10]\n " ,
179
173
" --null-snpsets" , // Flag token.
180
174
gt0
181
175
);
@@ -185,10 +179,10 @@ int main(int argc, const char * argv[])
185
179
0 , // Required?
186
180
1 , // Number of args expected.
187
181
0 , // Delimiter if expecting multiple args.
188
- " Stop testing a column in --gene-matrix after observing this many"
182
+ " * Stop testing a column in --gene-matrix after observing this many"
189
183
" null SNP sets with specificity scores greater or equal to those"
190
184
" obtained with the SNP set in --snps. Increase this value to obtain"
191
- " more accurate p-values.\n [default: 25]\n\n " ,
185
+ " more accurate p-values.\n [default: 25]\n " ,
192
186
" --min-observations" , // Flag token.
193
187
gt1
194
188
);
@@ -198,9 +192,9 @@ int main(int argc, const char * argv[])
198
192
0 , // Required?
199
193
1 , // Number of args expected.
200
194
0 , // Delimiter if expecting multiple args.
201
- " Maximum number of null SNP sets tested against each column in"
195
+ " * Maximum number of null SNP sets tested against each column in"
202
196
" --gene-matrix. Increase this value to resolve smaller p-values."
203
- " \n [default: 1000]\n\n " ,
197
+ " \n [default: 1000]\n " ,
204
198
" --max-iterations" , // Flag token.
205
199
gt1
206
200
);
@@ -213,13 +207,18 @@ int main(int argc, const char * argv[])
213
207
return 1 ;
214
208
}
215
209
210
+ if (opt.isSet (" -v" )) {
211
+ std::cout << SNPSEA_VERSION << std::endl;
212
+ return 1 ;
213
+ }
214
+
216
215
std::vector<std::string> badOptions;
217
216
int i;
218
217
if (!opt.gotRequired (badOptions)) {
219
218
Usage (opt);
220
219
for (i = 0 ; i < badOptions.size (); ++i) {
221
220
std::cerr << " ERROR: Missing required option "
222
- << badOptions[i] << " .\n\n " ;
221
+ << badOptions[i] << " .\n " ;
223
222
}
224
223
return 1 ;
225
224
}
@@ -228,7 +227,7 @@ int main(int argc, const char * argv[])
228
227
Usage (opt);
229
228
for (i = 0 ; i < badOptions.size (); ++i) {
230
229
std::cerr << " ERROR: Got unexpected number of arguments for "
231
- << badOptions[i] << " .\n\n " ;
230
+ << badOptions[i] << " .\n " ;
232
231
}
233
232
return 1 ;
234
233
}
0 commit comments