From aceaa254fbce64f60e2c157c5c78d1cada2e804e Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Tue, 4 Aug 2026 16:15:21 +0200 Subject: [PATCH 1/2] Update to topic --- modules/nf-core/phispy/main.nf | 43 ++- modules/nf-core/phispy/meta.yml | 32 ++- modules/nf-core/phispy/tests/main.nf.test | 22 +- .../nf-core/phispy/tests/main.nf.test.snap | 254 +++++++++++------- 4 files changed, 206 insertions(+), 145 deletions(-) diff --git a/modules/nf-core/phispy/main.nf b/modules/nf-core/phispy/main.nf index 8b4c149c6160..adfa871b1b72 100644 --- a/modules/nf-core/phispy/main.nf +++ b/modules/nf-core/phispy/main.nf @@ -14,15 +14,15 @@ process PHISPY { tuple val(meta), path("${prefix}.tsv") , emit: coordinates tuple val(meta), path("${prefix}.gb*") , emit: gbk tuple val(meta), path("${prefix}.log") , emit: log - tuple val(meta), path("${prefix}_prophage_information.tsv"), optional:true, emit: information - tuple val(meta), path("${prefix}_bacteria.fasta") , optional:true, emit: bacteria_fasta - tuple val(meta), path("${prefix}_bacteria.gbk") , optional:true, emit: bacteria_gbk - tuple val(meta), path("${prefix}_phage.fasta") , optional:true, emit: phage_fasta - tuple val(meta), path("${prefix}_phage.gbk") , optional:true, emit: phage_gbk - tuple val(meta), path("${prefix}_prophage.gff3") , optional:true, emit: prophage_gff - tuple val(meta), path("${prefix}_prophage.tbl") , optional:true, emit: prophage_tbl - tuple val(meta), path("${prefix}_prophage.tsv") , optional:true, emit: prophage_tsv - path "versions.yml" , emit: versions + tuple val(meta), path("${prefix}_prophage_information.tsv"), emit: information , optional:true + tuple val(meta), path("${prefix}_bacteria.fasta") , emit: bacteria_fasta, optional:true + tuple val(meta), path("${prefix}_bacteria.gbk") , emit: bacteria_gbk , optional:true + tuple val(meta), path("${prefix}_phage.fasta") , emit: phage_fasta , optional:true + tuple val(meta), path("${prefix}_phage.gbk") , emit: phage_gbk , optional:true + tuple val(meta), path("${prefix}_prophage.gff3") , emit: prophage_gff , optional:true + tuple val(meta), path("${prefix}_prophage.tbl") , emit: prophage_tbl , optional:true + tuple val(meta), path("${prefix}_prophage.tsv") , emit: prophage_tsv , optional:true + tuple val("${task.process}"), val('phispy'), eval('PhiSpy.py --version 2>&1'), topic: versions, emit: versions_phispy when: task.ext.when == null || task.ext.when @@ -33,35 +33,31 @@ process PHISPY { // Extract GBK file extension, i.e. .gbff, .gbk.gz gbk_extension = gbk.getName() - gbk.getSimpleName() - if ("$gbk" == "${prefix}${gbk_extension}") error "Input and output names are the same, set prefix in module configuration to disambiguate!" + if ("${gbk}" == "${prefix}${gbk_extension}") error "Input and output names are the same, set prefix in module configuration to disambiguate!" """ PhiSpy.py \\ - $args \\ - --threads $task.cpus \\ - -p $prefix \\ + ${args} \\ + --threads ${task.cpus} \\ + -p ${prefix} \\ -o . \\ - $gbk + ${gbk} mv ${prefix}_prophage_coordinates.tsv ${prefix}.tsv mv ${prefix}_${gbk} ${prefix}${gbk_extension} mv ${prefix}_phispy.log ${prefix}.log - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - PhiSpy: \$(echo \$(PhiSpy.py --version 2>&1)) - END_VERSIONS """ stub: prefix = task.ext.prefix ?: "${meta.id}" gbk_extension = gbk.getName() - gbk.getSimpleName() + gbl_create_cmd = gbk_extension.endsWith(".gz") ? 'echo "" | gzip >' : "touch" - if ("$gbk" == "${prefix}${gbk_extension}") error "Input and output names are the same, set prefix in module configuration to disambiguate!" + if ("${gbk}" == "${prefix}${gbk_extension}") error "Input and output names are the same, set prefix in module configuration to disambiguate!" """ touch ${prefix}.tsv - touch ${prefix}${gbk_extension} + ${gbl_create_cmd} ${prefix}${gbk_extension} touch ${prefix}.log touch ${prefix}_prophage_information.tsv touch ${prefix}_bacteria.fasta @@ -71,10 +67,5 @@ process PHISPY { touch ${prefix}_prophage.gff3 touch ${prefix}_prophage.tbl touch ${prefix}_prophage.tsv - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - PhiSpy: \$(echo \$(PhiSpy.py --version 2>&1)) - END_VERSIONS """ } diff --git a/modules/nf-core/phispy/meta.yml b/modules/nf-core/phispy/meta.yml index ad8873729c1b..9d8b73c70936 100644 --- a/modules/nf-core/phispy/meta.yml +++ b/modules/nf-core/phispy/meta.yml @@ -1,4 +1,3 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json name: "phispy" description: Predict prophages in bacterial genomes keywords: @@ -15,7 +14,8 @@ tools: documentation: "https://github.com/linsalrob/PhiSpy/blob/master/README.md" tool_dev_url: "https://github.com/linsalrob/PhiSpy/" doi: "10.1093/nar/gks406" - licence: ["MIT"] + licence: + - "MIT" identifier: "" input: - - meta: @@ -163,13 +163,29 @@ output: pattern: "*.{tsv}" ontologies: - edam: http://edamontology.org/format_3475 # TSV + versions_phispy: + - - ${task.process}: + type: string + description: The name of the process + - phispy: + type: string + description: The name of the tool + - PhiSpy.py --version 2>&1: + 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" - ontologies: - - edam: http://edamontology.org/format_3750 # YAML + - - ${task.process}: + type: string + description: The name of the process + - phispy: + type: string + description: The name of the tool + - PhiSpy.py --version 2>&1: + type: eval + description: The expression to obtain the version of the tool + authors: - "@jvfe" maintainers: diff --git a/modules/nf-core/phispy/tests/main.nf.test b/modules/nf-core/phispy/tests/main.nf.test index 0a33eb9e9ae2..cd4cf4bd9822 100644 --- a/modules/nf-core/phispy/tests/main.nf.test +++ b/modules/nf-core/phispy/tests/main.nf.test @@ -15,7 +15,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test' ], // meta map + [ id:'test' ], file( params.modules_testdata_base_path + "/genomics/prokaryotes/bacteroides_fragilis/genome/genome.gbff.gz", checkIfExists: true ) ] """ @@ -40,7 +40,7 @@ nextflow_process { } }, { assert path(process.out.gbk[0][1]).linesGzip.toString().contains('5150703 bp') }, - { assert snapshot(process.out.versions).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } @@ -54,7 +54,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test' ], // meta map + [ id:'test' ], file( params.modules_testdata_base_path + "/genomics/prokaryotes/bacteroides_fragilis/genome/genome.gbff.gz", checkIfExists: true ) ] """ @@ -64,21 +64,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert path(process.out.gbk[0][1]).exists() }, - { assert snapshot( - process.out.coordinates, - process.out.log, - process.out.information, - process.out.bacteria_fasta, - process.out.bacteria_gbk, - process.out.phage_fasta, - process.out.phage_gbk, - process.out.prophage_gff, - process.out.prophage_tbl, - process.out.prophage_tsv, - process.out.versions - ).match() - } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } diff --git a/modules/nf-core/phispy/tests/main.nf.test.snap b/modules/nf-core/phispy/tests/main.nf.test.snap index 241673a78393..1a9d4a4b9ea3 100644 --- a/modules/nf-core/phispy/tests/main.nf.test.snap +++ b/modules/nf-core/phispy/tests/main.nf.test.snap @@ -1,106 +1,174 @@ { "bacteroides_fragilis - gbff - stub": { "content": [ - [ - [ - { - "id": "test" - }, - "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + { + "bacteria_fasta": [ + [ + { + "id": "test" + }, + "test_bacteria.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "bacteria_gbk": [ + [ + { + "id": "test" + }, + "test_bacteria.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "coordinates": [ + [ + { + "id": "test" + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gbk": [ + [ + { + "id": "test" + }, + "test.gbff.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "information": [ + [ + { + "id": "test" + }, + "test_prophage_information.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test" + }, + "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "phage_fasta": [ + [ + { + "id": "test" + }, + "test_phage.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "phage_gbk": [ + [ + { + "id": "test" + }, + "test_phage.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "prophage_gff": [ + [ + { + "id": "test" + }, + "test_prophage.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "prophage_tbl": [ + [ + { + "id": "test" + }, + "test_prophage.tbl:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "prophage_tsv": [ + [ + { + "id": "test" + }, + "test_prophage.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_phispy": [ + [ + "PHISPY", + "phispy", + "4.2.21" + ] ] - ], - [ - [ - { - "id": "test" - }, - "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - [ - { - "id": "test" - }, - "test_prophage_information.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - [ - { - "id": "test" - }, - "test_bacteria.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - [ - { - "id": "test" - }, - "test_bacteria.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - [ - { - "id": "test" - }, - "test_phage.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - [ - { - "id": "test" - }, - "test_phage.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - [ - { - "id": "test" - }, - "test_prophage.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - [ - { - "id": "test" - }, - "test_prophage.tbl:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - [ - { - "id": "test" - }, - "test_prophage.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - "versions.yml:md5,d26f11b7160b164c45b7e1acc4c667b6" - ] + } ], + "timestamp": "2026-08-04T16:09:52.332024442", "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-28T13:49:58.354473222" + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } }, "bacteroides_fragilis - gbff": { "content": [ - [ - "versions.yml:md5,d26f11b7160b164c45b7e1acc4c667b6" - ] + { + "bacteria_fasta": [ + + ], + "bacteria_gbk": [ + + ], + "coordinates": [ + [ + { + "id": "test" + }, + "test.tsv:md5,0f7237b975b7bec6346b752d78b83514" + ] + ], + "gbk": [ + [ + { + "id": "test" + }, + "test.gbff.gz:md5,60c00ebd6bfc6ec7e173349ead19cb67" + ] + ], + "information": [ + + ], + "log": [ + [ + { + "id": "test" + }, + "test.log:md5,44de8ec88f4a1781c3098a7d93cfd39e" + ] + ], + "phage_fasta": [ + + ], + "phage_gbk": [ + + ], + "prophage_gff": [ + + ], + "prophage_tbl": [ + + ], + "prophage_tsv": [ + + ], + "versions_phispy": [ + [ + "PHISPY", + "phispy", + "4.2.21" + ] + ] + } ], + "timestamp": "2026-08-04T16:09:43.540711549", "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-19T14:34:56.397801796" + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } } } \ No newline at end of file From 81d6424ae2b5480844c9a4f0b4ae50cd62f2197a Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Tue, 4 Aug 2026 16:44:38 +0200 Subject: [PATCH 2/2] Fix test and environment --- modules/nf-core/phispy/environment.yml | 2 ++ modules/nf-core/phispy/tests/main.nf.test | 28 ++++++++----------- .../nf-core/phispy/tests/main.nf.test.snap | 8 +++--- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/modules/nf-core/phispy/environment.yml b/modules/nf-core/phispy/environment.yml index 77012cbd38b0..1955dfde2ce9 100644 --- a/modules/nf-core/phispy/environment.yml +++ b/modules/nf-core/phispy/environment.yml @@ -6,3 +6,5 @@ channels: dependencies: - bioconda::phispy=4.2.21 - conda-forge::biopython=1.81 + - conda-forge::python=3.10.5 + - conda-forge::setuptools=63.3.0 diff --git a/modules/nf-core/phispy/tests/main.nf.test b/modules/nf-core/phispy/tests/main.nf.test index cd4cf4bd9822..0c12efdcc05e 100644 --- a/modules/nf-core/phispy/tests/main.nf.test +++ b/modules/nf-core/phispy/tests/main.nf.test @@ -25,25 +25,20 @@ nextflow_process { then { assertAll( { assert process.success }, - { - with(process.out.log[0]) { - assert path(get(1)).text.contains('NZ_CP069563.1') - assert path(get(1)).text.contains('91') - assert path(get(1)).text.contains('Kept') - } - }, - { - with(process.out.coordinates[0]) { - assert path(get(1)).text.contains('NZ_CP069563.1') - assert path(get(1)).text.contains('pp1') - assert path(get(1)).text.contains('Longest Repeat flanking phage and within 2000 bp') - } - }, + { with(process.out.log[0]) { + assert path(get(1)).text.contains('NZ_CP069563.1') + assert path(get(1)).text.contains('91') + assert path(get(1)).text.contains('Kept') + }}, + { with(process.out.coordinates[0]) { + assert path(get(1)).text.contains('NZ_CP069563.1') + assert path(get(1)).text.contains('pp1') + assert path(get(1)).text.contains('Longest Repeat flanking phage and within 2000 bp') + }}, { assert path(process.out.gbk[0][1]).linesGzip.toString().contains('5150703 bp') }, - { assert snapshot(sanitizeOutput(process.out)).match() } + { assert snapshot(sanitizeOutput(process.out, unstableKeys:["log", "coordinates", "gbk"])).match() } ) } - } test("bacteroides_fragilis - gbff - stub") { @@ -67,7 +62,6 @@ nextflow_process { { assert snapshot(sanitizeOutput(process.out)).match() } ) } - } } diff --git a/modules/nf-core/phispy/tests/main.nf.test.snap b/modules/nf-core/phispy/tests/main.nf.test.snap index 1a9d4a4b9ea3..945c6e823371 100644 --- a/modules/nf-core/phispy/tests/main.nf.test.snap +++ b/modules/nf-core/phispy/tests/main.nf.test.snap @@ -119,7 +119,7 @@ { "id": "test" }, - "test.tsv:md5,0f7237b975b7bec6346b752d78b83514" + "test.tsv" ] ], "gbk": [ @@ -127,7 +127,7 @@ { "id": "test" }, - "test.gbff.gz:md5,60c00ebd6bfc6ec7e173349ead19cb67" + "test.gbff.gz" ] ], "information": [ @@ -138,7 +138,7 @@ { "id": "test" }, - "test.log:md5,44de8ec88f4a1781c3098a7d93cfd39e" + "test.log" ] ], "phage_fasta": [ @@ -165,7 +165,7 @@ ] } ], - "timestamp": "2026-08-04T16:09:43.540711549", + "timestamp": "2026-08-04T16:43:02.285660188", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.6"