Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions modules/nf-core/hicap/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ./
"""

Expand Down
14 changes: 3 additions & 11 deletions modules/nf-core/hicap/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,19 @@ 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] = []

"""
}
}

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() }
)
}
}
Expand All @@ -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] = []

"""
}
}
Expand Down
117 changes: 22 additions & 95 deletions modules/nf-core/hicap/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,73 +1,29 @@
{
"test-hicap": {
"content": [
[
"VERSION <unknown",
"KEYWORDS .",
"SOURCE .",
" ORGANISM .",
" ."
],
[
"\t<ns0:clipPath id=\"clip\">",
"\t\t<ns0:rect height=\"150\" width=\"1800\" x=\"0\" y=\"0\" />",
"\t</ns0:clipPath>",
"\t<ns0:g id=\"group\" style=\"clip-path: url(#clip)\" transform=\"scale(1,-1) translate(0,-150)\">",
"\t\t<ns0:g transform=\"\">"
],
[
[
{
"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": [
Expand All @@ -79,81 +35,52 @@
]
}
],
"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"
]
],
"svg": [
[
{
"id": "test",
"single_end": false
"id": "test"
},
"genome.svg:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"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"
}
}
}
}
Loading