Skip to content
Draft
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
6 changes: 1 addition & 5 deletions modules/nf-core/gnu/sort/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}

"""
}
3 changes: 3 additions & 0 deletions modules/nf-core/gnu/sort/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
30 changes: 22 additions & 8 deletions modules/nf-core/gnu/sort/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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),
"genome.sorted"
]
"""
}
Expand All @@ -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"
]
"""
}
Expand All @@ -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"
]
"""
}
Expand All @@ -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"
]
"""
}
Expand Down
20 changes: 10 additions & 10 deletions modules/nf-core/gnu/sort/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"id": "test"
},
"test.csv.sorted:md5,0b52d1b4c4a0c6e972c6f94aafd75a1d"
"test.csv.sorted:md5,797450743dae151378fa5b7a9b5f38cc"
]
],
"1": [
Expand All @@ -22,7 +22,7 @@
{
"id": "test"
},
"test.csv.sorted:md5,0b52d1b4c4a0c6e972c6f94aafd75a1d"
"test.csv.sorted:md5,797450743dae151378fa5b7a9b5f38cc"
]
],
"versions_coreutils": [
Expand All @@ -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": [
Expand Down Expand Up @@ -89,7 +89,7 @@
{
"id": "genome_test"
},
"genome_test.bed.sorted:md5,fd97f7efafdbbfa71d9b560f10b4b048"
"genome_test.genome.sorted:md5,fd97f7efafdbbfa71d9b560f10b4b048"
]
],
"1": [
Expand All @@ -104,7 +104,7 @@
{
"id": "genome_test"
},
"genome_test.bed.sorted:md5,fd97f7efafdbbfa71d9b560f10b4b048"
"genome_test.genome.sorted:md5,fd97f7efafdbbfa71d9b560f10b4b048"
]
],
"versions_coreutils": [
Expand All @@ -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": [
Expand Down
5 changes: 5 additions & 0 deletions modules/nf-core/gnu/sort/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: GNU_SORT {
ext.args = params.gnu_sort_args
}
}
6 changes: 0 additions & 6 deletions modules/nf-core/gnu/sort/tests/sort_complex.config

This file was deleted.

6 changes: 0 additions & 6 deletions modules/nf-core/gnu/sort/tests/sort_simple_bed.config

This file was deleted.

6 changes: 0 additions & 6 deletions modules/nf-core/gnu/sort/tests/sort_simple_genome.config

This file was deleted.

3 changes: 2 additions & 1 deletion modules/nf-core/ultra/align/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
"""
}
Expand Down
3 changes: 2 additions & 1 deletion modules/nf-core/ultra/index/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
"""
}
Expand Down