From 3787af69502b1e2df9e820aa331fcd6d3a9e81c7 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 16:11:34 +0530 Subject: [PATCH 01/25] Create main.nf.test --- .../functional_annotation/tests/main.nf.test | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 subworkflows/local/functional_annotation/tests/main.nf.test diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test b/subworkflows/local/functional_annotation/tests/main.nf.test new file mode 100644 index 0000000..5afc764 --- /dev/null +++ b/subworkflows/local/functional_annotation/tests/main.nf.test @@ -0,0 +1,31 @@ +nextflow_subworkflow { + + name "Test Subworkflow FUNCTIONAL_ANNOTATION" + script "../main.nf" + config "./nextflow.config" + workflow "FUNCTIONAL_ANNOTATION" + + test("Should run functional annotation with InterProScan") { + + when { + workflow { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['genome']['proteome_fasta'], checkIfExists: true) + ] + input[1] = true // skip_interproscan (set to true to avoid heavy DB download) + input[2] = 'https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealignment/testdata/dummy_db.tar.gz' + input[3] = null // interproscan_db + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match() } + ) + } + } +} From e5cb7746022bfa141fd70132bed585f4454b0867 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 16:15:38 +0530 Subject: [PATCH 02/25] Create meta.yml --- .../local/functional_annotation/meta.yml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 subworkflows/local/functional_annotation/meta.yml diff --git a/subworkflows/local/functional_annotation/meta.yml b/subworkflows/local/functional_annotation/meta.yml new file mode 100644 index 0000000..6592668 --- /dev/null +++ b/subworkflows/local/functional_annotation/meta.yml @@ -0,0 +1,43 @@ +# yaml-name: "functional_annotation" +description: Annotate amino acid fasta files with functional databases using InterProScan +keywords: + - fasta + - sequences + - functional + - annotation + - database + - interproscan +components: + - aria2 + - untar + - interproscan +input: + - ch_fasta: + type: file + description: | + Amino acid fasta file containing amino acid sequences for annotation + Structure: [ val(meta), [ path(fasta) ] ] + - skip_interproscan: + type: boolean + description: Skip functional annotation with InterProScan + - interproscan_db_url: + type: string + description: URL to download the InterProScan database + - interproscan_db: + type: string + description: Path to an existing InterProScan library on the system. If provided, the ARIA2 download will be skipped. +output: + - interproscan_tsv: + type: file + description: TSV files with InterProScan functional annotation for input amino acid sequences + pattern: "*.tsv" + - versions: + type: file + description: Versions file containing the software versions used in the workflow + pattern: "versions.yml" +authors: + - "@vagkaratzas" + - "@Muskan" +maintainers: + - "@vagkaratzas" + From c454590b6e752b4bd93f9c15ab007e7134ea5adb Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 16:19:59 +0530 Subject: [PATCH 03/25] nextflow.config --- .../local/functional_annotation/tests/nextflow.config | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 subworkflows/local/functional_annotation/tests/nextflow.config diff --git a/subworkflows/local/functional_annotation/tests/nextflow.config b/subworkflows/local/functional_annotation/tests/nextflow.config new file mode 100644 index 0000000..d4fa9aa --- /dev/null +++ b/subworkflows/local/functional_annotation/tests/nextflow.config @@ -0,0 +1,10 @@ +params { + // This defines the test dataset location for the subworkflow + test_data = [ + 'sarscov2': [ + 'genome': [ + 'proteome_fasta': 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/genome/proteome.fasta' + ] + ] + ] +} From 300d7db298b6d72c81871261347d5ede20d98d89 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 16:23:53 +0530 Subject: [PATCH 04/25] main.nf.test.snap --- .../local/functional_annotation/tests/main.nf.test.snap | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 subworkflows/local/functional_annotation/tests/main.nf.test.snap diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test.snap b/subworkflows/local/functional_annotation/tests/main.nf.test.snap new file mode 100644 index 0000000..c14120b --- /dev/null +++ b/subworkflows/local/functional_annotation/tests/main.nf.test.snap @@ -0,0 +1,8 @@ +{ + "Should run functional annotation with InterProScan": { + "content": [ + + ], + "timestamp": "2026-03-13T12:00:00" + } +} From c077dc6610a086913dfd94309222faae149c6bfe Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 16:55:51 +0530 Subject: [PATCH 05/25] main.nf.test --- .../functional_annotation/tests/main.nf.test | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test b/subworkflows/local/functional_annotation/tests/main.nf.test index 5afc764..684f224 100644 --- a/subworkflows/local/functional_annotation/tests/main.nf.test +++ b/subworkflows/local/functional_annotation/tests/main.nf.test @@ -2,21 +2,26 @@ nextflow_subworkflow { name "Test Subworkflow FUNCTIONAL_ANNOTATION" script "../main.nf" - config "./nextflow.config" workflow "FUNCTIONAL_ANNOTATION" - test("Should run functional annotation with InterProScan") { + tag "subworkflows" + tag "subworkflows_local" + tag "subworkflows/functional_annotation" + + test("Test functional annotation with single fasta") { when { + params { + pipelines_testdata_base_path = "https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/" + } workflow { """ - input[0] = [ - [ id:'test' ], // meta map - file(params.test_data['sarscov2']['genome']['proteome_fasta'], checkIfExists: true) - ] - input[1] = true // skip_interproscan (set to true to avoid heavy DB download) - input[2] = 'https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealignment/testdata/dummy_db.tar.gz' - input[3] = null // interproscan_db + input[0] = Channel.fromList([ + [ [ id:'test' ], file(params.pipelines_testdata_base_path + 'proteinannotator/reference/snap25_isoforms_bc12_ced9.fasta', checkIfExists: true) ] + ]) + input[1] = true + input[2] = null + input[3] = null """ } } From 0f1090e50cc03441729166afed4052476080bb12 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 16:57:41 +0530 Subject: [PATCH 06/25] meta.yml --- .../local/functional_annotation/meta.yml | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/subworkflows/local/functional_annotation/meta.yml b/subworkflows/local/functional_annotation/meta.yml index 6592668..7d70746 100644 --- a/subworkflows/local/functional_annotation/meta.yml +++ b/subworkflows/local/functional_annotation/meta.yml @@ -1,22 +1,17 @@ -# yaml-name: "functional_annotation" -description: Annotate amino acid fasta files with functional databases using InterProScan +name: "functional_annotation" +description: Functional annotation of proteins using InterProScan keywords: - fasta - - sequences - - functional - annotation - - database - - interproscan + - functional components: - - aria2 - - untar - interproscan input: - ch_fasta: type: file - description: | - Amino acid fasta file containing amino acid sequences for annotation - Structure: [ val(meta), [ path(fasta) ] ] + description: The input channel containing the fasta files + Structure: [ val(meta), path(fasta) ] + pattern: "*.{fa,fasta,fa.gz,fasta.gz}" - skip_interproscan: type: boolean description: Skip functional annotation with InterProScan @@ -25,19 +20,19 @@ input: description: URL to download the InterProScan database - interproscan_db: type: string - description: Path to an existing InterProScan library on the system. If provided, the ARIA2 download will be skipped. + description: Path to an existing InterProScan library output: - interproscan_tsv: type: file - description: TSV files with InterProScan functional annotation for input amino acid sequences + description: TSV files with InterProScan functional annotation pattern: "*.tsv" - versions: type: file - description: Versions file containing the software versions used in the workflow + description: File containing software versions + Structure: [ path(versions.yml) ] pattern: "versions.yml" authors: - - "@vagkaratzas" - "@Muskan" maintainers: + - "@Muskan" - "@vagkaratzas" - From e5c1c4defd099d704dc7145b411b01bd899479ac Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 17:05:53 +0530 Subject: [PATCH 07/25] main.nf.test --- subworkflows/local/functional_annotation/tests/main.nf.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test b/subworkflows/local/functional_annotation/tests/main.nf.test index 684f224..2a581de 100644 --- a/subworkflows/local/functional_annotation/tests/main.nf.test +++ b/subworkflows/local/functional_annotation/tests/main.nf.test @@ -1,4 +1,4 @@ -nextflow_subworkflow { +nextflow_workflow { name "Test Subworkflow FUNCTIONAL_ANNOTATION" script "../main.nf" From c502cc446e8188def9a8d7d63ec034872bd4216e Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 17:09:48 +0530 Subject: [PATCH 08/25] meta.yml --- subworkflows/local/functional_annotation/meta.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subworkflows/local/functional_annotation/meta.yml b/subworkflows/local/functional_annotation/meta.yml index 7d70746..429fed1 100644 --- a/subworkflows/local/functional_annotation/meta.yml +++ b/subworkflows/local/functional_annotation/meta.yml @@ -6,11 +6,13 @@ keywords: - functional components: - interproscan + - aria2 + - untar input: - ch_fasta: type: file description: The input channel containing the fasta files - Structure: [ val(meta), path(fasta) ] + structure: [ val(meta), path(fasta) ] pattern: "*.{fa,fasta,fa.gz,fasta.gz}" - skip_interproscan: type: boolean @@ -25,11 +27,12 @@ output: - interproscan_tsv: type: file description: TSV files with InterProScan functional annotation + structure: [ val(meta), path(tsv) ] pattern: "*.tsv" - versions: type: file description: File containing software versions - Structure: [ path(versions.yml) ] + structure: [ path(versions.yml) ] pattern: "versions.yml" authors: - "@Muskan" From 59e55248c81f22783de136459ee3b090eb421461 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 17:13:21 +0530 Subject: [PATCH 09/25] main.nf.test --- .../local/functional_annotation/tests/main.nf.test | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test b/subworkflows/local/functional_annotation/tests/main.nf.test index 2a581de..cb01430 100644 --- a/subworkflows/local/functional_annotation/tests/main.nf.test +++ b/subworkflows/local/functional_annotation/tests/main.nf.test @@ -19,9 +19,9 @@ nextflow_workflow { input[0] = Channel.fromList([ [ [ id:'test' ], file(params.pipelines_testdata_base_path + 'proteinannotator/reference/snap25_isoforms_bc12_ced9.fasta', checkIfExists: true) ] ]) - input[1] = true - input[2] = null - input[3] = null + input[1] = true // skip_interproscan + input[2] = 'https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealignment/testdata/dummy_db.tar.gz' + input[3] = null // interproscan_db """ } } @@ -29,7 +29,8 @@ nextflow_workflow { then { assertAll( { assert workflow.success }, - { assert snapshot(workflow.out).match() } + // This checks that the output exists and matches our mock snapshot + { assert snapshot(workflow.out.interproscan_tsv, workflow.out.versions).match() } ) } } From fb9b08f2ce0f8b744723eb2eca27a7388bb7d655 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 17:28:43 +0530 Subject: [PATCH 10/25] meta.yml --- .../local/functional_annotation/meta.yml | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/subworkflows/local/functional_annotation/meta.yml b/subworkflows/local/functional_annotation/meta.yml index 429fed1..9f61790 100644 --- a/subworkflows/local/functional_annotation/meta.yml +++ b/subworkflows/local/functional_annotation/meta.yml @@ -1,41 +1,42 @@ name: "functional_annotation" -description: Functional annotation of proteins using InterProScan +description: Performs functional annotation of protein sequences, specifically using InterProScan with automated database download/extraction. keywords: - - fasta - annotation - - functional -components: - interproscan - - aria2 - - untar + - proteomics + - proteins +components: + - aria2/main + - untar/main + - interproscan/main + input: - ch_fasta: - type: file - description: The input channel containing the fasta files - structure: [ val(meta), path(fasta) ] - pattern: "*.{fa,fasta,fa.gz,fasta.gz}" + type: list + description: | + List of [ meta, fasta ] + meta: Groovy Map containing sample information (e.g. [ id:'test' ]) + fasta: Protein FASTA file to be annotated - skip_interproscan: type: boolean - description: Skip functional annotation with InterProScan + description: Set to true to skip the InterProScan annotation process. - interproscan_db_url: type: string - description: URL to download the InterProScan database + description: Remote URL to download the InterProScan database if not provided locally. - interproscan_db: type: string - description: Path to an existing InterProScan library + description: Path to a local InterProScan database directory. + output: - interproscan_tsv: type: file - description: TSV files with InterProScan functional annotation - structure: [ val(meta), path(tsv) ] - pattern: "*.tsv" + description: TSV file containing the functional annotation results from InterProScan. + pattern: "*.{tsv}" - versions: type: file - description: File containing software versions - structure: [ path(versions.yml) ] + description: File containing software versions. pattern: "versions.yml" + authors: + - "@Muskan" - "@Muskan" -maintainers: - - "@Muskan" - - "@vagkaratzas" From 83d283b3878648d4af23d2ba7ba260289fd3bebb Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 20:12:45 +0530 Subject: [PATCH 11/25] main.nf.test --- .../functional_annotation/tests/main.nf.test | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test b/subworkflows/local/functional_annotation/tests/main.nf.test index cb01430..433d11d 100644 --- a/subworkflows/local/functional_annotation/tests/main.nf.test +++ b/subworkflows/local/functional_annotation/tests/main.nf.test @@ -4,33 +4,27 @@ nextflow_workflow { script "../main.nf" workflow "FUNCTIONAL_ANNOTATION" - tag "subworkflows" - tag "subworkflows_local" - tag "subworkflows/functional_annotation" - - test("Test functional annotation with single fasta") { + test("Should run InterProScan annotation successfully") { when { - params { - pipelines_testdata_base_path = "https://raw.githubusercontent.com/nf-core/test-datasets/refs/heads/" - } workflow { - """ - input[0] = Channel.fromList([ - [ [ id:'test' ], file(params.pipelines_testdata_base_path + 'proteinannotator/reference/snap25_isoforms_bc12_ced9.fasta', checkIfExists: true) ] - ]) - input[1] = true // skip_interproscan - input[2] = 'https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealignment/testdata/dummy_db.tar.gz' - input[3] = null // interproscan_db - """ + /* Setting up the inputs based on your main.nf: + input[0] = ch_fasta + input[1] = skip_interproscan (boolean) + input[2] = interproscan_db_url (string) + input[3] = interproscan_db (string/null) + */ + input[0] = Channel.of([ [ id:'test' ], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]) + input[1] = false + input[2] = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/genome/genome.fasta' // Replace with a real small DB URL if available + input[3] = [] } } then { assertAll( { assert workflow.success }, - // This checks that the output exists and matches our mock snapshot - { assert snapshot(workflow.out.interproscan_tsv, workflow.out.versions).match() } + { assert snapshot(workflow.out).match() } ) } } From 2addcaee5d3f226b53de11aa325b12ab45756d44 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 20:15:29 +0530 Subject: [PATCH 12/25] Delete subworkflows/local/functional_annotation/tests/main.nf.test.snap --- .../local/functional_annotation/tests/main.nf.test.snap | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 subworkflows/local/functional_annotation/tests/main.nf.test.snap diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test.snap b/subworkflows/local/functional_annotation/tests/main.nf.test.snap deleted file mode 100644 index c14120b..0000000 --- a/subworkflows/local/functional_annotation/tests/main.nf.test.snap +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Should run functional annotation with InterProScan": { - "content": [ - - ], - "timestamp": "2026-03-13T12:00:00" - } -} From ae648927ca9c7960d2f1ad789115bf89793629d1 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 20:16:13 +0530 Subject: [PATCH 13/25] Delete subworkflows/local/functional_annotation/tests/nextflow.config --- .../local/functional_annotation/tests/nextflow.config | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 subworkflows/local/functional_annotation/tests/nextflow.config diff --git a/subworkflows/local/functional_annotation/tests/nextflow.config b/subworkflows/local/functional_annotation/tests/nextflow.config deleted file mode 100644 index d4fa9aa..0000000 --- a/subworkflows/local/functional_annotation/tests/nextflow.config +++ /dev/null @@ -1,10 +0,0 @@ -params { - // This defines the test dataset location for the subworkflow - test_data = [ - 'sarscov2': [ - 'genome': [ - 'proteome_fasta': 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/genome/proteome.fasta' - ] - ] - ] -} From b28f4ac055d3324e8cc22db29bd615a591179af3 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 21:28:36 +0530 Subject: [PATCH 14/25] meta.yml --- .../local/functional_annotation/meta.yml | 54 ++++++++++++------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/subworkflows/local/functional_annotation/meta.yml b/subworkflows/local/functional_annotation/meta.yml index 9f61790..b712c0f 100644 --- a/subworkflows/local/functional_annotation/meta.yml +++ b/subworkflows/local/functional_annotation/meta.yml @@ -1,42 +1,60 @@ -name: "functional_annotation" -description: Performs functional annotation of protein sequences, specifically using InterProScan with automated database download/extraction. +name: functional_annotation +description: | + Performs functional annotation of protein sequences using InterProScan. + Optionally downloads and extracts the InterProScan database automatically + using ARIA2 and UNTAR if no local database is provided. keywords: - annotation + - functional - interproscan - - proteomics - proteins + - fasta + components: - - aria2/main - - untar/main - - interproscan/main + - aria2 + - untar + - interproscan input: - ch_fasta: - type: list + type: file description: | - List of [ meta, fasta ] - meta: Groovy Map containing sample information (e.g. [ id:'test' ]) - fasta: Protein FASTA file to be annotated + Channel containing FASTA files to be annotated. + Structure: [ val(meta), [ path(fasta) ] ] + pattern: "*.{fa,fasta,faa}" - skip_interproscan: type: boolean - description: Set to true to skip the InterProScan annotation process. + description: | + Flag to skip the InterProScan annotation step entirely. - interproscan_db_url: type: string - description: Remote URL to download the InterProScan database if not provided locally. + description: | + URL to download the InterProScan database archive. + Used only when skip_interproscan is false and interproscan_db is not provided. - interproscan_db: type: string - description: Path to a local InterProScan database directory. + 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 the functional annotation results from InterProScan. - pattern: "*.{tsv}" + description: | + TSV file containing InterProScan functional annotation results. + Structure: [ val(meta), path(tsv) ] + pattern: "*.tsv" - versions: type: file - description: File containing software versions. + description: | + File containing software versions for all tools used in the workflow. + Structure: [ path(versions.yml) ] pattern: "versions.yml" authors: - - "@Muskan" - - "@Muskan" + - "@vagkaratzas" + - "@Muskan-2464 +maintainers: + - "@vagkaratzas" + + From 9a4eb922f09e1f633618a7eebf9f81b1f0dc3981 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 21:34:18 +0530 Subject: [PATCH 15/25] main.nf.test --- .../functional_annotation/tests/main.nf.test | 114 ++++++++++++++++-- 1 file changed, 102 insertions(+), 12 deletions(-) diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test b/subworkflows/local/functional_annotation/tests/main.nf.test index 433d11d..d74a81b 100644 --- a/subworkflows/local/functional_annotation/tests/main.nf.test +++ b/subworkflows/local/functional_annotation/tests/main.nf.test @@ -1,31 +1,121 @@ nextflow_workflow { - name "Test Subworkflow FUNCTIONAL_ANNOTATION" + name "Test Workflow FUNCTIONAL_ANNOTATION" script "../main.nf" workflow "FUNCTIONAL_ANNOTATION" + tag "subworkflows" + tag "subworkflows_local" + tag "functional_annotation" - test("Should run InterProScan annotation successfully") { + + // TEST 1: Run with a pre-existing local InterProScan DB + + test("fasta - skip_interproscan false - local db") { when { workflow { - /* Setting up the inputs based on your main.nf: - input[0] = ch_fasta - input[1] = skip_interproscan (boolean) - input[2] = interproscan_db_url (string) - input[3] = interproscan_db (string/null) - */ - input[0] = Channel.of([ [ id:'test' ], file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]) + """ + 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] = false - input[2] = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/genome/genome.fasta' // Replace with a real small DB URL if available - input[3] = [] + input[2] = null + input[3] = file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/interproscan_db', checkIfExists: true) + """ } } then { assertAll( { assert workflow.success }, - { assert snapshot(workflow.out).match() } + { assert snapshot(workflow.out.interproscan_tsv).match("interproscan_tsv_local_db") }, + { assert snapshot(workflow.out.versions).match("versions_local_db") } + ) + } + } + + + // TEST 2: Run with DB download via ARIA2 + UNTAR + + test("fasta - skip_interproscan false - download db") { + + 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] = false + input[2] = "https://ftp.ebi.ac.uk/pub/databases/interpro/releases/5.62-94.0/alt/interproscan-data-5.62-94.0.tar.gz" + input[3] = null + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out.interproscan_tsv).match("interproscan_tsv_download_db") }, + { assert snapshot(workflow.out.versions).match("versions_download_db") } + ) + } + } + + + // TEST 3: Skip InterProScan entirely + 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 + input[2] = null + input[3] = null + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert workflow.out.interproscan_tsv == [] }, + { assert snapshot(workflow.out.versions).match("versions_skip") } + ) + } + } + + + // TEST 4: Stub run + test("fasta - skip_interproscan false - local db - 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] = false + input[2] = null + input[3] = file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/interproscan_db', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot(workflow.out).match("stub") } ) } } } + From 0af79b754249ec937068bdba0f36a35b483951c0 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 21:37:22 +0530 Subject: [PATCH 16/25] main.nf.test --- subworkflows/local/functional_annotation/tests/main.nf.test | 1 - 1 file changed, 1 deletion(-) diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test b/subworkflows/local/functional_annotation/tests/main.nf.test index d74a81b..cb70400 100644 --- a/subworkflows/local/functional_annotation/tests/main.nf.test +++ b/subworkflows/local/functional_annotation/tests/main.nf.test @@ -118,4 +118,3 @@ nextflow_workflow { } } } - From 22b90c8630714ce6882a7d6219cb87a9ba9b50fa Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 22:19:42 +0530 Subject: [PATCH 17/25] main.nf.test --- .../functional_annotation/tests/main.nf.test | 88 ++++--------------- 1 file changed, 15 insertions(+), 73 deletions(-) diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test b/subworkflows/local/functional_annotation/tests/main.nf.test index cb70400..e3608ee 100644 --- a/subworkflows/local/functional_annotation/tests/main.nf.test +++ b/subworkflows/local/functional_annotation/tests/main.nf.test @@ -4,79 +4,21 @@ nextflow_workflow { script "../main.nf" workflow "FUNCTIONAL_ANNOTATION" tag "subworkflows" - tag "subworkflows_local" tag "functional_annotation" - - // TEST 1: Run with a pre-existing local InterProScan DB - - test("fasta - skip_interproscan false - local db") { - - 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] = false - input[2] = null - input[3] = file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/interproscan_db', checkIfExists: true) - """ - } - } - - then { - assertAll( - { assert workflow.success }, - { assert snapshot(workflow.out.interproscan_tsv).match("interproscan_tsv_local_db") }, - { assert snapshot(workflow.out.versions).match("versions_local_db") } - ) - } - } - - - // TEST 2: Run with DB download via ARIA2 + UNTAR - - test("fasta - skip_interproscan false - download db") { - - 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] = false - input[2] = "https://ftp.ebi.ac.uk/pub/databases/interpro/releases/5.62-94.0/alt/interproscan-data-5.62-94.0.tar.gz" - input[3] = null - """ - } - } - - then { - assertAll( - { assert workflow.success }, - { assert snapshot(workflow.out.interproscan_tsv).match("interproscan_tsv_download_db") }, - { assert snapshot(workflow.out.versions).match("versions_download_db") } - ) - } - } - - - // TEST 3: Skip InterProScan entirely - test("fasta - skip_interproscan true") { + test("skip interproscan - no db needed") { 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) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', + checkIfExists: true) ]) - input[1] = true - input[2] = null - input[3] = null + input[1] = true + input[2] = [] + input[3] = [] """ } } @@ -84,15 +26,14 @@ nextflow_workflow { then { assertAll( { assert workflow.success }, - { assert workflow.out.interproscan_tsv == [] }, - { assert snapshot(workflow.out.versions).match("versions_skip") } + { assert workflow.out.interproscan_tsv == [] }, + { assert workflow.out.versions == [] } ) } } - - // TEST 4: Stub run - test("fasta - skip_interproscan false - local db - stub") { + // Stub test - no real DB download + test("stub run - local db") { options "-stub" @@ -101,11 +42,12 @@ nextflow_workflow { """ input[0] = Channel.of([ [ id:'test_sample' ], - file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', + checkIfExists: true) ]) input[1] = false - input[2] = null - input[3] = file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/interproscan_db', checkIfExists: true) + input[2] = [] + input[3] = [] """ } } @@ -113,7 +55,7 @@ nextflow_workflow { then { assertAll( { assert workflow.success }, - { assert snapshot(workflow.out).match("stub") } + { assert snapshot(workflow.out).match() } ) } } From 4b78ba7c61576c4714fdb7c3d3fb896c4ba78bea Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 22:25:31 +0530 Subject: [PATCH 18/25] main.nf.test --- subworkflows/local/functional_annotation/tests/main.nf.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test b/subworkflows/local/functional_annotation/tests/main.nf.test index e3608ee..5024d54 100644 --- a/subworkflows/local/functional_annotation/tests/main.nf.test +++ b/subworkflows/local/functional_annotation/tests/main.nf.test @@ -6,7 +6,8 @@ nextflow_workflow { tag "subworkflows" tag "functional_annotation" - test("skip interproscan - no db needed") { + test("stub run - skip interproscan ") { + options "-stub" when { workflow { From 672c59780322574aa1461fc51690132935d7ef9d Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 22:31:58 +0530 Subject: [PATCH 19/25] main.nf.test --- .../functional_annotation/tests/main.nf.test | 58 +++++++++++++++---- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test b/subworkflows/local/functional_annotation/tests/main.nf.test index 5024d54..dbf5735 100644 --- a/subworkflows/local/functional_annotation/tests/main.nf.test +++ b/subworkflows/local/functional_annotation/tests/main.nf.test @@ -4,10 +4,13 @@ nextflow_workflow { script "../main.nf" workflow "FUNCTIONAL_ANNOTATION" tag "subworkflows" + tag "subworkflows_local" tag "functional_annotation" - test("stub run - skip interproscan ") { - options "-stub" + // ------------------------------------------------------- + // TEST 1: Skip InterProScan (safest for CI, no DB needed) + // ------------------------------------------------------- + test("fasta - skip_interproscan true") { when { workflow { @@ -17,9 +20,9 @@ nextflow_workflow { file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) ]) - input[1] = true - input[2] = [] - input[3] = [] + input[1] = true // skip_interproscan + input[2] = [] // no url + input[3] = [] // no local db """ } } @@ -27,14 +30,16 @@ nextflow_workflow { then { assertAll( { assert workflow.success }, - { assert workflow.out.interproscan_tsv == [] }, - { assert workflow.out.versions == [] } + { assert workflow.out.interproscan_tsv == [] }, + { assert snapshot(workflow.out.versions).match("versions_skip") } ) } } - // Stub test - no real DB download - test("stub run - local db") { + // ------------------------------------------------------- + // TEST 2: Stub run with skip=false (no real DB download) + // ------------------------------------------------------- + test("fasta - skip_interproscan false - stub") { options "-stub" @@ -47,8 +52,38 @@ nextflow_workflow { checkIfExists: true) ]) input[1] = false + input[2] = "https://ftp.ebi.ac.uk/pub/databases/interpro/releases/5.62-94.0/alt/interproscan-data-5.62-94.0.tar.gz" + 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] = [] + input[3] = [] """ } } @@ -56,7 +91,8 @@ nextflow_workflow { then { assertAll( { assert workflow.success }, - { assert snapshot(workflow.out).match() } + { assert workflow.out.interproscan_tsv == [] }, + { assert snapshot(workflow.out.versions).match("versions_stub_skip") } ) } } From 43ac5183c91bd3dcd1fbfaeb122eb09203222b0f Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 22:53:17 +0530 Subject: [PATCH 20/25] main.nf.test --- .../local/functional_annotation/tests/main.nf.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test b/subworkflows/local/functional_annotation/tests/main.nf.test index dbf5735..c9e1aef 100644 --- a/subworkflows/local/functional_annotation/tests/main.nf.test +++ b/subworkflows/local/functional_annotation/tests/main.nf.test @@ -39,7 +39,7 @@ nextflow_workflow { // ------------------------------------------------------- // TEST 2: Stub run with skip=false (no real DB download) // ------------------------------------------------------- - test("fasta - skip_interproscan false - stub") { + test("stub run - skip interproscan") { options "-stub" @@ -51,8 +51,8 @@ nextflow_workflow { file(params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true) ]) - input[1] = false - input[2] = "https://ftp.ebi.ac.uk/pub/databases/interpro/releases/5.62-94.0/alt/interproscan-data-5.62-94.0.tar.gz" + input[1] = true + input[2] = [] input[3] = [] """ } @@ -92,7 +92,7 @@ nextflow_workflow { assertAll( { assert workflow.success }, { assert workflow.out.interproscan_tsv == [] }, - { assert snapshot(workflow.out.versions).match("versions_stub_skip") } + { assert workflow.out.versions == [] } ) } } From a8e313dced4eb2a6b71b11ed0307a7e2bbd7b216 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 17:29:34 +0000 Subject: [PATCH 21/25] Add snapshot for functional_annotation --- .../tests/main.nf.test.snap | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 subworkflows/local/functional_annotation/tests/main.nf.test.snap diff --git a/subworkflows/local/functional_annotation/tests/main.nf.test.snap b/subworkflows/local/functional_annotation/tests/main.nf.test.snap new file mode 100644 index 0000000..f4444ca --- /dev/null +++ b/subworkflows/local/functional_annotation/tests/main.nf.test.snap @@ -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" + } +} \ No newline at end of file From b9cf9a34dd2e249fc3dc93332f79e3005675432f Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 23:16:56 +0530 Subject: [PATCH 22/25] meta.yml --- subworkflows/local/functional_annotation/meta.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/subworkflows/local/functional_annotation/meta.yml b/subworkflows/local/functional_annotation/meta.yml index b712c0f..1d1ec53 100644 --- a/subworkflows/local/functional_annotation/meta.yml +++ b/subworkflows/local/functional_annotation/meta.yml @@ -1,8 +1,5 @@ name: functional_annotation -description: | - Performs functional annotation of protein sequences using InterProScan. - Optionally downloads and extracts the InterProScan database automatically - using ARIA2 and UNTAR if no local database is provided. +description: Performs functional annotation of protien sequences keywords: - annotation - functional From e9105dc76828cdbb4b8d36188bb3bc50f262d7b3 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 23:24:47 +0530 Subject: [PATCH 23/25] meta.yml --- .../local/functional_annotation/meta.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/subworkflows/local/functional_annotation/meta.yml b/subworkflows/local/functional_annotation/meta.yml index 1d1ec53..e826d46 100644 --- a/subworkflows/local/functional_annotation/meta.yml +++ b/subworkflows/local/functional_annotation/meta.yml @@ -15,36 +15,30 @@ components: input: - ch_fasta: type: file - description: | - Channel containing FASTA files to be annotated. + description: Channel containing FASTA files to be annotated. Structure: [ val(meta), [ path(fasta) ] ] pattern: "*.{fa,fasta,faa}" - skip_interproscan: type: boolean - description: | - Flag to skip the InterProScan annotation step entirely. + description: Flag to skip the InterProScan annotation step entirely. - interproscan_db_url: type: string - description: | - URL to download the InterProScan database archive. + description: URL to download the InterProScan database archive. Used only when skip_interproscan is false and interproscan_db is not provided. - interproscan_db: type: string - description: | - Path to a pre-existing local InterProScan database directory. + 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. + 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. + description: File containing software versions for all tools used in the workflow. Structure: [ path(versions.yml) ] pattern: "versions.yml" From adbae4314750bcf024c5ca9d03152fe62f69d8f3 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 23:37:15 +0530 Subject: [PATCH 24/25] meta.yml --- subworkflows/local/functional_annotation/meta.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/subworkflows/local/functional_annotation/meta.yml b/subworkflows/local/functional_annotation/meta.yml index e826d46..0c80089 100644 --- a/subworkflows/local/functional_annotation/meta.yml +++ b/subworkflows/local/functional_annotation/meta.yml @@ -16,7 +16,6 @@ input: - ch_fasta: type: file description: Channel containing FASTA files to be annotated. - Structure: [ val(meta), [ path(fasta) ] ] pattern: "*.{fa,fasta,faa}" - skip_interproscan: type: boolean @@ -24,7 +23,6 @@ input: - interproscan_db_url: type: string description: URL to download the InterProScan database archive. - Used only when skip_interproscan is false and interproscan_db is not provided. - interproscan_db: type: string description: Path to a pre-existing local InterProScan database directory. From 95c9f0c59a768a7977580f26222985788845d474 Mon Sep 17 00:00:00 2001 From: MUSKAN <615muskanyadav@gmail.com> Date: Fri, 13 Mar 2026 18:29:25 +0000 Subject: [PATCH 25/25] Fix trailing whitespace in meta.yml --- subworkflows/local/functional_annotation/meta.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/subworkflows/local/functional_annotation/meta.yml b/subworkflows/local/functional_annotation/meta.yml index 0c80089..5b682ee 100644 --- a/subworkflows/local/functional_annotation/meta.yml +++ b/subworkflows/local/functional_annotation/meta.yml @@ -1,5 +1,5 @@ name: functional_annotation -description: Performs functional annotation of protien sequences +description: Performs functional annotation of protien sequences keywords: - annotation - functional @@ -45,5 +45,3 @@ authors: - "@Muskan-2464 maintainers: - "@vagkaratzas" - -