From 1b756f67894e321bbc5c04be3f0425b553261432 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Fri, 7 Aug 2026 15:33:22 +0200 Subject: [PATCH] Update to topic --- modules/nf-core/qcat/main.nf | 26 ++----- modules/nf-core/qcat/meta.yml | 31 +++++++-- modules/nf-core/qcat/tests/main.nf.test | 16 ++--- modules/nf-core/qcat/tests/main.nf.test.snap | 71 +++++++++----------- 4 files changed, 68 insertions(+), 76 deletions(-) diff --git a/modules/nf-core/qcat/main.nf b/modules/nf-core/qcat/main.nf index c946890a274e..429d9255f8df 100644 --- a/modules/nf-core/qcat/main.nf +++ b/modules/nf-core/qcat/main.nf @@ -9,11 +9,11 @@ process QCAT { input: tuple val(meta), path(reads) - val barcode_kit + val barcode_kit output: tuple val(meta), path("fastq/*.fastq.gz"), emit: reads - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('qcat'), eval("qcat --version | sed 's/.*qcat //;s/ .*//'"), emit: versions_qcat, topic: versions when: task.ext.when == null || task.ext.when @@ -22,39 +22,27 @@ process QCAT { """ ## Unzip fastq file ## qcat doesn't support zipped files yet - FILE=$reads + FILE=${reads} if [[ \$FILE == *.gz ]] then - zcat $reads > unzipped.fastq + zcat ${reads} > unzipped.fastq FILE=unzipped.fastq fi qcat \\ -f \$FILE \\ -b ./fastq \\ - --kit $barcode_kit + --kit ${barcode_kit} ## Zip fastq files gzip fastq/* - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - qcat: \$(qcat --version | sed 's/^.*qcat //; s/ .*\$//') - END_VERSIONS """ stub: """ mkdir -p fastq - touch fastq/barcode00.fastq - touch fastq/none.fastq - - gzip fastq/* - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - qcat: \$(qcat --version | sed 's/^.*qcat //; s/ .*\$//') - END_VERSIONS + echo "" | gzip > fastq/barcode00.fastq.gz + echo "" | gzip > fastq/none.fastq.gz """ } diff --git a/modules/nf-core/qcat/meta.yml b/modules/nf-core/qcat/meta.yml index 241ec8369612..766ccd4b9851 100644 --- a/modules/nf-core/qcat/meta.yml +++ b/modules/nf-core/qcat/meta.yml @@ -10,7 +10,8 @@ tools: A demultiplexer for Nanopore samples homepage: https://github.com/nanoporetech/qcat documentation: https://github.com/nanoporetech/qcat#qcat - licence: ["MPL-2.0"] + licence: + - "MPL-2.0" identifier: "" input: - - meta: @@ -39,13 +40,29 @@ output: pattern: "*.fastq.gz" ontologies: - edam: http://edamontology.org/format_3989 # GZIP format + versions_qcat: + - - ${task.process}: + type: string + description: The name of the process + - qcat: + type: string + description: The name of the tool + - qcat --version | sed 's/.*qcat //;s/ .*//': + 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 + - qcat: + type: string + description: The name of the tool + - qcat --version | sed 's/.*qcat //;s/ .*//': + type: eval + description: The expression to obtain the version of the tool + authors: - "@yuukiiwa" - "@drpatelh" diff --git a/modules/nf-core/qcat/tests/main.nf.test b/modules/nf-core/qcat/tests/main.nf.test index 840fe2001ed5..cc3cd924d834 100644 --- a/modules/nf-core/qcat/tests/main.nf.test +++ b/modules/nf-core/qcat/tests/main.nf.test @@ -15,7 +15,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test' ], // meta map + [ id:'test' ], [ file("https://github.com/nf-core/test-datasets/raw/nanoseq/fastq/nondemultiplexed/sample_nobc_dx.fastq.gz", checkIfExists: true) ] ] input[1] = 'NBD103/NBD104' @@ -27,28 +27,21 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.reads, - process.out.versions, - file(process.out.versions[0]).readLines()[1].trim() // trap to catch conda version mismatches - ).match() - } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } test("test-qcat-stub") { options '-stub' - when { process { """ input[0] = [ - [ id:'test' ], // meta map + [ id:'test' ], [ file("https://github.com/nf-core/test-datasets/raw/nanoseq/fastq/nondemultiplexed/sample_nobc_dx.fastq.gz", checkIfExists: true) ] ] input[1] = 'NBD103/NBD104' - """ } } @@ -56,9 +49,8 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } - } diff --git a/modules/nf-core/qcat/tests/main.nf.test.snap b/modules/nf-core/qcat/tests/main.nf.test.snap index 19951fa113ac..fd104a5d6c99 100644 --- a/modules/nf-core/qcat/tests/main.nf.test.snap +++ b/modules/nf-core/qcat/tests/main.nf.test.snap @@ -1,66 +1,61 @@ { "test-qcat": { "content": [ - [ - [ - { - "id": "test" - }, + { + "reads": [ + [ + { + "id": "test" + }, + [ + "barcode06.fastq.gz:md5,f02509a0edada5bde143a2155969eaaa", + "barcode12.fastq.gz:md5,e3dda1db83ad2895ff95b3612b9f4348", + "none.fastq.gz:md5,36ed3f5964a59532b75a7f0c5975ecc6" + ] + ] + ], + "versions_qcat": [ [ - "barcode06.fastq.gz:md5,f02509a0edada5bde143a2155969eaaa", - "barcode12.fastq.gz:md5,e3dda1db83ad2895ff95b3612b9f4348", - "none.fastq.gz:md5,36ed3f5964a59532b75a7f0c5975ecc6" + "QCAT", + "qcat", + "1.1.0" ] ] - ], - [ - "versions.yml:md5,78ca985d3d7741b521d87af6eb190f30" - ], - "qcat: 1.1.0" + } ], + "timestamp": "2026-08-07T15:28:18.380966741", "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.4" - }, - "timestamp": "2024-08-29T12:36:04.213621" + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } }, "test-qcat-stub": { "content": [ { - "0": [ + "reads": [ [ { "id": "test" }, [ - "barcode00.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e", - "none.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + "barcode00.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "none.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ] ], - "1": [ - "versions.yml:md5,78ca985d3d7741b521d87af6eb190f30" - ], - "reads": [ + "versions_qcat": [ [ - { - "id": "test" - }, - [ - "barcode00.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e", - "none.fastq.gz:md5,d41d8cd98f00b204e9800998ecf8427e" - ] + "QCAT", + "qcat", + "1.1.0" ] - ], - "versions": [ - "versions.yml:md5,78ca985d3d7741b521d87af6eb190f30" ] } ], + "timestamp": "2026-08-07T15:28:28.814302286", "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.4" - }, - "timestamp": "2024-08-29T12:34:55.736959" + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } } } \ No newline at end of file