Skip to content

Commit a42220f

Browse files
committed
Pass --skip-dup-check to RustQC when --with_umi is set
UMI deduplication (UMICollapse / UMI-tools) physically removes PCR duplicates, so the BAM has no reads flagged 0x400. RustQC's duplicate-marking preflight check then aborts --use_rustqc --with_umi runs. Duplication QC is not applicable to a deduplicated BAM, so pass --skip-dup-check in the UMI path. The --use_rustqc + --skip_markduplicates combination remains blocked in validateInputParameters() (there duplicates are present-but-unmarked, so bypassing would be incorrect). Closes #1881
1 parent 02dfe8b commit a42220f

3 files changed

Lines changed: 58 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
- [PR #1862](https://github.com/nf-core/rnaseq/pull/1862) - Correct the `docs/usage.md` note to state that `--extra_star_align_args` applies to `--aligner star_rsem`, since STAR runs as a standalone step and RSEM quantifies the resulting BAM ([#1857](https://github.com/nf-core/rnaseq/issues/1857))
2525
- [PR #1864](https://github.com/nf-core/rnaseq/pull/1864) - Bump nf-schema to 2.7.2, fixing boolean CLI parameter validation failures under Nextflow 26.x strict syntax ([#1860](https://github.com/nf-core/rnaseq/issues/1860))
2626
- [PR #1869](https://github.com/nf-core/rnaseq/pull/1869) - Add pipeline validation error when `--use_rustqc` and `--skip_markduplicates` are set together, since RustQC requires duplicate-marked BAM files ([#1865](https://github.com/nf-core/rnaseq/issues/1865))
27+
- [PR #1882](https://github.com/nf-core/rnaseq/pull/1882) - Pass `--skip-dup-check` to RustQC when `--with_umi` is set, so `--use_rustqc` works with UMI-deduplicated BAMs: UMICollapse / UMI-tools physically remove PCR duplicates, leaving no reads flagged `0x400`, so duplication QC is not applicable and RustQC's duplicate-marking check would otherwise abort the run ([#1881](https://github.com/nf-core/rnaseq/issues/1881))
2728

2829
## [[3.26.0](https://github.com/nf-core/rnaseq/releases/tag/3.26.0)] - 2026-05-07
2930

conf/modules/rustqc.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ process {
88
biotype_attr ? "--biotype-attribute ${biotype_attr}" : '',
99
'--preseq-seed 1 --preseq-seg-len 100000000',
1010
'--tin-seed 1 --junction-saturation-seed 1',
11+
// UMI dedup (UMICollapse / UMI-tools) physically removes PCR duplicates, so the
12+
// BAM has no reads flagged 0x400 and duplication QC does not apply; bypass RustQC's
13+
// duplicate-marking check. The --use_rustqc + --skip_markduplicates combination is
14+
// instead blocked in validateInputParameters(), because there duplicates are
15+
// present-but-unmarked and bypassing would produce incorrect duplication metrics.
16+
params.with_umi ? '--skip-dup-check' : '',
1117
].join(' ').trim()
1218
}
1319
publishDir = [

tests/rustqc.nf.test

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,57 @@ nextflow_pipeline {
4646
}
4747
}
4848

49+
test("Params: use_rustqc --with_umi") {
50+
51+
when {
52+
params {
53+
outdir = "$outputDir"
54+
use_rustqc = true
55+
with_umi = true
56+
umitools_extract_method = "regex"
57+
umitools_bc_pattern = "^(?P<umi_1>CGA.{8}){s<=2}.*"
58+
umi_dedup_tool = 'umicollapse'
59+
skip_bbsplit = true
60+
// UMI dedup removes PCR duplicates, so RustQC runs with --skip-dup-check;
61+
// this guards that --use_rustqc --with_umi completes instead of aborting.
62+
skip_stringtie = true
63+
skip_bigwig = true
64+
skip_pseudo_alignment = true
65+
}
66+
}
67+
68+
then {
69+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
70+
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
71+
// stable_path: All files in ${params.outdir}/ with stable content
72+
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore_rustqc')
73+
assertAll(
74+
{ assert workflow.success},
75+
{ assert snapshot(
76+
// Number of successful tasks
77+
workflow.trace.succeeded().size(),
78+
// pipeline versions.yml file for multiqc from which Nextflow and pipeline versions are removed (all from the workflow key)
79+
removeFromYamlMap("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml", "Workflow"),
80+
// All stable path name, with a relative path
81+
stable_name,
82+
// All files with stable contents
83+
stable_path
84+
).match() }
85+
)
86+
}
87+
88+
cleanup {
89+
// Only prune/delete on CI - keeping local VM state intact prevents
90+
// cross-test launchDir wipes that break nf-test snapshot walks.
91+
if (System.getenv("CI") == "true") {
92+
if (System.getenv("NFT_PROFILE")?.contains("docker")) {
93+
"docker system prune -a -f --volumes".execute()
94+
}
95+
new File("${launchDir}").deleteDir()
96+
}
97+
}
98+
}
99+
49100
test("Params: use_rustqc - stub") {
50101

51102
options "-stub"

0 commit comments

Comments
 (0)