Skip to content

Commit 972a0e3

Browse files
committed
fixed bug where optional arguments should have been required arguments
1 parent e8e1496 commit 972a0e3

File tree

3 files changed

+26
-31
lines changed

3 files changed

+26
-31
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ truncation of sequences with Ns.
9494
sickle se -f input_file.fastq -t illumina -o trimmed_output_file.fastq -q 33 -l 40
9595
sickle se -f input_file.fastq -t illumina -o trimmed_output_file.fastq -x -n
9696
sickle se -t sanger -g -f input_file.fastq -o trimmed_output_file.fastq.gz
97-
sickle se --fastq-file=input_file.fastq --qual-type=sanger --output-file=trimmed_output_file.fastq
97+
sickle se --fastq-file input_file.fastq --qual-type sanger --output-file trimmed_output_file.fastq
9898

9999
### Sickle Paired End (`sickle pe`)
100100

@@ -136,6 +136,6 @@ enable truncation of sequences with Ns.
136136

137137
sickle pe -c combo.fastq -t sanger -M combo_trimmed_all.fastq
138138

139-
sickle pe --pe-file1=input_file1.fastq --pe-file2=input_file2.fastq --qual-type=sanger \
140-
--output-pe1=trimmed_output_file1.fastq --output-pe2=trimmed_output_file2.fastq \
141-
--output-single=trimmed_singles_file.fastq
139+
sickle pe --pe-file1 input_file1.fastq --pe-file2 input_file2.fastq --qual-type sanger \
140+
--output-pe1 trimmed_output_file1.fastq --output-pe2 trimmed_output_file2.fastq \
141+
--output-single trimmed_singles_file.fastq

src/trim_paired.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ int paired_length_threshold = 20;
1818

1919
static struct option paired_long_options[] = {
2020
{"qual-type", required_argument, 0, 't'},
21-
{"pe-file1", optional_argument, 0, 'f'},
22-
{"pe-file2", optional_argument, 0, 'r'},
23-
{"pe-combo", optional_argument, 0, 'c'},
24-
{"output-pe1", optional_argument, 0, 'o'},
25-
{"output-pe2", optional_argument, 0, 'p'},
26-
{"output-single", optional_argument, 0, 's'},
27-
{"output-combo", optional_argument, 0, 'm'},
28-
{"qual-threshold", optional_argument, 0, 'q'},
29-
{"length-threshold", optional_argument, 0, 'l'},
30-
{"no-fiveprime", optional_argument, 0, 'x'},
31-
{"truncate-n", optional_argument, 0, 'n'},
32-
{"gzip-output", optional_argument, 0, 'g'},
33-
{"output-combo-all", optional_argument, 0, 'M'},
34-
{"quiet", optional_argument, 0, 'z'},
21+
{"pe-file1", required_argument, 0, 'f'},
22+
{"pe-file2", required_argument, 0, 'r'},
23+
{"pe-combo", required_argument, 0, 'c'},
24+
{"output-pe1", required_argument, 0, 'o'},
25+
{"output-pe2", required_argument, 0, 'p'},
26+
{"output-single", required_argument, 0, 's'},
27+
{"output-combo", required_argument, 0, 'm'},
28+
{"qual-threshold", required_argument, 0, 'q'},
29+
{"length-threshold", required_argument, 0, 'l'},
30+
{"no-fiveprime", no_argument, 0, 'x'},
31+
{"truncate-n", no_argument, 0, 'n'},
32+
{"gzip-output", no_argument, 0, 'g'},
33+
{"output-combo-all", required_argument, 0, 'M'},
34+
{"quiet", no_argument, 0, 'z'},
3535
{GETOPT_HELP_OPTION_DECL},
3636
{GETOPT_VERSION_OPTION_DECL},
3737
{NULL, 0, NULL, 0}
@@ -45,8 +45,6 @@ void paired_usage (int status, char *msg) {
4545
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\
4646
If you have one file with interleaved reads as input and you want ONLY one interleaved file as output:\n\
4747
Usage: %s pe [options] -c <interleaved input file> -t <quality type> -M <interleaved trimmed output>\n\n", PROGRAM_NAME, PROGRAM_NAME);
48-
fprintf(stderr, "Finally, if you are using the long-style options, make sure to use an equals sign (=) with the option:\n\
49-
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);
5048
fprintf(stderr, "Options:\n\
5149
Paired-end separated reads\n\
5250
--------------------------\n\

src/trim_single.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ static struct option single_long_options[] = {
1919
{"fastq-file", required_argument, 0, 'f'},
2020
{"output-file", required_argument, 0, 'o'},
2121
{"qual-type", required_argument, 0, 't'},
22-
{"qual-threshold", optional_argument, 0, 'q'},
23-
{"length-threshold", optional_argument, 0, 'l'},
24-
{"no-fiveprime", optional_argument, 0, 'x'},
25-
{"discard-n", optional_argument, 0, 'n'},
26-
{"gzip-output", optional_argument, 0, 'g'},
27-
{"quiet", optional_argument, 0, 'z'},
22+
{"qual-threshold", required_argument, 0, 'q'},
23+
{"length-threshold", required_argument, 0, 'l'},
24+
{"no-fiveprime", no_argument, 0, 'x'},
25+
{"discard-n", no_argument, 0, 'n'},
26+
{"gzip-output", no_argument, 0, 'g'},
27+
{"quiet", no_argument, 0, 'z'},
2828
{GETOPT_HELP_OPTION_DECL},
2929
{GETOPT_VERSION_OPTION_DECL},
3030
{NULL, 0, NULL, 0}
@@ -34,13 +34,10 @@ void single_usage(int status, char *msg) {
3434

3535
fprintf(stderr, "\nUsage: %s se [options] -f <fastq sequence file> -t <quality type> -o <trimmed fastq file>\n\
3636
\n\
37-
If you are using the long-style options, make sure to use an equals sign (=) with the option:\n\
38-
Usage: sickle se [options] --fastq-file=<fastq sequence file> --qual-type=<quality type> --output-file=<trimmed fastq file>\n\n", PROGRAM_NAME);
39-
40-
fprintf(stderr, "Options:\n\
37+
Options:\n\
4138
-f, --fastq-file, Input fastq file (required)\n\
4239
-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\
43-
-o, --output-file, Output trimmed fastq file (required)\n");
40+
-o, --output-file, Output trimmed fastq file (required)\n", PROGRAM_NAME);
4441

4542
fprintf(stderr, "-q, --qual-threshold, Threshold for trimming based on average quality in a window. Default 20.\n\
4643
-l, --length-threshold, Threshold to keep a read based on length after trimming. Default 20.\n\

0 commit comments

Comments
 (0)