Exit code is zero when there's a bad barcode file

Issue #29 new
Robert Leach created an issue

USE CASE: WHAT DO YOU WANT TO DO?

Get a non-zero exit status when there's an error.

STEPS TO REPRODUCE AN ISSUE (OR TRIGGER A NEW FEATURE)

  1. Generate a bad "barcode" file. I accidentally supplied a previous splitter output summary file.
  2. Run using the test files like: barcode_splitter --bcfile bad_file.txt --mismatches '2' --galaxy --prefix 'split/' --format 'fastq' --suffix '.fastq' barcode_splitter1.fastq barcode_splitter_index_2.fastq barcode_splitter_index.fastq --idxread '3'

CURRENT BEHAVIOR

Exit code: 0 Errors on STDERR:

Unable to parse line in barcode file: [/private/var/folders/8d/z84mms353qb2n0r3n2jhww0m0000gq/T/tmpdXKJsZ/files/000/dataset_6.dat]:[Sample  Barcode1    Count   Percent Files]. Must contain 2 columns (the number of values supplied to --idxread plus 1 for the sample ID), but found [5].  Skipping.
Unable to parse line in barcode file: [/private/var/folders/8d/z84mms353qb2n0r3n2jhww0m0000gq/T/tmpdXKJsZ/files/000/dataset_6.dat]:[BC1 GATCT   5   11.90%  split/BC1-read-*.fastq]. Must contain 2 columns (the number of values supplied to --idxread plus 1 for the sample ID), but found [5].  Skipping.
Unable to parse line in barcode file: [/private/var/folders/8d/z84mms353qb2n0r3n2jhww0m0000gq/T/tmpdXKJsZ/files/000/dataset_6.dat]:[BC2 ATCGT   12  28.57%  split/BC2-read-*.fastq]. Must contain 2 columns (the number of values supplied to --idxread plus 1 for the sample ID), but found [5].  Skipping.
Unable to parse line in barcode file: [/private/var/folders/8d/z84mms353qb2n0r3n2jhww0m0000gq/T/tmpdXKJsZ/files/000/dataset_6.dat]:[BC3 GTGAT   9   21.43%  split/BC3-read-*.fastq]. Must contain 2 columns (the number of values supplied to --idxread plus 1 for the sample ID), but found [5].  Skipping.
Unable to parse line in barcode file: [/private/var/folders/8d/z84mms353qb2n0r3n2jhww0m0000gq/T/tmpdXKJsZ/files/000/dataset_6.dat]:[BC4 TGTCT   0   0.00%   split/BC4-read-*.fastq]. Must contain 2 columns (the number of values supplied to --idxread plus 1 for the sample ID), but found [5].  Skipping.
Unable to parse line in barcode file: [/private/var/folders/8d/z84mms353qb2n0r3n2jhww0m0000gq/T/tmpdXKJsZ/files/000/dataset_6.dat]:[multimatched    multimatched    6   14.29%  split/multimatched-read-*.fastq]. Must contain 2 columns (the number of values supplied to --idxread plus 1 for the sample ID), but found [5].  Skipping.
Unable to parse line in barcode file: [/private/var/folders/8d/z84mms353qb2n0r3n2jhww0m0000gq/T/tmpdXKJsZ/files/000/dataset_6.dat]:[unmatched   unmatched   8   19.05%  split/unmatched-read-*.fastq]. Must contain 2 columns (the number of values supplied to --idxread plus 1 for the sample ID), but found [5].  Skipping.
Unable to parse line in barcode file: [/private/var/folders/8d/z84mms353qb2n0r3n2jhww0m0000gq/T/tmpdXKJsZ/files/000/dataset_6.dat]:[ERRORS  NA  2   4.76%   STDERR]. Must contain 2 columns (the number of values supplied to --idxread plus 1 for the sample ID), but found [5].  Skipping.
Traceback (most recent call last):
  File "/Users/rleach/local/miniconda3/envs/__barcode_splitter@0.18.4/bin/barcode_splitter", line 12, in <module>
    sys.exit(main())
  File "/Users/rleach/local/miniconda3/envs/__barcode_splitter@0.18.4/lib/python3.7/site-packages/barcode_splitter.py", line 147, in main
    options.galaxy))
  File "/Users/rleach/local/miniconda3/envs/__barcode_splitter@0.18.4/lib/python3.7/site-packages/barcode_splitter.py", line 441, in read_barcodes
    % (filename))
Exception: Unable to parse any barcodes from barcode file [/private/var/folders/8d/z84mms353qb2n0r3n2jhww0m0000gq/T/tmpdXKJsZ/files/000/dataset_6.dat].

EXPECTED BEHAVIOR

The warnings/errors are fine, but the exit code should be non-zero.

DEVELOPERS ONLY SECTION

SUGGESTED CHANGE (Pseudocode optional)

none

LEVEL OF EFFORT - developers only

minor

COMMENTS

I discovered this while working on the galaxy wrapper.

Comments (0)

  1. Log in to comment