Lines 5-11
Link Here
|
5 |
|
5 |
|
6 |
#include <ostream> |
6 |
#include <ostream> |
7 |
#include <unistd.h> // getopt |
7 |
#include <unistd.h> // getopt |
8 |
#include <stdlib.h> // getenv |
|
|
9 |
#include "MCFgen.hpp" // die, tostring |
8 |
#include "MCFgen.hpp" // die, tostring |
10 |
#include "MCFbio.hpp" // count_residues |
9 |
#include "MCFbio.hpp" // count_residues |
11 |
#include "args.hpp" |
10 |
#include "args.hpp" |
Lines 58-64
Link Here
|
58 |
of sequence motifs in a FASTA-like format described below. Any non-alphabetic\n\ |
57 |
of sequence motifs in a FASTA-like format described below. Any non-alphabetic\n\ |
59 |
characters in the sequences are ignored, and any alphabetic characters except A,\n\ |
58 |
characters in the sequences are ignored, and any alphabetic characters except A,\n\ |
60 |
C, G, T (uppercase or lowercase) are converted to 'n' and excluded from matching\n\ |
59 |
C, G, T (uppercase or lowercase) are converted to 'n' and excluded from matching\n\ |
61 |
motifs. The motif file, specified either in the CLOVER_MOTIF_FILE variable or as clover option, should look like this:\n\ |
60 |
motifs. The motif file should look like this:\n\ |
62 |
\n\ |
61 |
\n\ |
63 |
>TATA\n\ |
62 |
>TATA\n\ |
64 |
0 0 0 10\n\ |
63 |
0 0 0 10\n\ |
Lines 130-136
Link Here
|
130 |
In addition to the two required inputs, there several options for modifying\n\ |
129 |
In addition to the two required inputs, there several options for modifying\n\ |
131 |
Clover's behavior:\n\ |
130 |
Clover's behavior:\n\ |
132 |
-h Help: print documentation. You already know this one.\n\ |
131 |
-h Help: print documentation. You already know this one.\n\ |
133 |
-f alternative motif file (overrides CLOVER_MOTIF_FILE variable)\n\ |
|
|
134 |
-r Number of randomized/control raw scores to calculate for comparison with\n\ |
132 |
-r Number of randomized/control raw scores to calculate for comparison with\n\ |
135 |
each target raw score.\n\ |
133 |
each target raw score.\n\ |
136 |
-t P-value threshold: only print results for motifs whose P-values don't\n\ |
134 |
-t P-value threshold: only print results for motifs whose P-values don't\n\ |
Lines 162-173
Link Here
|
162 |
"; |
160 |
"; |
163 |
|
161 |
|
164 |
const string usage = |
162 |
const string usage = |
165 |
"Usage summary: clover [options] myseqs.fa [BGfiles]\n" |
163 |
"Usage summary: clover [options] mymotifs myseqs.fa [BGfiles]\n" |
166 |
"\nYou should set the CLOVER_MOTIF_FILE environmental variable\n" |
|
|
167 |
"or specify the path to a motif file as clover option\n\n" |
168 |
"Options:\n" |
164 |
"Options:\n" |
169 |
"-h help: print documentation\n" |
165 |
"-h help: print documentation\n" |
170 |
"-f alternative motif file (overrides CLOVER_MOTIF_FILE variable)\n" |
|
|
171 |
"-r number of randomizations (" + tostring(shuffles) + ")\n" |
166 |
"-r number of randomizations (" + tostring(shuffles) + ")\n" |
172 |
"-t P-value threshold (" + tostring(pthresh) + ")\n" |
167 |
"-t P-value threshold (" + tostring(pthresh) + ")\n" |
173 |
"-u motif score threshold (" + tostring(hit_thresh) + ")\n" |
168 |
"-u motif score threshold (" + tostring(hit_thresh) + ")\n" |
Lines 180-199
Link Here
|
180 |
"-s seed for random number generator (" + tostring(random_seed) + ")\n" |
175 |
"-s seed for random number generator (" + tostring(random_seed) + ")\n" |
181 |
; |
176 |
; |
182 |
|
177 |
|
183 |
char *cptr; |
|
|
184 |
if ((cptr = getenv( "CLOVER_MOTIF_FILE" )) != NULL ) { |
185 |
mat_file = cptr; |
186 |
} |
187 |
int c; |
178 |
int c; |
188 |
|
179 |
|
189 |
while ((c = getopt(argc, argv, "hf:r:t:u:ndmlvp:s:")) != -1) |
180 |
while ((c = getopt(argc, argv, "hr:t:u:ndmlvp:s:")) != -1) |
190 |
switch (c) { |
181 |
switch (c) { |
191 |
case 'h': |
182 |
case 'h': |
192 |
cout << doc << endl; |
183 |
cout << doc << endl; |
193 |
exit(0); |
184 |
exit(0); |
194 |
case 'f': |
|
|
195 |
mat_file = optarg; |
196 |
break; |
197 |
case 'r': |
185 |
case 'r': |
198 |
shuffles = atoi(optarg); |
186 |
shuffles = atoi(optarg); |
199 |
break; |
187 |
break; |
Lines 228-239
Link Here
|
228 |
mcf::die("\n" + usage); // "invalid option" message is printed by getopt |
216 |
mcf::die("\n" + usage); // "invalid option" message is printed by getopt |
229 |
} |
217 |
} |
230 |
|
218 |
|
231 |
if (mat_file.empty()) |
219 |
if (optind + 2 > argc) // there should be 2 more non-option arguments |
232 |
mcf::die("*** Error: Motif file not specified\n\n" + usage); |
220 |
mcf::die("Error: motif and sequence files required\n\n" + usage); |
233 |
|
|
|
234 |
if (optind + 1 > argc) // there should be 2 more non-option arguments |
235 |
mcf::die("*** Error: sequence file required\n\n" + usage); |
236 |
|
221 |
|
|
|
222 |
mat_file = argv[optind++]; |
237 |
seq_file = argv[optind++]; |
223 |
seq_file = argv[optind++]; |
238 |
|
224 |
|
239 |
while (optind < argc) |
225 |
while (optind < argc) |