From 56668083fecdb2c8e5e5d7d56dedea008cdec99f Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 27 Mar 2026 15:49:51 +0100 Subject: [PATCH 1/4] Move ext.suffix to input --- modules/nf-core/gnu/sort/main.nf | 6 +----- modules/nf-core/gnu/sort/meta.yml | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/gnu/sort/main.nf b/modules/nf-core/gnu/sort/main.nf index a16f62919733..6a9353b7b3a8 100644 --- a/modules/nf-core/gnu/sort/main.nf +++ b/modules/nf-core/gnu/sort/main.nf @@ -8,7 +8,7 @@ process GNU_SORT { 'biocontainers/coreutils:9.5' }" input: - tuple val(meta), path(input) + tuple val(meta), path(input), val(suffix) output: tuple val(meta), path( "${output_file}" ) , emit: sorted @@ -20,21 +20,17 @@ process GNU_SORT { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - suffix = task.ext.suffix ?: "${input.extension}" output_file = "${prefix}.${suffix}" if ("$input" == "$output_file") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ sort ${args} ${input} > ${output_file} - """ stub: def prefix = task.ext.prefix ?: "${meta.id}" - suffix = task.ext.suffix ?: "${input.extension}" output_file = "${prefix}.${suffix}" if ("$input" == "$output_file") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" """ touch ${output_file} - """ } diff --git a/modules/nf-core/gnu/sort/meta.yml b/modules/nf-core/gnu/sort/meta.yml index 48dde4a0341f..0f07bdeae90e 100644 --- a/modules/nf-core/gnu/sort/meta.yml +++ b/modules/nf-core/gnu/sort/meta.yml @@ -28,6 +28,9 @@ input: description: Draft assembly file pattern: "*.{txt,bed,interval,genome,bins}" ontologies: [] + - suffix: + type: string + description: Output suffix output: sorted: - - meta: From 76ed3c09f4c9f3aa4f895f7e5a0cce9b121ea5a9 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 27 Mar 2026 16:12:44 +0100 Subject: [PATCH 2/4] Update tests to unify config --- modules/nf-core/gnu/sort/tests/main.nf.test | 30 ++++++++++++++----- .../nf-core/gnu/sort/tests/nextflow.config | 5 ++++ .../gnu/sort/tests/sort_complex.config | 6 ---- .../gnu/sort/tests/sort_simple_bed.config | 6 ---- .../gnu/sort/tests/sort_simple_genome.config | 6 ---- 5 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 modules/nf-core/gnu/sort/tests/nextflow.config delete mode 100644 modules/nf-core/gnu/sort/tests/sort_complex.config delete mode 100644 modules/nf-core/gnu/sort/tests/sort_simple_bed.config delete mode 100644 modules/nf-core/gnu/sort/tests/sort_simple_genome.config diff --git a/modules/nf-core/gnu/sort/tests/main.nf.test b/modules/nf-core/gnu/sort/tests/main.nf.test index 9aef3daf12bc..dc913a7e5dc6 100644 --- a/modules/nf-core/gnu/sort/tests/main.nf.test +++ b/modules/nf-core/gnu/sort/tests/main.nf.test @@ -10,14 +10,17 @@ nextflow_process { tag "gnu/sort" test("unsorted_genome_sort") { - config "./sort_simple_bed.config" when { + params { + gnu_sort_args = "-k1,1 -k2,2n" + } process { """ input[0] = [ [id:'genome_test'], - file(params.modules_testdata_base_path + 'generic/unsorted_data/unsorted_text/test.genome', checkIfExists: true) + file(params.modules_testdata_base_path + 'generic/unsorted_data/unsorted_text/test.genome', checkIfExists: true), + "bed.sorted" ] """ } @@ -33,13 +36,17 @@ nextflow_process { } test("unsorted_intervals_sort") { - config "./sort_simple_bed.config" + when { + params { + gnu_sort_args = "-k1,1 -k2,2n" + } process { """ input[0] = [ [id:'test'], - file(params.modules_testdata_base_path + 'generic/unsorted_data/unsorted_text/test.bed', checkIfExists: true) + file(params.modules_testdata_base_path + 'generic/unsorted_data/unsorted_text/test.bed', checkIfExists: true), + "bed.sorted" ] """ } @@ -55,14 +62,17 @@ nextflow_process { } test("unsorted_csv_sort") { - config "./sort_complex.config" when { + params { + gnu_sort_args = "-t ';' -g -k 1,1 -k 2,2" + } process { """ input[0] = [ [id:'test'], - file(params.modules_testdata_base_path + 'generic/unsorted_data/unsorted_text/test.csv', checkIfExists: true) + file(params.modules_testdata_base_path + 'generic/unsorted_data/unsorted_text/test.csv', checkIfExists: true), + "csv.sorted" ] """ } @@ -78,15 +88,19 @@ nextflow_process { } test("unsorted_csv_sort_stub") { - config "./sort_complex.config" + options "-stub" when { + params { + gnu_sort_args = "-t ';' -g -k 1,1 -k 2,2" + } process { """ input[0] = [ [id:'test'], - file(params.modules_testdata_base_path + 'generic/unsorted_data/unsorted_text/test.csv', checkIfExists: true) + file(params.modules_testdata_base_path + 'generic/unsorted_data/unsorted_text/test.csv', checkIfExists: true), + "csv.sorted" ] """ } diff --git a/modules/nf-core/gnu/sort/tests/nextflow.config b/modules/nf-core/gnu/sort/tests/nextflow.config new file mode 100644 index 000000000000..2d6d3ed2776c --- /dev/null +++ b/modules/nf-core/gnu/sort/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: GNU_SORT { + ext.args = params.gnu_sort_args + } +} diff --git a/modules/nf-core/gnu/sort/tests/sort_complex.config b/modules/nf-core/gnu/sort/tests/sort_complex.config deleted file mode 100644 index ce4f151857d9..000000000000 --- a/modules/nf-core/gnu/sort/tests/sort_complex.config +++ /dev/null @@ -1,6 +0,0 @@ -process { - withName: GNU_SORT { - ext.args = { "-t ';' -g -k 1,1 -k 2,2" } - ext.suffix = { "csv.sorted" } - } -} diff --git a/modules/nf-core/gnu/sort/tests/sort_simple_bed.config b/modules/nf-core/gnu/sort/tests/sort_simple_bed.config deleted file mode 100644 index 8496c8d764de..000000000000 --- a/modules/nf-core/gnu/sort/tests/sort_simple_bed.config +++ /dev/null @@ -1,6 +0,0 @@ -process { - withName: GNU_SORT { - ext.args = { "-k1,1 -k2,2n" } - ext.suffix = { "bed.sorted" } - } -} diff --git a/modules/nf-core/gnu/sort/tests/sort_simple_genome.config b/modules/nf-core/gnu/sort/tests/sort_simple_genome.config deleted file mode 100644 index c408ece1f1be..000000000000 --- a/modules/nf-core/gnu/sort/tests/sort_simple_genome.config +++ /dev/null @@ -1,6 +0,0 @@ -process { - withName: GNU_SORT { - ext.args = { "-k1,1 -k2,2n" } - ext.suffix = { "genome.sorted" } - } -} From 49e9a301de6625283e7f2b7d262e663bfa24b5a3 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Fri, 27 Mar 2026 16:30:27 +0100 Subject: [PATCH 3/4] Update test to use corrected input --- modules/nf-core/gnu/sort/tests/main.nf.test | 2 +- .../nf-core/gnu/sort/tests/main.nf.test.snap | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/nf-core/gnu/sort/tests/main.nf.test b/modules/nf-core/gnu/sort/tests/main.nf.test index dc913a7e5dc6..738a1f9b1cbf 100644 --- a/modules/nf-core/gnu/sort/tests/main.nf.test +++ b/modules/nf-core/gnu/sort/tests/main.nf.test @@ -20,7 +20,7 @@ nextflow_process { input[0] = [ [id:'genome_test'], file(params.modules_testdata_base_path + 'generic/unsorted_data/unsorted_text/test.genome', checkIfExists: true), - "bed.sorted" + "genome.sorted" ] """ } diff --git a/modules/nf-core/gnu/sort/tests/main.nf.test.snap b/modules/nf-core/gnu/sort/tests/main.nf.test.snap index f57dc6bbab55..1929dd24f2a4 100644 --- a/modules/nf-core/gnu/sort/tests/main.nf.test.snap +++ b/modules/nf-core/gnu/sort/tests/main.nf.test.snap @@ -7,7 +7,7 @@ { "id": "test" }, - "test.csv.sorted:md5,0b52d1b4c4a0c6e972c6f94aafd75a1d" + "test.csv.sorted:md5,797450743dae151378fa5b7a9b5f38cc" ] ], "1": [ @@ -22,7 +22,7 @@ { "id": "test" }, - "test.csv.sorted:md5,0b52d1b4c4a0c6e972c6f94aafd75a1d" + "test.csv.sorted:md5,797450743dae151378fa5b7a9b5f38cc" ] ], "versions_coreutils": [ @@ -35,10 +35,10 @@ } ], "meta": { - "nf-test": "0.9.3", - "nextflow": "25.04.8" + "nf-test": "0.9.2", + "nextflow": "25.10.4" }, - "timestamp": "2026-01-23T15:48:28.77537237" + "timestamp": "2026-03-27T16:25:51.135939" }, "unsorted_csv_sort_stub": { "content": [ @@ -89,7 +89,7 @@ { "id": "genome_test" }, - "genome_test.bed.sorted:md5,fd97f7efafdbbfa71d9b560f10b4b048" + "genome_test.genome.sorted:md5,fd97f7efafdbbfa71d9b560f10b4b048" ] ], "1": [ @@ -104,7 +104,7 @@ { "id": "genome_test" }, - "genome_test.bed.sorted:md5,fd97f7efafdbbfa71d9b560f10b4b048" + "genome_test.genome.sorted:md5,fd97f7efafdbbfa71d9b560f10b4b048" ] ], "versions_coreutils": [ @@ -117,10 +117,10 @@ } ], "meta": { - "nf-test": "0.9.3", - "nextflow": "25.04.8" + "nf-test": "0.9.2", + "nextflow": "25.10.4" }, - "timestamp": "2026-01-23T15:47:54.290932481" + "timestamp": "2026-03-27T16:25:43.198666" }, "unsorted_intervals_sort": { "content": [ From f4d5224f9d9f18b5e6a48aa4c85f51694d9af14e Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Mon, 30 Mar 2026 10:01:31 +0200 Subject: [PATCH 4/4] Add suffix to GNU SORT input --- modules/nf-core/ultra/align/tests/main.nf.test | 3 ++- modules/nf-core/ultra/index/tests/main.nf.test | 3 ++- modules/nf-core/ultra/pipeline/tests/main.nf.test | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/ultra/align/tests/main.nf.test b/modules/nf-core/ultra/align/tests/main.nf.test index 57d97045b175..c677591c20c0 100644 --- a/modules/nf-core/ultra/align/tests/main.nf.test +++ b/modules/nf-core/ultra/align/tests/main.nf.test @@ -34,7 +34,8 @@ nextflow_process { """ input[0] = [ [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists:true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists:true), + "gtf" ] """ } diff --git a/modules/nf-core/ultra/index/tests/main.nf.test b/modules/nf-core/ultra/index/tests/main.nf.test index c4799464e8cd..e5f18fbb3fd8 100644 --- a/modules/nf-core/ultra/index/tests/main.nf.test +++ b/modules/nf-core/ultra/index/tests/main.nf.test @@ -20,7 +20,8 @@ nextflow_process { """ input[0] = [ [id:'test'], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists:true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists:true), + "gtf" ] """ } diff --git a/modules/nf-core/ultra/pipeline/tests/main.nf.test b/modules/nf-core/ultra/pipeline/tests/main.nf.test index 869a0df0c312..62eedd17e3ea 100644 --- a/modules/nf-core/ultra/pipeline/tests/main.nf.test +++ b/modules/nf-core/ultra/pipeline/tests/main.nf.test @@ -35,7 +35,8 @@ nextflow_process { """ input[0] = [ [id:'gtf'], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists:true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.gtf', checkIfExists:true), + "gtf" ] """ }