Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message for empty fastq files #1416

Open
SpikyClip opened this issue Feb 21, 2024 · 2 comments
Open

Better error message for empty fastq files #1416

SpikyClip opened this issue Feb 21, 2024 · 2 comments
Labels
enhancement New feature or request input validation

Comments

@SpikyClip
Copy link

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).

@FriederikeHanssen
Copy link
Contributor

@nvnieuwk @mirpedrol is this something that could be done on the nf-validation side or out of scope?

@nvnieuwk
Copy link

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request input validation
Projects
None yet
Development

No branches or pull requests

3 participants