101 |
|
int island_extension = 25; |
102 |
|
int segment_length = 25; |
103 |
|
int segment_mismatches = 2; |
104 |
< |
|
104 |
> |
int max_read_mismatches = 2; |
105 |
|
int max_splice_mismatches = 1; |
106 |
|
|
107 |
|
ReadFormat reads_format = FASTQ; |
108 |
|
|
109 |
|
bool verbose = false; |
110 |
|
|
111 |
< |
int max_multihits = 40; |
111 |
> |
unsigned int max_multihits = 40; |
112 |
|
bool no_closure_search = false; |
113 |
|
bool no_coverage_search = false; |
114 |
|
bool no_microexon_search = false; |
135 |
|
|
136 |
|
string gtf_juncs = ""; |
137 |
|
|
138 |
+ |
string flt_reads = ""; |
139 |
+ |
string flt_mappings = ""; |
140 |
+ |
|
141 |
|
eLIBRARY_TYPE library_type = LIBRARY_TYPE_NONE; |
142 |
|
|
143 |
|
extern void print_usage(); |
224 |
|
} |
225 |
|
|
226 |
|
|
227 |
< |
const char *short_options = "QCp:z:"; |
227 |
> |
const char *short_options = "QCp:z:N:"; |
228 |
|
|
229 |
|
enum |
230 |
|
{ |
244 |
|
OPT_NO_COVERAGE_SEARCH, |
245 |
|
OPT_NO_MICROEXON_SEARCH, |
246 |
|
OPT_SEGMENT_LENGTH, |
247 |
+ |
OPT_READ_MISMATCHES, |
248 |
|
OPT_SEGMENT_MISMATCHES, |
249 |
|
OPT_MIN_CLOSURE_EXON, |
250 |
|
OPT_MAX_CLOSURE_INTRON, |
272 |
|
OPT_ZPACKER, |
273 |
|
OPT_SAMTOOLS, |
274 |
|
OPT_AUX_OUT, |
275 |
< |
OPT_GTF_JUNCS |
275 |
> |
OPT_GTF_JUNCS, |
276 |
> |
OPT_FILTER_READS, |
277 |
> |
OPT_FILTER_HITS |
278 |
|
}; |
279 |
|
|
280 |
|
static struct option long_options[] = { |
296 |
|
{"no-microexon-search", no_argument, 0, OPT_NO_MICROEXON_SEARCH}, |
297 |
|
{"segment-length", required_argument, 0, OPT_SEGMENT_LENGTH}, |
298 |
|
{"segment-mismatches", required_argument, 0, OPT_SEGMENT_MISMATCHES}, |
299 |
+ |
{"max-mismatches", required_argument, 0, OPT_READ_MISMATCHES}, |
300 |
|
{"min-closure-exon", required_argument, 0, OPT_MIN_CLOSURE_EXON}, |
301 |
|
{"min-closure-intron", required_argument, 0, OPT_MIN_CLOSURE_INTRON}, |
302 |
|
{"max-closure-intron", required_argument, 0, OPT_MAX_CLOSURE_INTRON}, |
323 |
|
{"samtools", required_argument, 0, OPT_SAMTOOLS}, |
324 |
|
{"aux-outfile", required_argument, 0, OPT_AUX_OUT}, |
325 |
|
{"gtf-juncs", required_argument, 0, OPT_GTF_JUNCS}, |
326 |
+ |
{"flt-reads",required_argument, 0, OPT_FILTER_READS}, |
327 |
+ |
{"flt-hits",required_argument, 0, OPT_FILTER_HITS}, |
328 |
|
{0, 0, 0, 0} // terminator |
329 |
|
}; |
330 |
|
|
400 |
|
case OPT_SEGMENT_MISMATCHES: |
401 |
|
segment_mismatches = parseIntOpt(0, "--segment-mismatches arg must be at least 0", print_usage); |
402 |
|
break; |
403 |
+ |
case 'N': |
404 |
+ |
case OPT_READ_MISMATCHES: |
405 |
+ |
max_read_mismatches = parseIntOpt(0, "--max-mismatches arg must be at least 0", print_usage); |
406 |
+ |
break; |
407 |
|
case OPT_MIN_CLOSURE_EXON: |
408 |
|
min_closure_exon_length = parseIntOpt(1, "--min-closure-exon arg must be at least 1", print_usage); |
409 |
|
break; |
503 |
|
case OPT_GTF_JUNCS: |
504 |
|
gtf_juncs = optarg; |
505 |
|
break; |
506 |
+ |
case OPT_FILTER_READS: |
507 |
+ |
flt_reads = optarg; |
508 |
+ |
break; |
509 |
+ |
case OPT_FILTER_HITS: |
510 |
+ |
flt_mappings = optarg; |
511 |
+ |
break; |
512 |
|
default: |
513 |
|
print_usage(); |
514 |
|
return 1; |
619 |
|
//only needed for the primary input files (given by user) |
620 |
|
string picmd(""); |
621 |
|
string fext=getFext(fname); |
622 |
+ |
if (fext=="bam") { |
623 |
+ |
picmd="bam2fastx"; |
624 |
+ |
return picmd; |
625 |
+ |
} |
626 |
|
if (fext=="gz" || fext=="gzip" || fext=="z") { |
627 |
|
if (use_all_cpus && str_endsWith(zpacker,"pigz")) { |
628 |
|
picmd=zpacker; |
671 |
|
} |
672 |
|
|
673 |
|
string getUnpackCmd(const string& fname, bool use_all_cpus) { |
674 |
< |
//prep_reads should use guess_packer() instead |
674 |
> |
//prep_reads should use guess_packer() instead |
675 |
> |
//otherwise compressed files MUST have the .z extension, |
676 |
> |
//as they are all internally generated |
677 |
|
string pipecmd(""); |
678 |
< |
if (zpacker.empty() || getFext(fname)!="z") { |
679 |
< |
return pipecmd; |
678 |
> |
string fext=getFext(fname); |
679 |
> |
if (fext=="bam") { |
680 |
> |
pipecmd="bam2fastx"; |
681 |
> |
return pipecmd; |
682 |
> |
} |
683 |
> |
if (zpacker.empty() || fext!="z") { |
684 |
> |
return pipecmd; //no packer used |
685 |
|
} |
686 |
|
pipecmd=zpacker; |
687 |
|
if (str_endsWith(pipecmd, "pigz") ||str_endsWith(pipecmd, "pbzip2")) { |