-
Notifications
You must be signed in to change notification settings - Fork 953
Samtools quickcheck #9678
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
base: master
Are you sure you want to change the base?
Samtools quickcheck #9678
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A thought about how this might be made more malleable to pipeline developers.
I wonder if linting is failing because the module has no "ordinary" outputs?
| @@ -0,0 +1,139 @@ | |||
| // TODO nf-core: Once you have added the required tests, please run the following command to build this file: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // TODO nf-core: Once you have added the required tests, please run the following command to build this file: |
| /* There is not generated output files. | ||
| The sole purpose of 'samtools quickcheck' is to return an error if the mapping file is malformatted. | ||
| The purpose in of the Nextflow process is to break the main workflow (by default) if the script returns a non-zero exit code. | ||
| The nf-core components guidelines (https://nf-co.re/docs/guidelines/components/modules) do not specify that there must be output files. | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: instead of erroring the process, we should capture the exitcode in the script and then return it.
This allows more flexibility to the module user - they can iterate over the outputs of the module and either filter out failed BAM files, throw an error, try and fix problems, etc.. - rather than just forcing the pipeline to die.
| /* There is not generated output files. | |
| The sole purpose of 'samtools quickcheck' is to return an error if the mapping file is malformatted. | |
| The purpose in of the Nextflow process is to break the main workflow (by default) if the script returns a non-zero exit code. | |
| The nf-core components guidelines (https://nf-co.re/docs/guidelines/components/modules) do not specify that there must be output files. | |
| */ | |
| tuple val(meta), path(bam), env("EXIT_CODE") |
| samtools quickcheck \\ | ||
| $args \\ | ||
| $bam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| samtools quickcheck \\ | |
| $args \\ | |
| $bam | |
| samtools quickcheck \\ | |
| $args \\ | |
| $bam || EXIT_CODE=\$? | |
| EXIT_CODE=\${EXIT_CODE:-0} |
| stub: | ||
| def args = task.ext.args ?: '' | ||
| """ | ||
| echo $args |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| echo $args | |
| EXIT_CODE=0 | |
| echo $args |
PR checklist
Closes #9657
topic: versions- See version_topicslabelnf-core modules test <MODULE> --profile dockernf-core modules test <MODULE> --profile singularitynf-core modules test <MODULE> --profile condanf-core subworkflows test <SUBWORKFLOW> --profile dockernf-core subworkflows test <SUBWORKFLOW> --profile singularitynf-core subworkflows test <SUBWORKFLOW> --profile condaSummary
This PR adds
samtools quickcheckto the nf-core modules. As opposed to many other tools, this samtools submodule does not return an output file. Instead, the command returns a non-zero exit code if the alignment file (SAM/BAM/CRAM) is invalid/malformatted.The nf-core module specification does not strictly require output files. The idea here is to use the exit code of samtools for it's native behavior, i.e. the exit code determines the success of the nextflow workflow (regulated by the
errorStrategy). If the input channel contains an invalid alignment file, the nf-core module returns a non-zero exit code and terminates the main worflow.