Skip to content
Open
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
47 changes: 47 additions & 0 deletions subworkflows/local/functional_annotation/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: functional_annotation
description: Performs functional annotation of protien sequences
keywords:
- annotation
- functional
- interproscan
- proteins
- fasta

components:
- aria2
- untar
- interproscan

input:
- ch_fasta:
type: file
description: Channel containing FASTA files to be annotated.
pattern: "*.{fa,fasta,faa}"
- skip_interproscan:
type: boolean
description: Flag to skip the InterProScan annotation step entirely.
- interproscan_db_url:
type: string
description: URL to download the InterProScan database archive.
- interproscan_db:
type: string
description: Path to a pre-existing local InterProScan database directory.
If provided, skips the download and extraction steps.

output:
- interproscan_tsv:
type: file
description: TSV file containing InterProScan functional annotation results.
Structure: [ val(meta), path(tsv) ]
pattern: "*.tsv"
- versions:
type: file
description: File containing software versions for all tools used in the workflow.
Structure: [ path(versions.yml) ]
pattern: "versions.yml"

authors:
- "@vagkaratzas"
- "@Muskan-2464
maintainers:
- "@vagkaratzas"
99 changes: 99 additions & 0 deletions subworkflows/local/functional_annotation/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
nextflow_workflow {

name "Test Workflow FUNCTIONAL_ANNOTATION"
script "../main.nf"
workflow "FUNCTIONAL_ANNOTATION"
tag "subworkflows"
tag "subworkflows_local"
tag "functional_annotation"

// -------------------------------------------------------
// TEST 1: Skip InterProScan (safest for CI, no DB needed)
// -------------------------------------------------------
test("fasta - skip_interproscan true") {

when {
workflow {
"""
input[0] = Channel.of([
[ id:'test_sample' ],
file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz',
checkIfExists: true)
])
input[1] = true // skip_interproscan
input[2] = [] // no url
input[3] = [] // no local db
"""
}
}

then {
assertAll(
{ assert workflow.success },
{ assert workflow.out.interproscan_tsv == [] },
{ assert snapshot(workflow.out.versions).match("versions_skip") }
)
}
}

// -------------------------------------------------------
// TEST 2: Stub run with skip=false (no real DB download)
// -------------------------------------------------------
test("stub run - skip interproscan") {

options "-stub"

when {
workflow {
"""
input[0] = Channel.of([
[ id:'test_sample' ],
file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz',
checkIfExists: true)
])
input[1] = true
input[2] = []
input[3] = []
"""
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(workflow.out).match("stub") }
)
}
}

// -------------------------------------------------------
// TEST 3: Stub run - skip interproscan
// -------------------------------------------------------
test("fasta - skip_interproscan true - stub") {

options "-stub"

when {
workflow {
"""
input[0] = Channel.of([
[ id:'test_sample' ],
file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz',
checkIfExists: true)
])
input[1] = true
input[2] = []
input[3] = []
"""
}
}

then {
assertAll(
{ assert workflow.success },
{ assert workflow.out.interproscan_tsv == [] },
{ assert workflow.out.versions == [] }
)
}
}
}
37 changes: 37 additions & 0 deletions subworkflows/local/functional_annotation/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"versions_skip": {
"content": [
[

]
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.4"
},
"timestamp": "2026-03-13T17:28:57.029553387"
},
"stub": {
"content": [
{
"0": [

],
"1": [

],
"interproscan_tsv": [

],
"versions": [

]
}
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.4"
},
"timestamp": "2026-03-13T17:29:04.51251929"
}
}
Loading