diff --git a/modules/nf-core/cat/cat/environment.yml b/modules/nf-core/cat/cat/environment.yml index 50c2059afb16..985117698a0c 100644 --- a/modules/nf-core/cat/cat/environment.yml +++ b/modules/nf-core/cat/cat/environment.yml @@ -4,4 +4,4 @@ channels: - conda-forge - bioconda dependencies: - - conda-forge::pigz=2.3.4 + - conda-forge::pigz=2.8 diff --git a/modules/nf-core/cat/cat/main.nf b/modules/nf-core/cat/cat/main.nf index 2862c64cd9d0..aa72fc4d97cf 100644 --- a/modules/nf-core/cat/cat/main.nf +++ b/modules/nf-core/cat/cat/main.nf @@ -4,15 +4,15 @@ process CAT_CAT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/pigz:2.3.4' : - 'biocontainers/pigz:2.3.4' }" + 'https://depot.galaxyproject.org/singularity/pigz:2.8' : + 'biocontainers/pigz:2.8' }" input: tuple val(meta), path(files_in) output: tuple val(meta), path("${prefix}"), emit: file_out - path "versions.yml" , emit: versions + tuple val("${task.process}"), val("pigz"), eval("pigz --version 2>&1 | sed 's/pigz //g'"), topic: versions, emit: versions_cat when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/cat/cat/meta.yml b/modules/nf-core/cat/cat/meta.yml index 2a9284d7f107..36a7359bbf93 100644 --- a/modules/nf-core/cat/cat/meta.yml +++ b/modules/nf-core/cat/cat/meta.yml @@ -28,16 +28,33 @@ output: description: Groovy Map containing sample information - ${prefix}: type: file - description: Concatenated file. Will be gzipped if file_out ends with ".gz" + description: Concatenated file. Will be gzipped if file_out ends with + ".gz" pattern: "${file_out}" ontologies: [] + versions_cat: + - - ${task.process}: + type: string + description: The name of the process + - pigz: + type: string + description: The name of the tool + - "pigz --version 2>&1 | sed 's/pigz //g'": + 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 + - pigz: + type: string + description: The name of the tool + - "pigz --version 2>&1 | sed 's/pigz //g'": + type: eval + description: The expression to obtain the version of the tool + authors: - "@erikrikarddaniel" - "@FriederikeHanssen" diff --git a/modules/nf-core/cat/cat/tests/main.nf.test b/modules/nf-core/cat/cat/tests/main.nf.test index 9cb1617883f5..030c6649d02c 100644 --- a/modules/nf-core/cat/cat/tests/main.nf.test +++ b/modules/nf-core/cat/cat/tests/main.nf.test @@ -3,16 +3,14 @@ nextflow_process { name "Test Process CAT_CAT" script "../main.nf" process "CAT_CAT" + tag "modules" tag "modules_nfcore" tag "cat" tag "cat/cat" - test("test_cat_name_conflict") { + test("sarscov2 - genome - error: name conflict") { when { - params { - outdir = "${outputDir}" - } process { """ input[0] = @@ -30,16 +28,13 @@ nextflow_process { assertAll( { assert !process.success }, { assert process.stdout.toString().contains("The name of the input file can't be the same as for the output prefix") }, - { assert snapshot(process.out.versions).match() } + { assert snapshot(process.out).match() } ) } } - test("test_cat_unzipped_unzipped") { + test("sarscov2 - [ fasta, sizes ] - unzipped") { when { - params { - outdir = "${outputDir}" - } process { """ input[0] = @@ -62,11 +57,8 @@ nextflow_process { } - test("test_cat_zipped_zipped") { + test("sarscov2 - [ gff3_gz, maf_gz ] - zipped") { when { - params { - outdir = "${outputDir}" - } process { """ input[0] = @@ -81,25 +73,20 @@ nextflow_process { } } then { - def lines = path(process.out.file_out.get(0).get(1)).linesGzip assertAll( { assert process.success }, - { assert snapshot( - lines[0..5], - lines.size(), - process.out.versions - ).match() + { assert snapshot(process.out).match() } ) } } - test("test_cat_zipped_unzipped") { - config './nextflow_zipped_unzipped.config' + test("sarscov2 - [ gff3_gz, maf_gz ] - unzipped") { + config './nextflow.config' when { params { - outdir = "${outputDir}" + cat_prefix = "cat.txt" } process { """ @@ -124,11 +111,12 @@ nextflow_process { } - test("test_cat_unzipped_zipped") { - config './nextflow_unzipped_zipped.config' + test("sarscov2 - [ fasta, sizes ] - zipped") { + config './nextflow.config' + when { params { - outdir = "${outputDir}" + cat_prefix = "cat.txt.gz" } process { """ @@ -144,24 +132,19 @@ nextflow_process { } } then { - def lines = path(process.out.file_out.get(0).get(1)).linesGzip assertAll( { assert process.success }, - { assert snapshot( - lines[0..5], - lines.size(), - process.out.versions - ).match() - } + { assert snapshot(process.out).match() } ) } } - test("test_cat_one_file_unzipped_zipped") { - config './nextflow_unzipped_zipped.config' + test("sarscov2 - fasta - zipped") { + config './nextflow.config' + when { params { - outdir = "${outputDir}" + cat_prefix = "cat.txt.gz" } process { """ @@ -176,15 +159,33 @@ nextflow_process { } } then { - def lines = path(process.out.file_out.get(0).get(1)).linesGzip assertAll( { assert process.success }, - { assert snapshot( - lines[0..5], - lines.size(), - process.out.versions - ).match() - } + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 - fasta - unzipped - stub") { + options "-stub" + + when { + process { + """ + input[0] = + [ + [ id:'test', single_end:true ], + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/cat/cat/tests/main.nf.test.snap b/modules/nf-core/cat/cat/tests/main.nf.test.snap index b7623ee65062..5b4e4cc3d748 100644 --- a/modules/nf-core/cat/cat/tests/main.nf.test.snap +++ b/modules/nf-core/cat/cat/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "test_cat_unzipped_unzipped": { + "sarscov2 - [ gff3_gz, maf_gz ] - unzipped": { "content": [ { "0": [ @@ -8,11 +8,15 @@ "id": "test", "single_end": true }, - "test.fasta:md5,f44b33a0e441ad58b2d3700270e2dbe2" + "cat.txt:md5,c439d3b60e7bc03e8802a451a0d9a5d9" ] ], "1": [ - "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" + [ + "CAT_CAT", + "pigz", + "2.8" + ] ], "file_out": [ [ @@ -20,21 +24,25 @@ "id": "test", "single_end": true }, - "test.fasta:md5,f44b33a0e441ad58b2d3700270e2dbe2" + "cat.txt:md5,c439d3b60e7bc03e8802a451a0d9a5d9" ] ], - "versions": [ - "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" + "versions_cat": [ + [ + "CAT_CAT", + "pigz", + "2.8" + ] ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2023-10-16T14:32:18.500464399" + "timestamp": "2025-12-10T09:08:31.479828" }, - "test_cat_zipped_unzipped": { + "sarscov2 - fasta - unzipped - stub": { "content": [ { "0": [ @@ -43,11 +51,15 @@ "id": "test", "single_end": true }, - "cat.txt:md5,c439d3b60e7bc03e8802a451a0d9a5d9" + "test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ - "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" + [ + "CAT_CAT", + "pigz", + "2.8" + ] ], "file_out": [ [ @@ -55,93 +67,217 @@ "id": "test", "single_end": true }, - "cat.txt:md5,c439d3b60e7bc03e8802a451a0d9a5d9" + "test.fasta:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" + "versions_cat": [ + [ + "CAT_CAT", + "pigz", + "2.8" + ] ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2023-10-16T14:32:49.642741302" + "timestamp": "2025-12-10T16:16:28.118094" }, - "test_cat_zipped_zipped": { + "sarscov2 - [ fasta, sizes ] - zipped": { "content": [ - [ - "MT192765.1\tGenbank\ttranscript\t259\t29667\t.\t+\t.\tID=unknown_transcript_1;geneID=orf1ab;gene_name=orf1ab", - "MT192765.1\tGenbank\tgene\t259\t21548\t.\t+\t.\tParent=unknown_transcript_1", - "MT192765.1\tGenbank\tCDS\t259\t13461\t.\t+\t0\tParent=unknown_transcript_1;exception=\"ribosomal slippage\";gbkey=CDS;gene=orf1ab;note=\"pp1ab;translated=by -1 ribosomal frameshift\";product=\"orf1ab polyprotein\";protein_id=QIK50426.1", - "MT192765.1\tGenbank\tCDS\t13461\t21548\t.\t+\t0\tParent=unknown_transcript_1;exception=\"ribosomal slippage\";gbkey=CDS;gene=orf1ab;note=\"pp1ab;translated=by -1 ribosomal frameshift\";product=\"orf1ab polyprotein\";protein_id=QIK50426.1", - "MT192765.1\tGenbank\tCDS\t21556\t25377\t.\t+\t0\tParent=unknown_transcript_1;gbkey=CDS;gene=S;note=\"structural protein\";product=\"surface glycoprotein\";protein_id=QIK50427.1", - "MT192765.1\tGenbank\tgene\t21556\t25377\t.\t+\t.\tParent=unknown_transcript_1" - ], - 78, - [ - "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "cat.txt.gz:md5,f44b33a0e441ad58b2d3700270e2dbe2" + ] + ], + "1": [ + [ + "CAT_CAT", + "pigz", + "2.8" + ] + ], + "file_out": [ + [ + { + "id": "test", + "single_end": true + }, + "cat.txt.gz:md5,f44b33a0e441ad58b2d3700270e2dbe2" + ] + ], + "versions_cat": [ + [ + "CAT_CAT", + "pigz", + "2.8" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-10T16:15:56.529595" + }, + "sarscov2 - genome - error: name conflict": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "file_out": [ + + ], + "versions_cat": [ + + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-07-22T11:51:46.802978" + "timestamp": "2025-12-10T16:14:54.496538" }, - "test_cat_name_conflict": { + "sarscov2 - [ fasta, sizes ] - unzipped": { "content": [ - [ - - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fasta:md5,f44b33a0e441ad58b2d3700270e2dbe2" + ] + ], + "1": [ + [ + "CAT_CAT", + "pigz", + "2.8" + ] + ], + "file_out": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fasta:md5,f44b33a0e441ad58b2d3700270e2dbe2" + ] + ], + "versions_cat": [ + [ + "CAT_CAT", + "pigz", + "2.8" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-07-22T11:51:29.45394" + "timestamp": "2025-12-10T11:26:29.942203" }, - "test_cat_one_file_unzipped_zipped": { + "sarscov2 - [ gff3_gz, maf_gz ] - zipped": { "content": [ - [ - ">MT192765.1 Severe acute respiratory syndrome coronavirus 2 isolate SARS-CoV-2/human/USA/PC00101P/2020, complete genome", - "GTTTATACCTTCCCAGGTAACAAACCAACCAACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAAAATCTGT", - "GTGGCTGTCACTCGGCTGCATGCTTAGTGCACTCACGCAGTATAATTAATAACTAATTACTGTCGTTGACAGGACACGAG", - "TAACTCGTCTATCTTCTGCAGGCTGCTTACGGTTTCGTCCGTGTTGCAGCCGATCATCAGCACATCTAGGTTTTGTCCGG", - "GTGTGACCGAAAGGTAAGATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCCAACTCAGTTTGCCTGTTTT", - "ACAGGTTCGCGACGTGCTCGTACGTGGCTTTGGAGACTCCGTGGAGGAGGTCTTATCAGAGGCACGTCAACATCTTAAAG" - ], - 374, - [ - "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.gff3.gz:md5,c439d3b60e7bc03e8802a451a0d9a5d9" + ] + ], + "1": [ + [ + "CAT_CAT", + "pigz", + "2.8" + ] + ], + "file_out": [ + [ + { + "id": "test", + "single_end": true + }, + "test.gff3.gz:md5,c439d3b60e7bc03e8802a451a0d9a5d9" + ] + ], + "versions_cat": [ + [ + "CAT_CAT", + "pigz", + "2.8" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-07-22T11:52:02.774016" + "timestamp": "2025-12-10T11:26:45.679401" }, - "test_cat_unzipped_zipped": { + "sarscov2 - fasta - zipped": { "content": [ - [ - ">MT192765.1 Severe acute respiratory syndrome coronavirus 2 isolate SARS-CoV-2/human/USA/PC00101P/2020, complete genome", - "GTTTATACCTTCCCAGGTAACAAACCAACCAACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAAAATCTGT", - "GTGGCTGTCACTCGGCTGCATGCTTAGTGCACTCACGCAGTATAATTAATAACTAATTACTGTCGTTGACAGGACACGAG", - "TAACTCGTCTATCTTCTGCAGGCTGCTTACGGTTTCGTCCGTGTTGCAGCCGATCATCAGCACATCTAGGTTTTGTCCGG", - "GTGTGACCGAAAGGTAAGATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCCAACTCAGTTTGCCTGTTTT", - "ACAGGTTCGCGACGTGCTCGTACGTGGCTTTGGAGACTCCGTGGAGGAGGTCTTATCAGAGGCACGTCAACATCTTAAAG" - ], - 375, - [ - "versions.yml:md5,115ed6177ebcff24eb99d503fa5ef894" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "cat.txt.gz:md5,6e9fe4042a72f2345f644f239272b7e6" + ] + ], + "1": [ + [ + "CAT_CAT", + "pigz", + "2.8" + ] + ], + "file_out": [ + [ + { + "id": "test", + "single_end": true + }, + "cat.txt.gz:md5,6e9fe4042a72f2345f644f239272b7e6" + ] + ], + "versions_cat": [ + [ + "CAT_CAT", + "pigz", + "2.8" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2024-07-22T11:51:57.581523" + "timestamp": "2025-12-10T16:16:12.439911" } } \ No newline at end of file diff --git a/modules/nf-core/cat/cat/tests/nextflow.config b/modules/nf-core/cat/cat/tests/nextflow.config new file mode 100644 index 000000000000..5bc9bf50e349 --- /dev/null +++ b/modules/nf-core/cat/cat/tests/nextflow.config @@ -0,0 +1,6 @@ + +process { + withName: CAT_CAT { + ext.prefix = "${params.cat_prefix}" + } +} diff --git a/modules/nf-core/cat/cat/tests/nextflow_unzipped_zipped.config b/modules/nf-core/cat/cat/tests/nextflow_unzipped_zipped.config deleted file mode 100644 index ec26b0fdc6ec..000000000000 --- a/modules/nf-core/cat/cat/tests/nextflow_unzipped_zipped.config +++ /dev/null @@ -1,6 +0,0 @@ - -process { - withName: CAT_CAT { - ext.prefix = 'cat.txt.gz' - } -} diff --git a/modules/nf-core/cat/cat/tests/nextflow_zipped_unzipped.config b/modules/nf-core/cat/cat/tests/nextflow_zipped_unzipped.config deleted file mode 100644 index fbc79783d5b6..000000000000 --- a/modules/nf-core/cat/cat/tests/nextflow_zipped_unzipped.config +++ /dev/null @@ -1,8 +0,0 @@ - -process { - - withName: CAT_CAT { - ext.prefix = 'cat.txt' - } - -}