sarek
sarek copied to clipboard
Better error message for empty fastq files
Description of feature
I noticed that sometimes if an empty fastq is provided, it returns a slightly cryptic error message:
ERROR ~ Cannot invoke method startsWith() on null object
-- Check script '/home/vajith/.nextflow/assets/nf-core/sarek/./workflows/../subworkflows/local/samplesheet_to_channel/main.nf' at line: 275 or see '/home/vajith/workspaces/2024-02-22_wes_jason_sarek/logs/.nextflow.log' file for more details
Of course best practice is to always md5 check your files, but it took awhile to debug a colleague's pipeline as it seemed like it was a samplesheet error. It would help users unfamiliar to nextflow/sarek if this error was more verbose:
ERROR ~ The following input files are empty:
file1
file2
Figured this test would be simple to implement, and would probably be useful to all nextflow pipelines as well (if its not already implemented in other pipelines).
@nvnieuwk @mirpedrol is this something that could be done on the nf-validation side or out of scope?
AFAIK default JSON schema is not designed to define the contents of files. I'm not sure it's possible currently, but if there is interest we can add another key to the schema to check if a file is empty or not.
I think the best solution now is to run a simple check at the start of the pipeline to check if they are empty with .size()