Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Added`

- [#280](https://github.com/nf-core/seqinspector/pull/280) Add validation for missing `--bait_intervals` and `--target_intervals` when `picard_collecthsmetrics` is requested (@maxulysse)
- [#280](https://github.com/nf-core/seqinspector/pull/280) Add validation for missing fasta when picard or riker is requested (@maxulysse)
- [#280](https://github.com/nf-core/seqinspector/pull/280) Add validation for unsupported riker collectors (wgs, gcbias, error, rna) that require interval files not yet supported as pipeline parameters (@maxulysse)

### `Fixed`

### `Changed`
Expand Down
27 changes: 25 additions & 2 deletions subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,14 @@ ${subsampled_info}-\033[2m----------------------------------------------------\0
}
}

// Picard and riker require a reference FASTA for alignment and metrics
if (!(fasta) && (("picard_collecthsmetrics" in tools) || ("picard_collectmultiplemetrics" in tools) || ("riker" in tools))) {
log.warn("No fasta was provided, but picard or riker was requested")
log.warn("BWAMEM2, SAMTOOLS, PICARD and RIKER processes will be skipped")
error("No fasta was provided, but picard or riker was requested. A reference FASTA is required for these tools.")
}

// CollectHsMetrics requires bait and target interval lists
if ('picard_collecthsmetrics' in tools && (!params.bait_intervals || !params.target_intervals)) {
error("picard_collecthsmetrics was requested but --bait_intervals and --target_intervals were not provided. Both are required for CollectHsMetrics.")
}

if ('toulligqc' in tools && 'emulate_amd64' in workflow.profile.tokenize(",")) {
Expand Down Expand Up @@ -238,6 +243,7 @@ workflow PIPELINE_COMPLETION {
def validateInputParameters(tools, riker_args) {
genomeExistsError()
rikerHybcapError(tools, riker_args)
rikerUnsupportedCollectorsError(tools, riker_args)
}

//
Expand Down Expand Up @@ -274,6 +280,23 @@ def rikerHybcapError(tools, riker_args) {
}
}

//
// Exit pipeline if riker collectors requiring interval files are requested
// but the pipeline does not yet support providing those files
//
def rikerUnsupportedCollectorsError(tools, riker_args) {
if ('riker' in tools && riker_args) {
def unsupported = []
if (riker_args.contains('wgs')) unsupported << 'wgs (requires --wgs_intervals)'
if (riker_args.contains('gcbias')) unsupported << 'gcbias (requires --gcbias_exclude_intervals)'
if (riker_args.contains('error')) unsupported << 'error (requires --error_vcf and/or --error_intervals)'
if (riker_args.contains('rna')) unsupported << 'rna (requires --rna_gene_model and/or --rna_ribosomal_intervals)'
if (unsupported) {
error("riker_args contains collectors that require interval files not yet supported as pipeline parameters: ${unsupported.join(', ')}.")
}
}
}

//
// Generate methods description for MultiQC
//
Expand Down
4 changes: 2 additions & 2 deletions tests/no_genome.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ nextflow_pipeline {
params: [
input: pipelines_testdata_base_path + 'seqinspector/samplesheet/1.0/miseq.csv',
genome: null,
tools: 'fastqscreen,picard_collecthsmetrics',
tools: 'fastqscreen',
tools_bundle: null,
],
],
Expand All @@ -20,7 +20,7 @@ nextflow_pipeline {
params: [
input: pipelines_testdata_base_path + 'seqinspector/samplesheet/1.0/miseq.csv',
genome: null,
tools: 'fastqscreen,picard_collecthsmetrics',
tools: 'fastqscreen',
tools_bundle: null,
],
stub: true,
Expand Down
36 changes: 36 additions & 0 deletions tests/no_genome.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
{
"MiSeq data test - no genome with picard - should fail": {
"content": [
[
"pipeline_info"
],
"No stable content",
"No BAM files",
"No warnings",
[
"[ERROR] No fasta was provided, but picard or riker was requested. A reference FASTA is required for these tools."
]
],
"timestamp": "2026-08-20T13:38:47.440297992",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
},
"MiSeq data test - no genome": {
"content": [
6,
Expand Down Expand Up @@ -189,5 +207,23 @@
"nf-test": "0.9.5",
"nextflow": "26.04.4"
}
},
"MiSeq data test - no genome with picard - stub": {
"content": [
[
"pipeline_info"
],
[
"[WARN] WARN: nf-core pipelines do not accept positional arguments. The positional argument `true` has been detected. HINT: A common mistake is to provide multiple values separated by spaces e.g. `-profile test, [CONTAINER]`."
],
[
"[ERROR] No fasta was provided, but picard or riker was requested. A reference FASTA is required for these tools."
]
],
"timestamp": "2026-08-20T13:39:11.195831371",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
}
}
44 changes: 44 additions & 0 deletions tests/tools_picard.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,50 @@ nextflow_pipeline {
],
stub: true,
],
[
name: "NovaSeq6000 data test - picard_collecthsmetrics missing intervals - should fail",
params: [
tools: 'picard_collecthsmetrics',
tools_bundle: null,
],
failure: true,
snapshot_include: 'bait_intervals',
snapshot: 'stdout,stderr',
],
[
name: "NovaSeq6000 data test - picard_collecthsmetrics missing intervals - stub",
params: [
tools: 'picard_collecthsmetrics',
tools_bundle: null,
],
failure: true,
stub: true,
snapshot_include: 'bait_intervals',
snapshot: 'stdout,stderr',
],
[
name: "NovaSeq6000 data test - picard missing fasta - should fail",
params: [
tools: 'picard_collecthsmetrics,picard_collectmultiplemetrics',
tools_bundle: null,
genome: null,
],
failure: true,
snapshot_include: 'fasta',
snapshot: 'stdout,stderr',
],
[
name: "NovaSeq6000 data test - picard missing fasta - stub",
params: [
tools: 'picard_collecthsmetrics,picard_collectmultiplemetrics',
tools_bundle: null,
genome: null,
],
failure: true,
stub: true,
snapshot_include: 'fasta',
snapshot: 'stdout,stderr',
],
]

// Generate tests for each scenario
Expand Down
72 changes: 72 additions & 0 deletions tests/tools_picard.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
{
"NovaSeq6000 data test - picard missing fasta - stub": {
"content": [
[
"pipeline_info"
],
[
"[WARN] WARN: nf-core pipelines do not accept positional arguments. The positional argument `true` has been detected. HINT: A common mistake is to provide multiple values separated by spaces e.g. `-profile test, [CONTAINER]`."
],
[
"[ERROR] No fasta was provided, but picard or riker was requested. A reference FASTA is required for these tools."
]
],
"timestamp": "2026-08-20T13:42:47.524968852",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
},
"NovaSeq6000 data test - picard_collecthsmetrics missing intervals - should fail": {
"content": [
[
"pipeline_info"
],
"No stable content",
"No BAM files",
"No warnings",
[
"[ERROR] picard_collecthsmetrics was requested but --bait_intervals and --target_intervals were not provided. Both are required for CollectHsMetrics."
]
],
"timestamp": "2026-08-20T11:25:23.275081727",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
},
"NovaSeq6000 data test - picard_collecthsmetrics and picard_collectmultiplemetrics": {
"content": [
28,
Expand Down Expand Up @@ -693,5 +729,41 @@
"nf-test": "0.9.5",
"nextflow": "26.04.4"
}
},
"NovaSeq6000 data test - picard missing fasta - should fail": {
"content": [
[
"pipeline_info"
],
"No stable content",
"No BAM files",
"No warnings",
[
"[ERROR] No fasta was provided, but picard or riker was requested. A reference FASTA is required for these tools."
]
],
"timestamp": "2026-08-20T13:42:28.564703052",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
},
"NovaSeq6000 data test - picard_collecthsmetrics missing intervals - stub": {
"content": [
[
"pipeline_info"
],
[
"[WARN] WARN: nf-core pipelines do not accept positional arguments. The positional argument `true` has been detected. HINT: A common mistake is to provide multiple values separated by spaces e.g. `-profile test, [CONTAINER]`."
],
[
"[ERROR] picard_collecthsmetrics was requested but --bait_intervals and --target_intervals were not provided. Both are required for CollectHsMetrics."
]
],
"timestamp": "2026-08-20T11:25:48.76823048",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
}
}
44 changes: 44 additions & 0 deletions tests/tools_riker.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,50 @@ nextflow_pipeline {
snapshot_include: 'hybcap',
snapshot: 'stdout,stderr',
],
[
name: "NovaSeq6000 data test - riker with wgs collector - should fail",
params: [
tools: 'riker',
tools_bundle: null,
riker_args: '--tools wgs',
],
failure: true,
snapshot_include: 'wgs',
snapshot: 'stdout,stderr',
],
[
name: "NovaSeq6000 data test - riker with gcbias collector - should fail",
params: [
tools: 'riker',
tools_bundle: null,
riker_args: '--tools gcbias',
],
failure: true,
snapshot_include: 'gcbias',
snapshot: 'stdout,stderr',
],
[
name: "NovaSeq6000 data test - riker with error collector - should fail",
params: [
tools: 'riker',
tools_bundle: null,
riker_args: '--tools error',
],
failure: true,
snapshot_include: 'error',
snapshot: 'stdout,stderr',
],
[
name: "NovaSeq6000 data test - riker with rna collector - should fail",
params: [
tools: 'riker',
tools_bundle: null,
riker_args: '--tools rna',
],
failure: true,
snapshot_include: 'rna',
snapshot: 'stdout,stderr',
],
]

// Generate tests for each scenario
Expand Down
Loading
Loading