From d29bdc79d0828932bd6bce6a7f3a98a89e8af695 Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Sun, 23 Aug 2026 21:26:46 -0300 Subject: [PATCH 1/2] Migrate ska/distance to topics --- modules/nf-core/ska/distance/main.nf | 12 +--- modules/nf-core/ska/distance/meta.yml | 33 +++++++--- .../nf-core/ska/distance/tests/main.nf.test | 4 +- .../ska/distance/tests/main.nf.test.snap | 64 ++++++++++++------- 4 files changed, 67 insertions(+), 46 deletions(-) diff --git a/modules/nf-core/ska/distance/main.nf b/modules/nf-core/ska/distance/main.nf index e5dc7111abee..2be0df0b42fb 100644 --- a/modules/nf-core/ska/distance/main.nf +++ b/modules/nf-core/ska/distance/main.nf @@ -15,7 +15,7 @@ process SKA_DISTANCE { tuple val(meta), path("*clusters.tsv") , emit: cluster_list , optional: true tuple val(meta), path("*cluster*.txt") , emit: cluster_files, optional: true tuple val(meta), path("*.dot") , emit: dot , optional: true - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('ska'), eval("ska --version | grep Version |& sed '1!d ; s/Version: //'"), emit: versions_ska, topic: versions when: task.ext.when == null || task.ext.when @@ -31,11 +31,6 @@ process SKA_DISTANCE { $arg_list \\ -o ${prefix} \\ $sketch_files - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - ska: \$(ska --version | grep Version |& sed '1!d ; s/Version: //') - END_VERSIONS """ stub: @@ -53,10 +48,5 @@ process SKA_DISTANCE { touch ${prefix}.cluster\${i}.txt done $output_dot - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - ska: \$(ska --version | grep Version |& sed '1!d ; s/Version: //') - END_VERSIONS """ } diff --git a/modules/nf-core/ska/distance/meta.yml b/modules/nf-core/ska/distance/meta.yml index d0ec3b8ca0d7..436ef37fe432 100644 --- a/modules/nf-core/ska/distance/meta.yml +++ b/modules/nf-core/ska/distance/meta.yml @@ -1,4 +1,3 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: "ska_distance" description: Calculate pairwise distances and basic clustering from SKA sketches keywords: @@ -15,7 +14,8 @@ tools: documentation: "https://github.com/simonrharris/SKA/wiki" tool_dev_url: "https://github.com/simonrharris/SKA" doi: "10.1101/453142" - licence: ["MIT"] + licence: + - "MIT" identifier: "" input: @@ -47,7 +47,7 @@ output: description: Pairwise distance table pattern: "*distance.tsv" ontologies: - - edam: "http://edamontology.org/format_3475" + - edam: "http://edamontology.org/format_3475" # TSV cluster_list: - - meta: type: map @@ -82,14 +82,29 @@ output: description: DOT file for visualization pattern: "*.dot" ontologies: [] + versions_ska: + - - ${task.process}: + type: string + description: The name of the process + - ska: + type: string + description: The name of the tool + - "ska --version | grep Version |& sed '1!d ; s/Version: //'": + type: eval + description: The expression to obtain the version of the tool + +topics: versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" + - - ${task.process}: + type: string + description: The name of the process + - ska: + type: string + description: The name of the tool + - "ska --version | grep Version |& sed '1!d ; s/Version: //'": + type: eval + description: The expression to obtain the version of the tool - ontologies: - - edam: http://edamontology.org/format_3750 # YAML authors: - "@itrujnara" maintainers: diff --git a/modules/nf-core/ska/distance/tests/main.nf.test b/modules/nf-core/ska/distance/tests/main.nf.test index 92a1b0afabc6..00d5e778ccd8 100644 --- a/modules/nf-core/ska/distance/tests/main.nf.test +++ b/modules/nf-core/ska/distance/tests/main.nf.test @@ -29,7 +29,7 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.versions, + process.out.versions_ska, path(process.out.distances[0][1]).csv(sep:"\t").rows, path(process.out.cluster_list[0][1]).csv(sep:"\t").rows, process.out.dot @@ -102,7 +102,7 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.versions, + process.out.versions_ska, path(process.out.distances[0][1]).csv(sep:"\t").columnNames.sort(), path(process.out.distances[0][1]).csv(sep:"\t").rows[0].values().sort(), path(process.out.cluster_list[0][1]).csv(sep:"\t").columnNames.sort(), diff --git a/modules/nf-core/ska/distance/tests/main.nf.test.snap b/modules/nf-core/ska/distance/tests/main.nf.test.snap index 6ae77a986265..eeea0edab861 100644 --- a/modules/nf-core/ska/distance/tests/main.nf.test.snap +++ b/modules/nf-core/ska/distance/tests/main.nf.test.snap @@ -37,21 +37,29 @@ "test.dot:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,914078627d4223f14da56bb9dd72a667" + "versions_ska": [ + [ + "SKA_DISTANCE", + "ska", + "1.0" + ] ] } ], + "timestamp": "2026-08-23T21:13:57.031634", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-02-17T13:24:34.498999152" + "nf-test": "0.9.5", + "nextflow": "26.04.1" + } }, "sarscov2 - plasmodium - skf": { "content": [ [ - "versions.yml:md5,914078627d4223f14da56bb9dd72a667" + [ + "SKA_DISTANCE", + "ska", + "1.0" + ] ], [ { @@ -61,7 +69,7 @@ "Matches": 0, "Sample 2": "plasmodium_reduced", "SNPs": 0, - "SNP distance": "-nan", + "SNP distance": "nan", "Mash-like distance": 1 } ], @@ -84,16 +92,20 @@ ] ] ], + "timestamp": "2026-08-23T21:13:47.781661", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-02-17T13:24:29.184171536" + "nf-test": "0.9.5", + "nextflow": "26.04.1" + } }, "sarscov2 - plasmodium - list": { "content": [ [ - "versions.yml:md5,914078627d4223f14da56bb9dd72a667" + [ + "SKA_DISTANCE", + "ska", + "1.0" + ] ], [ "Jaccard Index", @@ -112,7 +124,7 @@ 0, 1, 2740, - "-nan", + "nan", "plasmodium_reduced" ], [ @@ -136,11 +148,11 @@ ] ] ], + "timestamp": "2026-08-23T21:14:09.175944", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-02-17T14:36:59.237532349" + "nf-test": "0.9.5", + "nextflow": "26.04.1" + } }, "sarscov2 - plasmodium - list - stub": { "content": [ @@ -175,15 +187,19 @@ "dot": [ ], - "versions": [ - "versions.yml:md5,914078627d4223f14da56bb9dd72a667" + "versions_ska": [ + [ + "SKA_DISTANCE", + "ska", + "1.0" + ] ] } ], + "timestamp": "2026-08-23T21:14:20.454425", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-02-17T13:25:40.464938435" + "nf-test": "0.9.5", + "nextflow": "26.04.1" + } } } \ No newline at end of file From 391aa149d619285604017e25608659cafa822f55 Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Sun, 23 Aug 2026 21:43:33 -0300 Subject: [PATCH 2/2] Make test pass both on macOS and Linux and different shells --- modules/nf-core/ska/distance/main.nf | 2 +- modules/nf-core/ska/distance/meta.yml | 4 ++-- modules/nf-core/ska/distance/tests/main.nf.test | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/ska/distance/main.nf b/modules/nf-core/ska/distance/main.nf index 2be0df0b42fb..e98b43ffd7e2 100644 --- a/modules/nf-core/ska/distance/main.nf +++ b/modules/nf-core/ska/distance/main.nf @@ -15,7 +15,7 @@ process SKA_DISTANCE { tuple val(meta), path("*clusters.tsv") , emit: cluster_list , optional: true tuple val(meta), path("*cluster*.txt") , emit: cluster_files, optional: true tuple val(meta), path("*.dot") , emit: dot , optional: true - tuple val("${task.process}"), val('ska'), eval("ska --version | grep Version |& sed '1!d ; s/Version: //'"), emit: versions_ska, topic: versions + tuple val("${task.process}"), val('ska'), eval("ska --version | grep Version | sed '1!d ; s/Version: //'"), emit: versions_ska, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/ska/distance/meta.yml b/modules/nf-core/ska/distance/meta.yml index 436ef37fe432..fb6c14d4c497 100644 --- a/modules/nf-core/ska/distance/meta.yml +++ b/modules/nf-core/ska/distance/meta.yml @@ -89,7 +89,7 @@ output: - ska: type: string description: The name of the tool - - "ska --version | grep Version |& sed '1!d ; s/Version: //'": + - "ska --version | grep Version | sed '1!d ; s/Version: //'": type: eval description: The expression to obtain the version of the tool @@ -101,7 +101,7 @@ topics: - ska: type: string description: The name of the tool - - "ska --version | grep Version |& sed '1!d ; s/Version: //'": + - "ska --version | grep Version | sed '1!d ; s/Version: //'": type: eval description: The expression to obtain the version of the tool diff --git a/modules/nf-core/ska/distance/tests/main.nf.test b/modules/nf-core/ska/distance/tests/main.nf.test index 00d5e778ccd8..ca6e66c51146 100644 --- a/modules/nf-core/ska/distance/tests/main.nf.test +++ b/modules/nf-core/ska/distance/tests/main.nf.test @@ -30,7 +30,9 @@ nextflow_process { { assert process.success }, { assert snapshot( process.out.versions_ska, - path(process.out.distances[0][1]).csv(sep:"\t").rows, + path(process.out.distances[0][1]).csv(sep:"\t").rows.collect { row -> + row.collectEntries { k, v -> [(k): (v in ['nan', '-nan'] ? 'nan' : v)] } + }, path(process.out.cluster_list[0][1]).csv(sep:"\t").rows, process.out.dot ).match() } @@ -104,7 +106,7 @@ nextflow_process { { assert snapshot( process.out.versions_ska, path(process.out.distances[0][1]).csv(sep:"\t").columnNames.sort(), - path(process.out.distances[0][1]).csv(sep:"\t").rows[0].values().sort(), + path(process.out.distances[0][1]).csv(sep:"\t").rows[0].values().collect { v -> v in ['nan', '-nan'] ? 'nan' : v }.sort(), path(process.out.cluster_list[0][1]).csv(sep:"\t").columnNames.sort(), path(process.out.cluster_list[0][1]).csv(sep:"\t").columns["ID"].sort(), path(process.out.cluster_list[0][1]).csv(sep:"\t").columns["Cluster__autocolour"].sort(),