Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 9 additions & 5 deletions modules/nf-core/kofamscan/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ process KOFAMSCAN {
output:
tuple val(meta), path('*.txt'), optional: true, emit: txt
tuple val(meta), path('*.tsv'), optional: true, emit: tsv
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('kofamscan'), eval("exec_annotation --version 2>&1 | sed 's/exec_annotation //;'"), topic: versions, emit: versions_kofamscan

when:
task.ext.when == null || task.ext.when
Expand All @@ -33,10 +33,14 @@ process KOFAMSCAN {
--cpu $task.cpus \\
-o ${prefix}.${extension} \\
$fasta
"""

cat <<-END_VERSIONS > versions.yml
"${task.process}":
kofamscan: \$(echo \$(exec_annotation --version 2>&1) | sed 's/^.*exec_annotation //;')
END_VERSIONS
stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def extension = args.contains("--format detail-tsv") ? "tsv" :
"txt"
"""
touch ${prefix}.${extension}
"""
}
51 changes: 33 additions & 18 deletions modules/nf-core/kofamscan/meta.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "kofamscan"
description: Produces annotation using kofamscan against a Profile database and a
KO list
description: Produces annotation using kofamscan against a Profile database and
a KO list
keywords:
- fasta
- kegg
Expand All @@ -13,7 +13,8 @@ tools:
documentation: "https://github.com/takaram/kofam_scan"
tool_dev_url: "https://github.com/takaram/kofam_scan"
doi: "10.1093/bioinformatics/btz859"
licence: ["MIT License"]
licence:
- "MIT License"
identifier: biotools:kofamscan
input:
- - meta:
Expand All @@ -38,34 +39,48 @@ input:
output:
txt:
- - meta:
type: file
description: Application-specific text file with hits information
pattern: "*.{txt}"
ontologies: []
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.txt":
type: file
description: Application-specific text file with hits information
pattern: "*.{txt}"
ontologies: []
tsv:
- - meta:
type: file
description: Application-specific text file with hits information
pattern: "*.{txt}"
ontologies: []
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.tsv":
type: file
description: Tab separated file containing with detailed hits
pattern: "*.{tsv}"
ontologies:
- edam: http://edamontology.org/format_3475 # TSV
- edam: http://edamontology.org/format_3475
versions_kofamscan:
- - ${task.process}:
type: string
description: The name of the process
- kofamscan:
type: string
description: kofamscan version string
- "exec_annotation --version 2>&1 | sed 's/exec_annotation //;'":
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
- kofamscan:
type: string
description: kofamscan version string
- "exec_annotation --version 2>&1 | sed 's/exec_annotation //;'":
type: eval
description: The expression to obtain the version of the tool
authors:
- "@toniher"
maintainers:
Expand Down
50 changes: 48 additions & 2 deletions modules/nf-core/kofamscan/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ nextflow_process {
assertAll(
{ assert process.success },
{ assert process.out.txt },
{ assert snapshot(process.out.versions).match() }
{ assert snapshot(process.out.findAll { key, val -> key.startsWith('versions') }).match() }
)
}
}
Expand Down Expand Up @@ -93,7 +93,53 @@ nextflow_process {
assertAll(
{ assert process.success },
{ assert path(process.out.tsv.get(0).get(1)).exists() },
{ assert snapshot(process.out.versions).match() }
{ assert snapshot(process.out.findAll { key, val -> key.startsWith('versions') }).match() }
)
}
}

test("test_kofamscan_txt - stub") {

options "-stub"

setup {
run("UNTAR") {
script "../../untar/main.nf"

process {
"""
input[0] = [[],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kofamscan/profiles.tar.gz',checkIfExists:true)]
"""
}
}

run("GUNZIP") {
script "../../gunzip/main.nf"

process {
"""
input[0] = [[],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kofamscan/ko_list.gz',checkIfExists:true)]
"""
}
}
}
when {
params {
module_args = ''
}
process {
"""
input[0] = [[id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta',checkIfExists: true)]
input[1] = UNTAR.out.untar.map{it[1]}
input[2] = GUNZIP.out.gunzip.map{it[1]}
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert process.out.txt },
{ assert snapshot(process.out.findAll { key, val -> key.startsWith('versions') }).match() }
)
}
}
Expand Down
60 changes: 45 additions & 15 deletions modules/nf-core/kofamscan/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,26 +1,56 @@
{
"test_kofamscan_tsv": {
"content": [
[
"versions.yml:md5,27e1b383c38beae2cdebb2cc79ff061e"
]
{
"versions_kofamscan": [
[
"KOFAMSCAN",
"kofamscan",
"1.3.0"
]
]
}
],
"timestamp": "2026-04-30T11:04:48.94643",
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2025-03-25T09:10:30.450619346"
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
},
"test_kofamscan_txt - stub": {
"content": [
{
"versions_kofamscan": [
[
"KOFAMSCAN",
"kofamscan",
"1.3.0"
]
]
}
],
"timestamp": "2026-04-30T11:05:05.206627",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
},
"test_kofamscan_txt": {
"content": [
[
"versions.yml:md5,27e1b383c38beae2cdebb2cc79ff061e"
]
{
"versions_kofamscan": [
[
"KOFAMSCAN",
"kofamscan",
"1.3.0"
]
]
}
],
"timestamp": "2026-04-30T11:04:27.92766",
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2025-03-24T13:54:47.35695004"
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
}
}
}
Loading