diff --git a/modules/nf-core/plasmidid/main.nf b/modules/nf-core/plasmidid/main.nf index 442047876a2d..ed19ade884b3 100644 --- a/modules/nf-core/plasmidid/main.nf +++ b/modules/nf-core/plasmidid/main.nf @@ -20,7 +20,7 @@ process PLASMIDID { tuple val(meta), path("${prefix}/database/") , emit: database tuple val(meta), path("${prefix}/fasta_files/") , emit: fasta_files tuple val(meta), path("${prefix}/kmer/") , emit: kmer - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('plasmidid'), eval('echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //"'), topic: versions, emit: versions_plasmidid when: task.ext.when == null || task.ext.when @@ -37,9 +37,14 @@ process PLASMIDID { -o . mv NO_GROUP/$prefix ./$prefix - cat <<-END_VERSIONS > versions.yml - "${task.process}": - plasmidid: \$(echo \$(plasmidID --version 2>&1)) - END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + mkdir -p ${prefix}/images ${prefix}/logs ${prefix}/data ${prefix}/database ${prefix}/fasta_files ${prefix}/kmer + touch ${prefix}/${prefix}_final_results.html + touch ${prefix}/${prefix}_final_results.tab """ } diff --git a/modules/nf-core/plasmidid/meta.yml b/modules/nf-core/plasmidid/meta.yml index ac3a7b002852..69cbf6d36589 100644 --- a/modules/nf-core/plasmidid/meta.yml +++ b/modules/nf-core/plasmidid/meta.yml @@ -10,7 +10,8 @@ tools: homepage: https://github.com/BU-ISCIII/plasmidID/wiki documentation: https://github.com/BU-ISCIII/plasmidID#readme tool_dev_url: https://github.com/BU-ISCIII/plasmidID - licence: ["GPL v3"] + licence: + - "GPL v3" identifier: biotools:plasmidid input: - - meta: @@ -51,7 +52,7 @@ output: description: Results in a tabular file pattern: "*.{tab}" ontologies: - - edam: http://edamontology.org/format_3475 # TSV + - edam: http://edamontology.org/format_3475 images: - - meta: type: map @@ -112,13 +113,27 @@ output: type: directory description: Directory containing the kmer files produced by plasmidid pattern: "database" + versions_plasmidid: + - - ${task.process}: + type: string + description: The name of the process + - plasmidid: + type: string + description: The name of the tool + - echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //": + 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 + - plasmidid: + type: string + description: The name of the tool + - echo "$(plasmidID --version 2>&1)" | sed "s/^plasmidID //": + type: eval + description: The expression to obtain the version of the tool authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/plasmidid/tests/main.nf.test b/modules/nf-core/plasmidid/tests/main.nf.test index 27e2a85dd54a..a928c2828c39 100644 --- a/modules/nf-core/plasmidid/tests/main.nf.test +++ b/modules/nf-core/plasmidid/tests/main.nf.test @@ -1,4 +1,3 @@ - nextflow_process { name "Test Process PLASMIDID" @@ -27,18 +26,29 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.data[0][1]).name, - file(process.out.database[0][1]).name, - file(process.out.images[0][1]).name, - file(process.out.kmer[0][1]).name, - file(process.out.logs[0][1]).name, - process.out.fasta_files, - process.out.html, - process.out.tab, - process.out.versions - ).match() - } + { assert snapshot(sanitizeOutput(process.out, unstableKeys:["images", "logs", "data", "database", "kmer"])).match() } + ) + } + } + + test("test-plasmidid-stub") { + options "-stub" + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out, unstableKeys:["images", "logs", "data", "database", "kmer"])).match() } ) } } diff --git a/modules/nf-core/plasmidid/tests/main.nf.test.snap b/modules/nf-core/plasmidid/tests/main.nf.test.snap index 1717b7009978..e53fe016f8e6 100644 --- a/modules/nf-core/plasmidid/tests/main.nf.test.snap +++ b/modules/nf-core/plasmidid/tests/main.nf.test.snap @@ -1,45 +1,170 @@ { "test-plasmidid": { "content": [ - "data", - "database", - "images", - "kmer", - "logs", - [ - [ - { - "id": "test" - }, - [ - "MT192765.1_term.fasta:md5,8a8537dd3b21e6905f9367b51c3b3074" + { + "data": [ + [ + { + "id": "test" + }, + "data" + ] + ], + "database": [ + [ + { + "id": "test" + }, + "database" + ] + ], + "fasta_files": [ + [ + { + "id": "test" + }, + [ + "MT192765.1_term.fasta:md5,8a8537dd3b21e6905f9367b51c3b3074" + ] + ] + ], + "html": [ + [ + { + "id": "test" + }, + "test_final_results.html:md5,415774b2cff3a50e4304c875cf72529d" + ] + ], + "images": [ + [ + { + "id": "test" + }, + "images" + ] + ], + "kmer": [ + [ + { + "id": "test" + }, + "kmer" + ] + ], + "logs": [ + [ + { + "id": "test" + }, + "logs" + ] + ], + "tab": [ + [ + { + "id": "test" + }, + "test_final_results.tab:md5,e7e6be8e76cac944979bb3dfc21da8bd" + ] + ], + "versions_plasmidid": [ + [ + "PLASMIDID", + "plasmidid", + "1.6.4" ] ] - ], - [ - [ - { - "id": "test" - }, - "test_final_results.html:md5,415774b2cff3a50e4304c875cf72529d" - ] - ], - [ - [ - { - "id": "test" - }, - "test_final_results.tab:md5,e7e6be8e76cac944979bb3dfc21da8bd" + } + ], + "timestamp": "2026-04-30T12:54:16.108858", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "test-plasmidid-stub": { + "content": [ + { + "data": [ + [ + { + "id": "test" + }, + "data" + ] + ], + "database": [ + [ + { + "id": "test" + }, + "database" + ] + ], + "fasta_files": [ + [ + { + "id": "test" + }, + [ + + ] + ] + ], + "html": [ + [ + { + "id": "test" + }, + "test_final_results.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "images": [ + [ + { + "id": "test" + }, + "images" + ] + ], + "kmer": [ + [ + { + "id": "test" + }, + "kmer" + ] + ], + "logs": [ + [ + { + "id": "test" + }, + "logs" + ] + ], + "tab": [ + [ + { + "id": "test" + }, + "test_final_results.tab:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_plasmidid": [ + [ + "PLASMIDID", + "plasmidid", + "1.6.4" + ] ] - ], - [ - "versions.yml:md5,29b9d094c38ac1cf78d12bb079ced8b2" - ] + } ], + "timestamp": "2026-04-30T15:08:17.915883", "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.4" - }, - "timestamp": "2024-08-29T10:03:30.225921" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } } } \ No newline at end of file