From 0767c385e92d7bc6075bf67ba436c26bcb1db7b5 Mon Sep 17 00:00:00 2001 From: Paolo Inglese Date: Fri, 8 May 2026 17:06:22 +0200 Subject: [PATCH 1/3] fix the collision between input and output filename for single read + update test and snapshot --- modules/nf-core/deacon/filter/main.nf | 6 +++-- .../nf-core/deacon/filter/tests/main.nf.test | 8 +++++- .../deacon/filter/tests/main.nf.test.snap | 26 +++++++++---------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/modules/nf-core/deacon/filter/main.nf b/modules/nf-core/deacon/filter/main.nf index 458cdc1682f4..0c4c703ff4de 100644 --- a/modules/nf-core/deacon/filter/main.nf +++ b/modules/nf-core/deacon/filter/main.nf @@ -21,7 +21,9 @@ process DEACON_FILTER { script: def args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" - def read_type = (reads instanceof List) ? "-o ${prefix}_1.fq -O ${prefix}_2.fq" : "> ${prefix}.fq" // deacon's automatic compression does not work + def read_type = (reads instanceof List) \ + ? "-o ${prefix}_1.fq -O ${prefix}_2.fq" \ + : "> ${prefix}_filtered.fq" // deacon's automatic compression does not work """ deacon \\ filter \\ @@ -38,7 +40,7 @@ process DEACON_FILTER { stub: prefix = task.ext.prefix ?: "${meta.id}" """ - echo | gzip > '${prefix}.fq.gz' + echo | gzip > '${prefix}_filtered.fq.gz' touch ${prefix}.json """ } diff --git a/modules/nf-core/deacon/filter/tests/main.nf.test b/modules/nf-core/deacon/filter/tests/main.nf.test index 4c0d578ca05a..3b97a3a919e6 100644 --- a/modules/nf-core/deacon/filter/tests/main.nf.test +++ b/modules/nf-core/deacon/filter/tests/main.nf.test @@ -47,7 +47,13 @@ nextflow_process { file(process.out.log[0][1]).name, process.out.fastq_filtered, process.out.findAll { key, val -> key.startsWith("versions") } - ).match()} + ).match()}, + // Verify filtering actually occurred + { + def log = new org.yaml.snakeyaml.Yaml().load(file(process.out.log[0][1]).text) + assert log.seqs_in > 0 : "No reads were processed" + assert log.seqs_out < log.seqs_in : "No reads were filtered out" + } ) } diff --git a/modules/nf-core/deacon/filter/tests/main.nf.test.snap b/modules/nf-core/deacon/filter/tests/main.nf.test.snap index cee59ba851a8..86cc6f0fdc22 100644 --- a/modules/nf-core/deacon/filter/tests/main.nf.test.snap +++ b/modules/nf-core/deacon/filter/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": true }, - "test.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test_filtered.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "1": [ @@ -33,7 +33,7 @@ "id": "test", "single_end": true }, - "test.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test_filtered.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "log": [ @@ -63,11 +63,11 @@ ] } ], + "timestamp": "2026-05-08T17:05:16.309545681", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-02-12T12:46:45.282375511" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } }, "sarscov2 - fastq - paired-end": { "content": [ @@ -94,11 +94,11 @@ ] } ], + "timestamp": "2026-02-12T12:46:37.539497096", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.2" - }, - "timestamp": "2026-02-12T12:46:37.539497096" + } }, "sarscov2 - fastq - single-end": { "content": [ @@ -109,7 +109,7 @@ "id": "test", "single_end": true }, - "test.fq.gz:md5,2250e99ec61fca0e28e2dcb5124d1a16" + "test_filtered.fq.gz:md5,2250e99ec61fca0e28e2dcb5124d1a16" ] ], { @@ -122,10 +122,10 @@ ] } ], + "timestamp": "2026-05-08T17:05:03.651787906", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-02-12T12:46:29.822244006" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } } } \ No newline at end of file From fe0eed2a9562b04730d6a83320d0cbb711076454 Mon Sep 17 00:00:00 2001 From: Paolo Inglese Date: Fri, 8 May 2026 17:26:09 +0200 Subject: [PATCH 2/3] update subworkflow snapshot --- .../tests/main.nf.test.snap | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/subworkflows/nf-core/fastq_index_filter_deacon/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_index_filter_deacon/tests/main.nf.test.snap index 3ebf4eb7742f..eb1d6efb983b 100644 --- a/subworkflows/nf-core/fastq_index_filter_deacon/tests/main.nf.test.snap +++ b/subworkflows/nf-core/fastq_index_filter_deacon/tests/main.nf.test.snap @@ -17,7 +17,7 @@ "id": "test", "single_end": true }, - "test.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test_filtered.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "2": [ @@ -35,7 +35,7 @@ "id": "test", "single_end": true }, - "test.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test_filtered.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "index": [ @@ -58,11 +58,11 @@ ] } ], + "timestamp": "2026-05-08T17:25:52.471176968", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-02-13T09:19:12.052209052" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } }, "sarscov2 - fastq - paired-end": { "content": [ @@ -89,11 +89,11 @@ ], "test.json" ], + "timestamp": "2026-02-13T09:19:03.559444963", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.2" - }, - "timestamp": "2026-02-13T09:19:03.559444963" + } }, "sarscov2 - fastq - single-end": { "content": [ @@ -112,15 +112,15 @@ "id": "test", "single_end": true }, - "test.fq.gz:md5,2250e99ec61fca0e28e2dcb5124d1a16" + "test_filtered.fq.gz:md5,2250e99ec61fca0e28e2dcb5124d1a16" ] ], "test.json" ], + "timestamp": "2026-05-08T17:25:40.536083529", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-02-13T09:18:55.835377502" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } } } \ No newline at end of file From 955c56b402e5266cb82334aea591a9af402cfaa0 Mon Sep 17 00:00:00 2001 From: Paolo Inglese Date: Fri, 8 May 2026 18:43:36 +0200 Subject: [PATCH 3/3] raise error if naming collision + update snapshots --- modules/nf-core/deacon/filter/main.nf | 7 +++---- modules/nf-core/deacon/filter/tests/main.nf.test.snap | 10 +++++----- .../fastq_index_filter_deacon/tests/main.nf.test.snap | 10 +++++----- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/modules/nf-core/deacon/filter/main.nf b/modules/nf-core/deacon/filter/main.nf index 0c4c703ff4de..b81ea1bcd5ad 100644 --- a/modules/nf-core/deacon/filter/main.nf +++ b/modules/nf-core/deacon/filter/main.nf @@ -21,9 +21,8 @@ process DEACON_FILTER { script: def args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" - def read_type = (reads instanceof List) \ - ? "-o ${prefix}_1.fq -O ${prefix}_2.fq" \ - : "> ${prefix}_filtered.fq" // deacon's automatic compression does not work + def read_type = (reads instanceof List) ? "-o ${prefix}_1.fq -O ${prefix}_2.fq" : "> ${prefix}.fq" // deacon's automatic compression does not work + if (!(reads instanceof List) && reads.name == "${prefix}.fq.gz") error "Input and output names are the same, set prefix in module configuration to disambiguate!" """ deacon \\ filter \\ @@ -40,7 +39,7 @@ process DEACON_FILTER { stub: prefix = task.ext.prefix ?: "${meta.id}" """ - echo | gzip > '${prefix}_filtered.fq.gz' + echo | gzip > '${prefix}.fq.gz' touch ${prefix}.json """ } diff --git a/modules/nf-core/deacon/filter/tests/main.nf.test.snap b/modules/nf-core/deacon/filter/tests/main.nf.test.snap index 86cc6f0fdc22..4b38fe402b81 100644 --- a/modules/nf-core/deacon/filter/tests/main.nf.test.snap +++ b/modules/nf-core/deacon/filter/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": true }, - "test_filtered.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "1": [ @@ -33,7 +33,7 @@ "id": "test", "single_end": true }, - "test_filtered.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "log": [ @@ -63,7 +63,7 @@ ] } ], - "timestamp": "2026-05-08T17:05:16.309545681", + "timestamp": "2026-05-08T18:41:01.264123579", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -109,7 +109,7 @@ "id": "test", "single_end": true }, - "test_filtered.fq.gz:md5,2250e99ec61fca0e28e2dcb5124d1a16" + "test.fq.gz:md5,2250e99ec61fca0e28e2dcb5124d1a16" ] ], { @@ -122,7 +122,7 @@ ] } ], - "timestamp": "2026-05-08T17:05:03.651787906", + "timestamp": "2026-05-08T18:40:47.77635866", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" diff --git a/subworkflows/nf-core/fastq_index_filter_deacon/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_index_filter_deacon/tests/main.nf.test.snap index eb1d6efb983b..4dc31a93e818 100644 --- a/subworkflows/nf-core/fastq_index_filter_deacon/tests/main.nf.test.snap +++ b/subworkflows/nf-core/fastq_index_filter_deacon/tests/main.nf.test.snap @@ -17,7 +17,7 @@ "id": "test", "single_end": true }, - "test_filtered.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "2": [ @@ -35,7 +35,7 @@ "id": "test", "single_end": true }, - "test_filtered.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "index": [ @@ -58,7 +58,7 @@ ] } ], - "timestamp": "2026-05-08T17:25:52.471176968", + "timestamp": "2026-05-08T18:43:04.833973809", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -112,12 +112,12 @@ "id": "test", "single_end": true }, - "test_filtered.fq.gz:md5,2250e99ec61fca0e28e2dcb5124d1a16" + "test.fq.gz:md5,2250e99ec61fca0e28e2dcb5124d1a16" ] ], "test.json" ], - "timestamp": "2026-05-08T17:25:40.536083529", + "timestamp": "2026-05-08T18:42:51.063826149", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0"