NYU-Molecular-Pathology / NGS580-nf

Target exome sequencing analysis for NYU NGS580 gene panel
GNU General Public License v3.0
10 stars 6 forks source link

Errors in `reformat-vcf-table.py` return exit code 0 #24

Open stevekm opened 5 years ago

stevekm commented 5 years ago

When a error is encountered with the reformat-vcf-table.py script, but its stdout is being piped, the overall exit code of the processes is returned as 0, allowing broken files to pass through the Nextflow pipelines. Example:

reformat-vcf-table.py -c MuTect2 -s "${tumorID}" -i "${tsv_file}" | \
        paste-col.py --header "Sample" -v "${tumorID}"  > output.tsv

If an error is encountered by reformat-vcf-table.py here while it is in the middle of processing the file contents, a partial file will be created in output.tsv and the returned exit code of 0 will allow Nextflow to propagate output.tsv further down the pipeline.

Need to figure out how to ensure that non-zero exit code is returned in these cases.

stevekm commented 4 years ago

So far I have been band-aiding this by including tests on pipeline steps that use these kinds of stdin/stdout Python scripts to check the line count of the output file. Need to develop a better solution to address this.

stevekm commented 4 years ago

consider addingset -o pipefail to script settings