Permalink
Browse files

fixed bug where optional arguments should have been required arguments

  • Loading branch information...
1 parent e8e1496 commit 972a0e3067e70cbf08b7e3b09337fbcdfbd9274a @najoshi najoshi committed Feb 24, 2015
Showing with 26 additions and 31 deletions.
  1. +4 −4 README.md
  2. +14 −16 src/trim_paired.c
  3. +8 −11 src/trim_single.c
View
@@ -94,7 +94,7 @@ truncation of sequences with Ns.
sickle se -f input_file.fastq -t illumina -o trimmed_output_file.fastq -q 33 -l 40
sickle se -f input_file.fastq -t illumina -o trimmed_output_file.fastq -x -n
sickle se -t sanger -g -f input_file.fastq -o trimmed_output_file.fastq.gz
- sickle se --fastq-file=input_file.fastq --qual-type=sanger --output-file=trimmed_output_file.fastq
+ sickle se --fastq-file input_file.fastq --qual-type sanger --output-file trimmed_output_file.fastq
### Sickle Paired End (`sickle pe`)
@@ -136,6 +136,6 @@ enable truncation of sequences with Ns.
sickle pe -c combo.fastq -t sanger -M combo_trimmed_all.fastq
- sickle pe --pe-file1=input_file1.fastq --pe-file2=input_file2.fastq --qual-type=sanger \
- --output-pe1=trimmed_output_file1.fastq --output-pe2=trimmed_output_file2.fastq \
- --output-single=trimmed_singles_file.fastq
+ sickle pe --pe-file1 input_file1.fastq --pe-file2 input_file2.fastq --qual-type sanger \
+ --output-pe1 trimmed_output_file1.fastq --output-pe2 trimmed_output_file2.fastq \
+ --output-single trimmed_singles_file.fastq
View
@@ -18,20 +18,20 @@ int paired_length_threshold = 20;
static struct option paired_long_options[] = {
{"qual-type", required_argument, 0, 't'},
- {"pe-file1", optional_argument, 0, 'f'},
- {"pe-file2", optional_argument, 0, 'r'},
- {"pe-combo", optional_argument, 0, 'c'},
- {"output-pe1", optional_argument, 0, 'o'},
- {"output-pe2", optional_argument, 0, 'p'},
- {"output-single", optional_argument, 0, 's'},
- {"output-combo", optional_argument, 0, 'm'},
- {"qual-threshold", optional_argument, 0, 'q'},
- {"length-threshold", optional_argument, 0, 'l'},
- {"no-fiveprime", optional_argument, 0, 'x'},
- {"truncate-n", optional_argument, 0, 'n'},
- {"gzip-output", optional_argument, 0, 'g'},
- {"output-combo-all", optional_argument, 0, 'M'},
- {"quiet", optional_argument, 0, 'z'},
+ {"pe-file1", required_argument, 0, 'f'},
+ {"pe-file2", required_argument, 0, 'r'},
+ {"pe-combo", required_argument, 0, 'c'},
+ {"output-pe1", required_argument, 0, 'o'},
+ {"output-pe2", required_argument, 0, 'p'},
+ {"output-single", required_argument, 0, 's'},
+ {"output-combo", required_argument, 0, 'm'},
+ {"qual-threshold", required_argument, 0, 'q'},
+ {"length-threshold", required_argument, 0, 'l'},
+ {"no-fiveprime", no_argument, 0, 'x'},
+ {"truncate-n", no_argument, 0, 'n'},
+ {"gzip-output", no_argument, 0, 'g'},
+ {"output-combo-all", required_argument, 0, 'M'},
+ {"quiet", no_argument, 0, 'z'},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
@@ -45,8 +45,6 @@ void paired_usage (int status, char *msg) {
fprintf(stderr, "Usage: %s pe [options] -c <interleaved input file> -t <quality type> -m <interleaved trimmed paired-end output> -s <trimmed singles file>\n\n\
If you have one file with interleaved reads as input and you want ONLY one interleaved file as output:\n\
Usage: %s pe [options] -c <interleaved input file> -t <quality type> -M <interleaved trimmed output>\n\n", PROGRAM_NAME, PROGRAM_NAME);
- fprintf(stderr, "Finally, if you are using the long-style options, make sure to use an equals sign (=) with the option:\n\
-Usage: %s pe [options] --pe-file1=<paired-end forward fastq file> --pe-file2=<paired-end reverse fastq file> --qual-type=<quality type> --output-pe1=<trimmed PE forward file> --output-pe2=<trimmed PE reverse file> --output-single=<trimmed singles file>\n\n", PROGRAM_NAME);
fprintf(stderr, "Options:\n\
Paired-end separated reads\n\
--------------------------\n\
View
@@ -19,12 +19,12 @@ static struct option single_long_options[] = {
{"fastq-file", required_argument, 0, 'f'},
{"output-file", required_argument, 0, 'o'},
{"qual-type", required_argument, 0, 't'},
- {"qual-threshold", optional_argument, 0, 'q'},
- {"length-threshold", optional_argument, 0, 'l'},
- {"no-fiveprime", optional_argument, 0, 'x'},
- {"discard-n", optional_argument, 0, 'n'},
- {"gzip-output", optional_argument, 0, 'g'},
- {"quiet", optional_argument, 0, 'z'},
+ {"qual-threshold", required_argument, 0, 'q'},
+ {"length-threshold", required_argument, 0, 'l'},
+ {"no-fiveprime", no_argument, 0, 'x'},
+ {"discard-n", no_argument, 0, 'n'},
+ {"gzip-output", no_argument, 0, 'g'},
+ {"quiet", no_argument, 0, 'z'},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
@@ -34,13 +34,10 @@ void single_usage(int status, char *msg) {
fprintf(stderr, "\nUsage: %s se [options] -f <fastq sequence file> -t <quality type> -o <trimmed fastq file>\n\
\n\
-If you are using the long-style options, make sure to use an equals sign (=) with the option:\n\
-Usage: sickle se [options] --fastq-file=<fastq sequence file> --qual-type=<quality type> --output-file=<trimmed fastq file>\n\n", PROGRAM_NAME);
-
-fprintf(stderr, "Options:\n\
+Options:\n\
-f, --fastq-file, Input fastq file (required)\n\
-t, --qual-type, Type of quality values (solexa (CASAVA < 1.3), illumina (CASAVA 1.3 to 1.7), sanger (which is CASAVA >= 1.8)) (required)\n\
--o, --output-file, Output trimmed fastq file (required)\n");
+-o, --output-file, Output trimmed fastq file (required)\n", PROGRAM_NAME);
fprintf(stderr, "-q, --qual-threshold, Threshold for trimming based on average quality in a window. Default 20.\n\
-l, --length-threshold, Threshold to keep a read based on length after trimming. Default 20.\n\

0 comments on commit 972a0e3

Please sign in to comment.