Description of the bug
Follow-up to #1865 / PR #1869.
PR #1869 added a validation error for --use_rustqc + --skip_markduplicates, because RustQC requires duplicate-marked (but not removed) BAMs. The same failure occurs with --with_umi, which the new validation does not cover.
When --with_umi true is set, UMI-based deduplication (UMICollapse / UMI-tools) physically removes PCR duplicates, and the workflow skips Picard MarkDuplicates regardless of skip_markduplicates:
workflows/rnaseq/main.nf:
if (!params.skip_markduplicates && !params.with_umi && !markdups_done) {
BAM_MARKDUPLICATES_PICARD ( ch_genome_bam, ch_fasta_fai )
ch_genome_bam = BAM_MARKDUPLICATES_PICARD.out.bam
}
So with --use_rustqc --with_umi (and the default skip_markduplicates = false), the BAM handed to RUSTQC has zero 0x400-flagged reads, and RustQC aborts with the same error as #1865:
✗ error: Failed to process <sample>.umi_dedup.sorted.bam: No duplicate-flagged reads
found among 1172750 mapped reads in '<sample>.umi_dedup.sorted.bam'.
RustQC requires that BAM files have duplicates marked (SAM flag 0x400) but NOT removed.
None of the reads examined so far have the duplicate flag set.
...
If you are certain that duplicates are already marked, use --skip-dup-check to bypass this check.
Error: 1 file(s) failed to process
The validation added in #1869 only checks skip_markduplicates:
subworkflows/local/utils_nfcore_rnaseq_pipeline/main.nf (dev, lines 334–335):
if (params.use_rustqc && params.skip_markduplicates) {
error("--use_rustqc requires duplicate-marked BAM files. Please remove --skip_markduplicates when using --use_rustqc.")
}
Since the UMI path also skips marking, params.with_umi should be handled here too — otherwise --use_rustqc --with_umi fails at the RUSTQC step with a cryptic tool error instead of a clear pipeline-level message.
Affected versions: 3.26.0 (no validation at all → raw RustQC crash) and current dev (validation present but does not cover with_umi).
Expected behavior
--use_rustqc --with_umi should either be blocked early with a clear message (as --skip_markduplicates now is), or handled so RustQC can run on the deduplicated BAM.
Suggested resolution (deferring to maintainers)
Option A — extend the #1869 validation to also cover the UMI path (consistent with the decision in #1865/#1869):
if (params.use_rustqc && (params.skip_markduplicates || params.with_umi)) {
error("--use_rustqc requires duplicate-marked BAM files, but MarkDuplicates is skipped when " +
"--skip_markduplicates or --with_umi is set. Please disable --use_rustqc for these runs.")
}
Gives UMI users an early, actionable error pointing at --use_rustqc false.
Option B — treat the UMI case as legitimately different and pass --skip-dup-check to RustQC only in the UMI path. Rationale: unlike --skip_markduplicates (where duplicates are physically present but unmarked, so bypassing the check would yield wrong duplication metrics), UMI dedup removes duplicates, so duplication QC is meaningless by design and a skipped/zeroed dup metric is the correct outcome. This keeps RustQC usable (and fast) for UMI runs while still producing all non-duplication metrics (RSeQC, Preseq, Qualimap, featureCounts biotype, SAMtools).
Happy to open a PR for whichever direction you prefer.
Steps to reproduce
nextflow run nf-core/rnaseq -r 3.26.0 \
--input samplesheet.csv \
--aligner star_salmon \
--with_umi \
--use_rustqc \
--fasta ... --gtf ...
System information
- Pipeline version: nf-core/rnaseq 3.26.0 (gap also present on
dev)
- RustQC version: v0.2.1 (
community.wave.seqera.io/library/rustqc:0.2.1)
- Aligner:
star_salmon; UMI dedup tool: UMICollapse (*.umi_dedup.sorted.bam)
- Executor: AWS Batch (Seqera Platform, Fusion)
- Container engine: Docker
Description of the bug
Follow-up to #1865 / PR #1869.
PR #1869 added a validation error for
--use_rustqc+--skip_markduplicates, because RustQC requires duplicate-marked (but not removed) BAMs. The same failure occurs with--with_umi, which the new validation does not cover.When
--with_umi trueis set, UMI-based deduplication (UMICollapse / UMI-tools) physically removes PCR duplicates, and the workflow skips Picard MarkDuplicates regardless ofskip_markduplicates:workflows/rnaseq/main.nf:So with
--use_rustqc --with_umi(and the defaultskip_markduplicates = false), the BAM handed toRUSTQChas zero0x400-flagged reads, and RustQC aborts with the same error as #1865:The validation added in #1869 only checks
skip_markduplicates:subworkflows/local/utils_nfcore_rnaseq_pipeline/main.nf(dev, lines 334–335):Since the UMI path also skips marking,
params.with_umishould be handled here too — otherwise--use_rustqc --with_umifails at theRUSTQCstep with a cryptic tool error instead of a clear pipeline-level message.Affected versions: 3.26.0 (no validation at all → raw RustQC crash) and current
dev(validation present but does not coverwith_umi).Expected behavior
--use_rustqc --with_umishould either be blocked early with a clear message (as--skip_markduplicatesnow is), or handled so RustQC can run on the deduplicated BAM.Suggested resolution (deferring to maintainers)
Option A — extend the #1869 validation to also cover the UMI path (consistent with the decision in #1865/#1869):
Gives UMI users an early, actionable error pointing at
--use_rustqc false.Option B — treat the UMI case as legitimately different and pass
--skip-dup-checkto RustQC only in the UMI path. Rationale: unlike--skip_markduplicates(where duplicates are physically present but unmarked, so bypassing the check would yield wrong duplication metrics), UMI dedup removes duplicates, so duplication QC is meaningless by design and a skipped/zeroed dup metric is the correct outcome. This keeps RustQC usable (and fast) for UMI runs while still producing all non-duplication metrics (RSeQC, Preseq, Qualimap, featureCounts biotype, SAMtools).Happy to open a PR for whichever direction you prefer.
Steps to reproduce
nextflow run nf-core/rnaseq -r 3.26.0 \ --input samplesheet.csv \ --aligner star_salmon \ --with_umi \ --use_rustqc \ --fasta ... --gtf ...System information
dev)community.wave.seqera.io/library/rustqc:0.2.1)star_salmon; UMI dedup tool: UMICollapse (*.umi_dedup.sorted.bam)