gatk4/markduplicates and picard/markduplicates output file extension confusion
Nobody has claimed this yet.
- Dominant language
- Nextflow
- Stars
- 429
- Forks
- 1.1k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 153
Description
Have you checked the docs?
Description of the bug
I've discovered a few weird behaviours when comparing the gatk4/markduplicates and picard/markduplicates modules.
1. omitting a file extension in gatk4/markduplicates ext.prefix causes the output bam channel to be empty
When ext.prefix is set without a file extension (e.g., ext.prefix = { "${meta.id}.markdup.bam" }), the module creates an internal output file, but the output channel remains empty because the file doesn't match the glob pattern *bam. No files get published either.
Expected Behavior: the module could add a safety check similar to the picard module (see below), or require .bam/.cram. Or auto-append .bam if not detected.
Something like this might be enough?
if (!prefix.endsWith('.bam') && !prefix.endsWith('.cram')) {
prefix = "${prefix}.bam"
}
2. the general behaviour of these two modules is a bit at odds and confusing
When running picard/markduplicates without specifying an extension, an error is thrown (https://github.com/nf-core/modules/blob/adfd5ba7915e96ccf41ccc0b4be859c398d0eb95/modules/nf-core/picard/markduplicates/main.nf#L37).
What it expects is a prefix of the type ext.prefix = { "${meta.id}.markdup" }. Using something like ext.prefix = { "${meta.id}.markdup.bam" } leads to output files with a.bam.bam` extension.
In gatk4/markduplicates on the other hand, not specifying a prefix seems to work just fine. I'm not sure why, since I'd expect the input and output file to overwrite each other since they have the same name (see https://github.com/nf-core/modules/blob/adfd5ba7915e96ccf41ccc0b4be859c398d0eb95/modules/nf-core/gatk4/markduplicates/main.nf#L28). Regardless, if you do specify a custom extension, it needs to include the .bam part, otherwise it will not get outputted as described above.
This seems to be related to this issue? https://github.com/nf-core/modules/pull/8118
Command used and terminal output
Relevant files
No response
System information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the output-prefix handling in modules/nf-core/gatk4/markduplicates/main.nf and modules/nf-core/picard/markduplicates/main.nf at the referenced lines. Reproduce the differing extension cases and trace how each output glob populates its channel. Done means the two modules have documented, consistent extension behavior and the affected outputs are emitted correctly.
Written by the indexing model from the issue text.
Assessment
- Domain
- bioinformatics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100