diff --git a/modules/nf-core/hicap/main.nf b/modules/nf-core/hicap/main.nf index 84594cac9368..ded6564cb80d 100644 --- a/modules/nf-core/hicap/main.nf +++ b/modules/nf-core/hicap/main.nf @@ -16,7 +16,7 @@ process HICAP { tuple val(meta), path("*.gbk"), emit: gbk, optional: true tuple val(meta), path("*.svg"), emit: svg, optional: true tuple val(meta), path("*.tsv"), emit: tsv, optional: true - tuple val("${task.process}"), val('hicap'), eval('hicap --version 2>&1 | sed \'s/^.*hicap //\''), emit: versions_hicap, topic: versions + tuple val("${task.process}"), val('hicap'), eval("hicap --version 2>&1 | sed 's/^.*hicap //'"), emit: versions_hicap, topic: versions when: task.ext.when == null || task.ext.when @@ -28,15 +28,15 @@ process HICAP { def is_compressed = fasta.getName().endsWith(".gz") ? true : false def fasta_name = fasta.getName().replace(".gz", "") """ - if [ "$is_compressed" == "true" ]; then - gzip -c -d $fasta > $fasta_name + if [ "${is_compressed}" == "true" ]; then + gzip -c -d $fasta > ${fasta_name} fi hicap \\ - --query_fp $fasta_name \\ - $database_args \\ - $model_args \\ - $args \\ - --threads $task.cpus \\ + --query_fp ${fasta_name} \\ + ${database_args} \\ + ${model_args} \\ + ${args} \\ + --threads ${task.cpus} \\ -o ./ """ diff --git a/modules/nf-core/hicap/tests/main.nf.test b/modules/nf-core/hicap/tests/main.nf.test index 15df17578eda..30f6eea6f385 100644 --- a/modules/nf-core/hicap/tests/main.nf.test +++ b/modules/nf-core/hicap/tests/main.nf.test @@ -14,12 +14,11 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', single_end:false ], + [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/prokaryotes/haemophilus_influenzae/genome/genome.fna.gz', checkIfExists: true) ] input[1] = [] input[2] = [] - """ } } @@ -27,13 +26,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.gbk[0][1]).readLines()[3..7], - file(process.out.svg[0][1]).readLines()[3..7], - process.out.tsv, - process.out.findAll { key, val -> key.startsWith('versions') } - ).match() - } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } @@ -45,12 +38,11 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', single_end:false ], + [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/prokaryotes/haemophilus_influenzae/genome/genome.fna.gz', checkIfExists: true) ] input[1] = [] input[2] = [] - """ } } diff --git a/modules/nf-core/hicap/tests/main.nf.test.snap b/modules/nf-core/hicap/tests/main.nf.test.snap index 018522402696..a812a1634a94 100644 --- a/modules/nf-core/hicap/tests/main.nf.test.snap +++ b/modules/nf-core/hicap/tests/main.nf.test.snap @@ -1,73 +1,29 @@ { "test-hicap": { - "content": [ - [ - "VERSION ", - "\t\t", - "\t", - "\t", - "\t\t" - ], - [ - [ - { - "id": "test", - "single_end": false - }, - "genome.tsv:md5,cd148cbec8c707e9c732c417a0e93d3b" - ] - ], - { - "versions_hicap": [ - [ - "HICAP", - "hicap", - "1.0.3" - ] - ] - } - ], - "timestamp": "2026-05-18T22:23:36.468425818", - "meta": { - "nf-test": "0.9.5", - "nextflow": "25.10.2" - } - }, - "test-hicap - stub": { "content": [ { "gbk": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "genome.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" + "genome.gbk:md5,562d026956903354ac80721f501335d4" ] ], "svg": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "genome.svg:md5,d41d8cd98f00b204e9800998ecf8427e" + "genome.svg:md5,4fb94871dd0fdd8b4496049668176631" ] ], "tsv": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "genome.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + "genome.tsv:md5,cd148cbec8c707e9c732c417a0e93d3b" ] ], "versions_hicap": [ @@ -79,50 +35,19 @@ ] } ], - "timestamp": "2026-05-18T22:23:41.930816628", + "timestamp": "2026-05-19T17:33:39.043348035", "meta": { "nf-test": "0.9.5", - "nextflow": "25.10.2" + "nextflow": "26.04.0" } }, - "test-hicap-stub": { + "test-hicap - stub": { "content": [ { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.svg:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "2": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "3": [ - "versions.yml:md5,8f155331d348220ce0f7d6467340608a" - ], "gbk": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "genome.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -130,8 +55,7 @@ "svg": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "genome.svg:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -139,21 +63,24 @@ "tsv": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "genome.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ - "versions.yml:md5,8f155331d348220ce0f7d6467340608a" + "versions_hicap": [ + [ + "HICAP", + "hicap", + "1.0.3" + ] ] } ], - "timestamp": "2024-08-30T19:25:16.144267", + "timestamp": "2026-05-19T17:33:47.557759254", "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.5", + "nextflow": "26.04.0" } } -} +} \ No newline at end of file