From 6cf01ef069fcf0203a7b9a27c031836a66ebda71 Mon Sep 17 00:00:00 2001 From: trangdo Date: Tue, 28 Oct 2025 16:41:17 +0100 Subject: [PATCH 1/8] Hackathon - Add vembrane filter module --- .../nf-core/vembrane/filter/environment.yml | 10 ++ modules/nf-core/vembrane/filter/main.nf | 75 ++++++++++++ modules/nf-core/vembrane/filter/meta.yml | 62 ++++++++++ .../vembrane/filter/tests/main.nf.test | 110 ++++++++++++++++++ 4 files changed, 257 insertions(+) create mode 100644 modules/nf-core/vembrane/filter/environment.yml create mode 100644 modules/nf-core/vembrane/filter/main.nf create mode 100644 modules/nf-core/vembrane/filter/meta.yml create mode 100644 modules/nf-core/vembrane/filter/tests/main.nf.test diff --git a/modules/nf-core/vembrane/filter/environment.yml b/modules/nf-core/vembrane/filter/environment.yml new file mode 100644 index 000000000000..a33c9cdff966 --- /dev/null +++ b/modules/nf-core/vembrane/filter/environment.yml @@ -0,0 +1,10 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + # TODO nf-core: List required Conda package(s). + # Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10"). + # For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems. + - "bioconda::vembrane=2.4.0" diff --git a/modules/nf-core/vembrane/filter/main.nf b/modules/nf-core/vembrane/filter/main.nf new file mode 100644 index 000000000000..70f06410f890 --- /dev/null +++ b/modules/nf-core/vembrane/filter/main.nf @@ -0,0 +1,75 @@ +// TODO nf-core: If in doubt look at other nf-core/modules to see how we are doing things! :) +// https://github.com/nf-core/modules/tree/master/modules/nf-core/ +// You can also ask for help via your pull request or on the #modules channel on the nf-core Slack workspace: +// https://nf-co.re/join +// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. +// All other parameters MUST be provided using the "task.ext" directive, see here: +// https://www.nextflow.io/docs/latest/process.html#ext +// where "task.ext" is a string. +// Any parameters that need to be evaluated in the context of a particular sample +// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. +// TODO nf-core: Software that can be piped together SHOULD be added to separate module files +// unless there is a run-time, storage advantage in implementing in this way +// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: +// bwa mem | samtools view -B -T ref.fasta +// TODO nf-core: Optional inputs are not currently supported by Nextflow. However, using an empty +// list (`[]`) instead of a file can be used to work around this issue. + +process VEMBRANE_FILTER { + tag "$meta.id" + label 'process_single' + + // TODO nf-core: See section in main README for further information regarding finding and adding container addresses to the section below. + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/YOUR-TOOL-HERE': + 'biocontainers/vembrane:2.4.0--pyhdfd78af_0' }" + // container "quay.io/biocontainers/vembrane:2.4.0--pyhdfd78af_0" + + input: + tuple val(meta), path(variant) + val(expression) + + output: + tuple val(meta), path("*.{vcf,bcf,vcf.gz,bcf.gz}"), emit: filtered_variant + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + vembrane filter \\ + ${args} \\ + ${expression} \\ + -o ${prefix}_filtered.vcf \\ + $variant + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vembrane: \$(vembrane --version) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + echo $args + + vembrane filter \\ + ${args} \\ + ${expression} \\ + -o ${prefix}_filtered.vcf \\ + $variant + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vembrane: \$(vembrane --version) + END_VERSIONS + """ +} diff --git a/modules/nf-core/vembrane/filter/meta.yml b/modules/nf-core/vembrane/filter/meta.yml new file mode 100644 index 000000000000..ab25455c3724 --- /dev/null +++ b/modules/nf-core/vembrane/filter/meta.yml @@ -0,0 +1,62 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +# # TODO nf-core: Add a description of the module and list keywords +name: "vembrane_filter" +description: write your description here +keywords: + - filter + - table + - sort +tools: + ## TODO nf-core: Add a description and other details for the software below + - "vembrane": + description: "Filter VCF/BCF files with Python expressions." + homepage: "https://github.com/vembrane/vembrane/tree/main" + documentation: "https://github.com/vembrane/vembrane/blob/main/docs/filter.md" + tool_dev_url: "https://github.com/vembrane/vembrane.git" + doi: "10.1093/bioinformatics/btac810" + licence: ["MIT"] + identifier: biotools:vembrane/filter + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - variant: + type: file + description: | + Path to the VCF/BCF file to be filtered. + e.g. 'file.vcf', 'file.vcf.gz', 'file.bcf', 'file.bcf.gz' + ontologies: [] + - expression: + type: string + description: | + The filter expression can be any valid python expression that evaluates to a value of type bool. + e.g. 'ANN["SYMBOL"] == "CDH2"' + ontologies: [] + +output: + filtered_variant: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{vcf,bcf,vcf.gz,bcf.gz}": + type: file + description: VCF normalized output file + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + ontologies: [] + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML +authors: + - "@trangdo-hsc" + - "@mkatsanto" +maintainers: + - "@trangdo-hsc" diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test b/modules/nf-core/vembrane/filter/tests/main.nf.test new file mode 100644 index 000000000000..c08e6cc4e862 --- /dev/null +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test @@ -0,0 +1,110 @@ +// TODO nf-core: Once you have added the required tests, please run the following command to build this file: +// nf-core modules test vembrane +nextflow_process { + + name "Test Process VEMBRANE" + script "../main.nf" + process "VEMBRANE_FILTER" + + tag "modules" + tag "modules_nfcore" + tag "vembrane" + tag "vembrane/filter" + + test("homo sapiens - vcf") { + + // + // (the module requires running more than one process to generate the required output) + // add the 'setup' method here. + // You can find more information about how to use a 'setup' method in the docs (https://nf-co.re/docs/contributing/modules#steps-for-creating-nf-test-for-chained-modules). + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true), + ] + input[1] = "'QUAL >= 30'" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.filtered_variant).match() } + ) + } + + } + + test("homo sapiens - vcf.gz") { + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.vcf.gz', checkIfExists: true), + ] + input[1] = "'QUAL >= 30'" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.filtered_variant + ).match() } + ) + } + + } + + test("homo sapiens - bcf") { + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.bcf', checkIfExists: true), + ] + input[1] = "'QUAL >= 30'" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.filtered_variant).match() } + ) + } + + } + +test("homo sapiens - bcf.gz") { + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bcf.gz', checkIfExists: true), + ] + input[1] = "'QUAL >= 30'" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.filtered_variant).match() } + ) + } + + } + +} From 0155088ed26273f5163744e76432cff8813f5aef Mon Sep 17 00:00:00 2001 From: trangdo Date: Tue, 28 Oct 2025 16:51:29 +0100 Subject: [PATCH 2/8] Prepare for merge --- modules/nf-core/vembrane/filter/main.nf | 19 ----- modules/nf-core/vembrane/filter/meta.yml | 2 - .../vembrane/filter/tests/main.nf.test | 2 - .../vembrane/filter/tests/main.nf.test.snap | 74 +++++++++++++++++++ 4 files changed, 74 insertions(+), 23 deletions(-) create mode 100644 modules/nf-core/vembrane/filter/tests/main.nf.test.snap diff --git a/modules/nf-core/vembrane/filter/main.nf b/modules/nf-core/vembrane/filter/main.nf index 70f06410f890..30c283667ed2 100644 --- a/modules/nf-core/vembrane/filter/main.nf +++ b/modules/nf-core/vembrane/filter/main.nf @@ -1,30 +1,11 @@ -// TODO nf-core: If in doubt look at other nf-core/modules to see how we are doing things! :) -// https://github.com/nf-core/modules/tree/master/modules/nf-core/ -// You can also ask for help via your pull request or on the #modules channel on the nf-core Slack workspace: -// https://nf-co.re/join -// TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. -// All other parameters MUST be provided using the "task.ext" directive, see here: -// https://www.nextflow.io/docs/latest/process.html#ext -// where "task.ext" is a string. -// Any parameters that need to be evaluated in the context of a particular sample -// e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. -// TODO nf-core: Software that can be piped together SHOULD be added to separate module files -// unless there is a run-time, storage advantage in implementing in this way -// e.g. it's ok to have a single module for bwa to output BAM instead of SAM: -// bwa mem | samtools view -B -T ref.fasta -// TODO nf-core: Optional inputs are not currently supported by Nextflow. However, using an empty -// list (`[]`) instead of a file can be used to work around this issue. - process VEMBRANE_FILTER { tag "$meta.id" label 'process_single' - // TODO nf-core: See section in main README for further information regarding finding and adding container addresses to the section below. conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/YOUR-TOOL-HERE': 'biocontainers/vembrane:2.4.0--pyhdfd78af_0' }" - // container "quay.io/biocontainers/vembrane:2.4.0--pyhdfd78af_0" input: tuple val(meta), path(variant) diff --git a/modules/nf-core/vembrane/filter/meta.yml b/modules/nf-core/vembrane/filter/meta.yml index ab25455c3724..f88c73913918 100644 --- a/modules/nf-core/vembrane/filter/meta.yml +++ b/modules/nf-core/vembrane/filter/meta.yml @@ -1,5 +1,4 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json -# # TODO nf-core: Add a description of the module and list keywords name: "vembrane_filter" description: write your description here keywords: @@ -7,7 +6,6 @@ keywords: - table - sort tools: - ## TODO nf-core: Add a description and other details for the software below - "vembrane": description: "Filter VCF/BCF files with Python expressions." homepage: "https://github.com/vembrane/vembrane/tree/main" diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test b/modules/nf-core/vembrane/filter/tests/main.nf.test index c08e6cc4e862..ada63541adee 100644 --- a/modules/nf-core/vembrane/filter/tests/main.nf.test +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test @@ -1,5 +1,3 @@ -// TODO nf-core: Once you have added the required tests, please run the following command to build this file: -// nf-core modules test vembrane nextflow_process { name "Test Process VEMBRANE" diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap new file mode 100644 index 000000000000..17ed0c4d251d --- /dev/null +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap @@ -0,0 +1,74 @@ +{ + "homo sapiens - bcf": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,38f3479f9071fbe018226be0aac62354" + ] + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.04.6" + }, + "timestamp": "2025-10-28T16:35:15.82704" + }, + "homo sapiens - vcf.gz": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,44659c255c5018ba2e5a3b4b80797a57" + ] + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.04.6" + }, + "timestamp": "2025-10-28T16:35:10.958678" + }, + "homo sapiens - bcf.gz": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,c9be02b5c5e036c25e05f59a94528203" + ] + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.04.6" + }, + "timestamp": "2025-10-28T16:35:21.012789" + }, + "homo sapiens - vcf": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,20af56305296f2b0e52979465f19804b" + ] + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.04.6" + }, + "timestamp": "2025-10-28T16:35:06.185151" + } +} \ No newline at end of file From 0a600e7f6fa81a3d816c04fe6fd586fa21ee65d9 Mon Sep 17 00:00:00 2001 From: trangdo Date: Tue, 28 Oct 2025 17:10:32 +0100 Subject: [PATCH 3/8] Prepare for merge --- .../nf-core/vembrane/filter/environment.yml | 3 - modules/nf-core/vembrane/filter/main.nf | 2 +- .../vembrane/filter/tests/main.nf.test | 8 +- .../vembrane/filter/tests/main.nf.test.snap | 140 +++++++++++++----- 4 files changed, 109 insertions(+), 44 deletions(-) diff --git a/modules/nf-core/vembrane/filter/environment.yml b/modules/nf-core/vembrane/filter/environment.yml index a33c9cdff966..fc61617b4e79 100644 --- a/modules/nf-core/vembrane/filter/environment.yml +++ b/modules/nf-core/vembrane/filter/environment.yml @@ -4,7 +4,4 @@ channels: - conda-forge - bioconda dependencies: - # TODO nf-core: List required Conda package(s). - # Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10"). - # For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems. - "bioconda::vembrane=2.4.0" diff --git a/modules/nf-core/vembrane/filter/main.nf b/modules/nf-core/vembrane/filter/main.nf index 30c283667ed2..5e56de3830e0 100644 --- a/modules/nf-core/vembrane/filter/main.nf +++ b/modules/nf-core/vembrane/filter/main.nf @@ -4,7 +4,7 @@ process VEMBRANE_FILTER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/YOUR-TOOL-HERE': + 'https://depot.galaxyproject.org/singularity/vembrane:2.4.0--pyhdfd78af_0': 'biocontainers/vembrane:2.4.0--pyhdfd78af_0' }" input: diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test b/modules/nf-core/vembrane/filter/tests/main.nf.test index ada63541adee..4a3e2f364255 100644 --- a/modules/nf-core/vembrane/filter/tests/main.nf.test +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test @@ -31,7 +31,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.filtered_variant).match() } + { assert snapshot(process.out).match() } ) } @@ -54,7 +54,7 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out.filtered_variant + process.out ).match() } ) } @@ -77,7 +77,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.filtered_variant).match() } + { assert snapshot(process.out).match() } ) } @@ -99,7 +99,7 @@ test("homo sapiens - bcf.gz") { then { assertAll( { assert process.success }, - { assert snapshot(process.out.filtered_variant).match() } + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap index 17ed0c4d251d..0bc3b16cf7e5 100644 --- a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap @@ -1,74 +1,142 @@ { "homo sapiens - bcf": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test_filtered.vcf:md5,38f3479f9071fbe018226be0aac62354" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,38f3479f9071fbe018226be0aac62354" + ] + ], + "1": [ + "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + ], + "filtered_variant": [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,38f3479f9071fbe018226be0aac62354" + ] + ], + "versions": [ + "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" ] - ] + } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-10-28T16:35:15.82704" + "timestamp": "2025-10-29T10:40:44.493576" }, "homo sapiens - vcf.gz": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test_filtered.vcf:md5,44659c255c5018ba2e5a3b4b80797a57" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,44659c255c5018ba2e5a3b4b80797a57" + ] + ], + "1": [ + "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + ], + "filtered_variant": [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,44659c255c5018ba2e5a3b4b80797a57" + ] + ], + "versions": [ + "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" ] - ] + } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-10-28T16:35:10.958678" + "timestamp": "2025-10-29T10:40:40.227725" }, "homo sapiens - bcf.gz": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test_filtered.vcf:md5,c9be02b5c5e036c25e05f59a94528203" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,c9be02b5c5e036c25e05f59a94528203" + ] + ], + "1": [ + "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + ], + "filtered_variant": [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,c9be02b5c5e036c25e05f59a94528203" + ] + ], + "versions": [ + "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" ] - ] + } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-10-28T16:35:21.012789" + "timestamp": "2025-10-29T10:40:49.157452" }, "homo sapiens - vcf": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test_filtered.vcf:md5,20af56305296f2b0e52979465f19804b" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,20af56305296f2b0e52979465f19804b" + ] + ], + "1": [ + "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + ], + "filtered_variant": [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,20af56305296f2b0e52979465f19804b" + ] + ], + "versions": [ + "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" ] - ] + } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-10-28T16:35:06.185151" + "timestamp": "2025-10-29T10:40:35.909472" } } \ No newline at end of file From 5d1333fb23d47cea83d36a11f1c149d8fda91f64 Mon Sep 17 00:00:00 2001 From: dhtt Date: Wed, 5 Nov 2025 11:44:55 +0100 Subject: [PATCH 4/8] Format, updates yml, add stub tests to vembrane/filter --- modules/nf-core/vembrane/filter/main.nf | 19 +- modules/nf-core/vembrane/filter/meta.yml | 13 +- .../vembrane/filter/tests/main.nf.test | 114 +++++++++- .../vembrane/filter/tests/main.nf.test.snap | 196 ++++++++++++++---- 4 files changed, 279 insertions(+), 63 deletions(-) diff --git a/modules/nf-core/vembrane/filter/main.nf b/modules/nf-core/vembrane/filter/main.nf index 5e56de3830e0..57d3869cc166 100644 --- a/modules/nf-core/vembrane/filter/main.nf +++ b/modules/nf-core/vembrane/filter/main.nf @@ -13,7 +13,7 @@ process VEMBRANE_FILTER { output: tuple val(meta), path("*.{vcf,bcf,vcf.gz,bcf.gz}"), emit: filtered_variant - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -26,31 +26,24 @@ process VEMBRANE_FILTER { vembrane filter \\ ${args} \\ ${expression} \\ - -o ${prefix}_filtered.vcf \\ - $variant + -o ${prefix}.filtered.vcf \\ + ${variant} cat <<-END_VERSIONS > versions.yml "${task.process}": - vembrane: \$(vembrane --version) + vembrane: \$(vembrane --version | sed '1!d;s/.* //') END_VERSIONS """ stub: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ - echo $args - - vembrane filter \\ - ${args} \\ - ${expression} \\ - -o ${prefix}_filtered.vcf \\ - $variant + touch ${prefix}.filtered.vcf cat <<-END_VERSIONS > versions.yml "${task.process}": - vembrane: \$(vembrane --version) + vembrane: \$(vembrane --version | sed '1!d;s/.* //') END_VERSIONS """ } diff --git a/modules/nf-core/vembrane/filter/meta.yml b/modules/nf-core/vembrane/filter/meta.yml index f88c73913918..2d6767be23cc 100644 --- a/modules/nf-core/vembrane/filter/meta.yml +++ b/modules/nf-core/vembrane/filter/meta.yml @@ -3,8 +3,11 @@ name: "vembrane_filter" description: write your description here keywords: - filter - - table - - sort + - vcf + - bcf + - genomics + - variant + - annotation tools: - "vembrane": description: "Filter VCF/BCF files with Python expressions." @@ -20,7 +23,7 @@ input: type: map description: | Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - variant: type: file description: | @@ -40,10 +43,10 @@ output: type: map description: | Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] + e.g. [ id:'test' ] - "*.{vcf,bcf,vcf.gz,bcf.gz}": type: file - description: VCF normalized output file + description: Filtered VCF output file pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" ontologies: [] versions: diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test b/modules/nf-core/vembrane/filter/tests/main.nf.test index 4a3e2f364255..dff81dc5ea00 100644 --- a/modules/nf-core/vembrane/filter/tests/main.nf.test +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test @@ -11,16 +11,11 @@ nextflow_process { test("homo sapiens - vcf") { - // - // (the module requires running more than one process to generate the required output) - // add the 'setup' method here. - // You can find more information about how to use a 'setup' method in the docs (https://nf-co.re/docs/contributing/modules#steps-for-creating-nf-test-for-chained-modules). - when { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map + [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true), ] input[1] = "'QUAL >= 30'" @@ -42,7 +37,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map + [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.vcf.gz', checkIfExists: true), ] input[1] = "'QUAL >= 30'" @@ -66,7 +61,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map + [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.bcf', checkIfExists: true), ] input[1] = "'QUAL >= 30'" @@ -88,7 +83,7 @@ test("homo sapiens - bcf.gz") { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map + [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bcf.gz', checkIfExists: true), ] input[1] = "'QUAL >= 30'" @@ -105,4 +100,105 @@ test("homo sapiens - bcf.gz") { } + test("homo sapiens - vcf - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true), + ] + input[1] = "'QUAL >= 30'" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo sapiens - vcf.gz - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.vcf.gz', checkIfExists: true), + ] + input[1] = "'QUAL >= 30'" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out + ).match() } + ) + } + + } + + test("homo sapiens - bcf - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.bcf', checkIfExists: true), + ] + input[1] = "'QUAL >= 30'" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +test("homo sapiens - bcf.gz - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bcf.gz', checkIfExists: true), + ] + input[1] = "'QUAL >= 30'" + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } } diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap index 0bc3b16cf7e5..a00a8f3c32fb 100644 --- a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap @@ -5,26 +5,24 @@ "0": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test_filtered.vcf:md5,38f3479f9071fbe018226be0aac62354" + "test.filtered.vcf:md5,6c1393e34fc3ffe763b7c75725176463" ] ], "1": [ - "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], "filtered_variant": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test_filtered.vcf:md5,38f3479f9071fbe018226be0aac62354" + "test.filtered.vcf:md5,6c1393e34fc3ffe763b7c75725176463" ] ], "versions": [ - "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } ], @@ -32,7 +30,40 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-10-29T10:40:44.493576" + "timestamp": "2025-11-05T11:14:07.57913" + }, + "homo sapiens - bcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" + ], + "filtered_variant": [ + [ + { + "id": "test" + }, + "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.04.6" + }, + "timestamp": "2025-11-05T11:14:22.290473" }, "homo sapiens - vcf.gz": { "content": [ @@ -40,26 +71,57 @@ "0": [ [ { - "id": "test", - "single_end": false + "id": "test" + }, + "test.filtered.vcf:md5,75cc37af6bc118370251fee6ab1532ee" + ] + ], + "1": [ + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" + ], + "filtered_variant": [ + [ + { + "id": "test" + }, + "test.filtered.vcf:md5,75cc37af6bc118370251fee6ab1532ee" + ] + ], + "versions": [ + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.04.6" + }, + "timestamp": "2025-11-05T11:14:03.41245" + }, + "homo sapiens - vcf.gz - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" }, - "test_filtered.vcf:md5,44659c255c5018ba2e5a3b4b80797a57" + "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ - "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], "filtered_variant": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test_filtered.vcf:md5,44659c255c5018ba2e5a3b4b80797a57" + "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ - "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } ], @@ -67,7 +129,40 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-10-29T10:40:40.227725" + "timestamp": "2025-11-05T11:14:18.955755" + }, + "homo sapiens - bcf.gz - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" + ], + "filtered_variant": [ + [ + { + "id": "test" + }, + "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.04.6" + }, + "timestamp": "2025-11-05T11:14:26.669552" }, "homo sapiens - bcf.gz": { "content": [ @@ -75,26 +170,24 @@ "0": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test_filtered.vcf:md5,c9be02b5c5e036c25e05f59a94528203" + "test.filtered.vcf:md5,71c159f1c953e33c94ad6fd5efbf719b" ] ], "1": [ - "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], "filtered_variant": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test_filtered.vcf:md5,c9be02b5c5e036c25e05f59a94528203" + "test.filtered.vcf:md5,71c159f1c953e33c94ad6fd5efbf719b" ] ], "versions": [ - "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } ], @@ -102,7 +195,7 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-10-29T10:40:49.157452" + "timestamp": "2025-11-05T11:14:12.225232" }, "homo sapiens - vcf": { "content": [ @@ -110,26 +203,57 @@ "0": [ [ { - "id": "test", - "single_end": false + "id": "test" + }, + "test.filtered.vcf:md5,116c742876dd0ab00a936178f1da9c86" + ] + ], + "1": [ + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" + ], + "filtered_variant": [ + [ + { + "id": "test" + }, + "test.filtered.vcf:md5,116c742876dd0ab00a936178f1da9c86" + ] + ], + "versions": [ + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.04.6" + }, + "timestamp": "2025-11-05T11:13:59.313832" + }, + "homo sapiens - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" }, - "test_filtered.vcf:md5,20af56305296f2b0e52979465f19804b" + "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ - "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], "filtered_variant": [ [ { - "id": "test", - "single_end": false + "id": "test" }, - "test_filtered.vcf:md5,20af56305296f2b0e52979465f19804b" + "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ - "versions.yml:md5,78268fef6c3acebb6a431844197f42d5" + "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } ], @@ -137,6 +261,6 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-10-29T10:40:35.909472" + "timestamp": "2025-11-05T11:14:15.550717" } } \ No newline at end of file From f93e871edd8b9074f70b81b5f2a3fd5a7592374b Mon Sep 17 00:00:00 2001 From: trangdo Date: Tue, 28 Oct 2025 16:51:29 +0100 Subject: [PATCH 5/8] Prepare for merge --- .../vembrane/filter/tests/main.nf.test.snap | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap index a00a8f3c32fb..b8bafaf65470 100644 --- a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap @@ -1,6 +1,7 @@ { "homo sapiens - bcf": { "content": [ +<<<<<<< HEAD { "0": [ [ @@ -25,11 +26,23 @@ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } +======= + [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,38f3479f9071fbe018226be0aac62354" + ] + ] +>>>>>>> 0462840dd (Prepare for merge) ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, +<<<<<<< HEAD "timestamp": "2025-11-05T11:14:07.57913" }, "homo sapiens - bcf - stub": { @@ -91,11 +104,27 @@ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } +======= + "timestamp": "2025-10-28T16:35:15.82704" + }, + "homo sapiens - vcf.gz": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,44659c255c5018ba2e5a3b4b80797a57" + ] + ] +>>>>>>> 0462840dd (Prepare for merge) ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, +<<<<<<< HEAD "timestamp": "2025-11-05T11:14:03.41245" }, "homo sapiens - vcf.gz - stub": { @@ -190,11 +219,27 @@ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } +======= + "timestamp": "2025-10-28T16:35:10.958678" + }, + "homo sapiens - bcf.gz": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,c9be02b5c5e036c25e05f59a94528203" + ] + ] +>>>>>>> 0462840dd (Prepare for merge) ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, +<<<<<<< HEAD "timestamp": "2025-11-05T11:14:12.225232" }, "homo sapiens - vcf": { @@ -223,11 +268,27 @@ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } +======= + "timestamp": "2025-10-28T16:35:21.012789" + }, + "homo sapiens - vcf": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_filtered.vcf:md5,20af56305296f2b0e52979465f19804b" + ] + ] +>>>>>>> 0462840dd (Prepare for merge) ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, +<<<<<<< HEAD "timestamp": "2025-11-05T11:13:59.313832" }, "homo sapiens - vcf - stub": { @@ -262,5 +323,8 @@ "nextflow": "25.04.6" }, "timestamp": "2025-11-05T11:14:15.550717" +======= + "timestamp": "2025-10-28T16:35:06.185151" +>>>>>>> 0462840dd (Prepare for merge) } } \ No newline at end of file From 7d199da2aadbb6b2e35f5267680c05a888b2fcab Mon Sep 17 00:00:00 2001 From: trangdo Date: Tue, 28 Oct 2025 17:10:32 +0100 Subject: [PATCH 6/8] Prepare for merge --- .pre-commit-config.yaml | 4 +- .../vembrane/filter/tests/main.nf.test.snap | 64 ------------------- 2 files changed, 3 insertions(+), 65 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f830d97d1f3..712daf3dec21 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,13 @@ repos: - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.1.0" + rev: "v4.0.0-alpha.8" hooks: - id: prettier additional_dependencies: - prettier@3.6.2 - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 rev: v6.0.0 hooks: - id: trailing-whitespace @@ -51,6 +52,7 @@ repos: - id: ruff-format # formatter # NOTE This runs with Docker instead of the binary. Hoping anyone messing with Dockerfiles has Docker installed - repo: https://github.com/hadolint/hadolint + rev: v2.14.0 rev: v2.14.0 hooks: - id: hadolint-docker diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap index b8bafaf65470..a00a8f3c32fb 100644 --- a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap @@ -1,7 +1,6 @@ { "homo sapiens - bcf": { "content": [ -<<<<<<< HEAD { "0": [ [ @@ -26,23 +25,11 @@ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } -======= - [ - [ - { - "id": "test", - "single_end": false - }, - "test_filtered.vcf:md5,38f3479f9071fbe018226be0aac62354" - ] - ] ->>>>>>> 0462840dd (Prepare for merge) ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, -<<<<<<< HEAD "timestamp": "2025-11-05T11:14:07.57913" }, "homo sapiens - bcf - stub": { @@ -104,27 +91,11 @@ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } -======= - "timestamp": "2025-10-28T16:35:15.82704" - }, - "homo sapiens - vcf.gz": { - "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test_filtered.vcf:md5,44659c255c5018ba2e5a3b4b80797a57" - ] - ] ->>>>>>> 0462840dd (Prepare for merge) ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, -<<<<<<< HEAD "timestamp": "2025-11-05T11:14:03.41245" }, "homo sapiens - vcf.gz - stub": { @@ -219,27 +190,11 @@ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } -======= - "timestamp": "2025-10-28T16:35:10.958678" - }, - "homo sapiens - bcf.gz": { - "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test_filtered.vcf:md5,c9be02b5c5e036c25e05f59a94528203" - ] - ] ->>>>>>> 0462840dd (Prepare for merge) ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, -<<<<<<< HEAD "timestamp": "2025-11-05T11:14:12.225232" }, "homo sapiens - vcf": { @@ -268,27 +223,11 @@ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] } -======= - "timestamp": "2025-10-28T16:35:21.012789" - }, - "homo sapiens - vcf": { - "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test_filtered.vcf:md5,20af56305296f2b0e52979465f19804b" - ] - ] ->>>>>>> 0462840dd (Prepare for merge) ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, -<<<<<<< HEAD "timestamp": "2025-11-05T11:13:59.313832" }, "homo sapiens - vcf - stub": { @@ -323,8 +262,5 @@ "nextflow": "25.04.6" }, "timestamp": "2025-11-05T11:14:15.550717" -======= - "timestamp": "2025-10-28T16:35:06.185151" ->>>>>>> 0462840dd (Prepare for merge) } } \ No newline at end of file From 0df82781f98edb7d6b39f05ee15515e9ab570553 Mon Sep 17 00:00:00 2001 From: dhtt Date: Thu, 13 Nov 2025 14:15:16 +0100 Subject: [PATCH 7/8] Fix output extension, output name, meta.yml --- .pre-commit-config.yaml | 4 +- modules/nf-core/vembrane/filter/main.nf | 38 ++++++++++----- modules/nf-core/vembrane/filter/meta.yml | 9 ++-- .../vembrane/filter/tests/main.nf.test.snap | 48 +++++++++---------- 4 files changed, 57 insertions(+), 42 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 712daf3dec21..6f830d97d1f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,12 @@ repos: - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v4.0.0-alpha.8" + rev: "v3.1.0" hooks: - id: prettier additional_dependencies: - prettier@3.6.2 - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 rev: v6.0.0 hooks: - id: trailing-whitespace @@ -52,7 +51,6 @@ repos: - id: ruff-format # formatter # NOTE This runs with Docker instead of the binary. Hoping anyone messing with Dockerfiles has Docker installed - repo: https://github.com/hadolint/hadolint - rev: v2.14.0 rev: v2.14.0 hooks: - id: hadolint-docker diff --git a/modules/nf-core/vembrane/filter/main.nf b/modules/nf-core/vembrane/filter/main.nf index 57d3869cc166..3cbd1a7cd1fc 100644 --- a/modules/nf-core/vembrane/filter/main.nf +++ b/modules/nf-core/vembrane/filter/main.nf @@ -1,19 +1,19 @@ process VEMBRANE_FILTER { - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/vembrane:2.4.0--pyhdfd78af_0': - 'biocontainers/vembrane:2.4.0--pyhdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/vembrane:2.4.0--pyhdfd78af_0' + : 'biocontainers/vembrane:2.4.0--pyhdfd78af_0'}" input: - tuple val(meta), path(variant) - val(expression) + tuple val(meta), path(vcf) + val expression output: - tuple val(meta), path("*.{vcf,bcf,vcf.gz,bcf.gz}"), emit: filtered_variant - path "versions.yml" , emit: versions + tuple val(meta), path("*.{vcf,bcf,bcf.gz}"), emit: filtered_variant + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -21,13 +21,21 @@ process VEMBRANE_FILTER { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + extension = args.contains("--output-fmt vcf") || args.contains("-Ovcf") ? "vcf" : + args.contains("--output-fmt bcf") || args.contains("-Obcf") ? "bcf" : + args.contains("--output-fmt uncompressed-bcf") || args.contains("-Ouncompressed-bcf") ? "bcf.gz" : + "vcf" + + if ("${vcf}" == "${prefix}.${extension}") { + error("Input and output names are the same, use \"task.ext.prefix\" in module configuration to disambiguate!") + } """ vembrane filter \\ ${args} \\ ${expression} \\ - -o ${prefix}.filtered.vcf \\ - ${variant} + -o ${prefix}.${extension} \\ + ${vcf} cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -37,9 +45,17 @@ process VEMBRANE_FILTER { stub: def prefix = task.ext.prefix ?: "${meta.id}" + extension = args.contains("--output-fmt vcf") || args.contains("-Ovcf") ? "vcf" : + args.contains("--output-fmt bcf") || args.contains("-Obcf") ? "bcf" : + args.contains("--output-fmt uncompressed-bcf") || args.contains("-Ouncompressed-bcf") ? "bcf.gz" : + "vcf" + + if ("${vcf}" == "${prefix}.${extension}") { + error("Input and output names are the same, use \"task.ext.prefix\" in module configuration to disambiguate!") + } """ - touch ${prefix}.filtered.vcf + touch ${prefix}.${extension} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/vembrane/filter/meta.yml b/modules/nf-core/vembrane/filter/meta.yml index 2d6767be23cc..1dc9d83ad135 100644 --- a/modules/nf-core/vembrane/filter/meta.yml +++ b/modules/nf-core/vembrane/filter/meta.yml @@ -1,6 +1,6 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: "vembrane_filter" -description: write your description here +description: Filter VCF files with vembrane keywords: - filter - vcf @@ -24,11 +24,12 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test' ] - - variant: + - vcf: type: file description: | Path to the VCF/BCF file to be filtered. e.g. 'file.vcf', 'file.vcf.gz', 'file.bcf', 'file.bcf.gz' + pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" ontologies: [] - expression: type: string @@ -44,10 +45,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test' ] - - "*.{vcf,bcf,vcf.gz,bcf.gz}": + - "*.{vcf,bcf,bcf.gz}": type: file description: Filtered VCF output file - pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + pattern: "*.{vcf,bcf,bcf.gz}" ontologies: [] versions: - versions.yml: diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap index a00a8f3c32fb..f18e16006908 100644 --- a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap @@ -7,7 +7,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,6c1393e34fc3ffe763b7c75725176463" + "test.vcf:md5,aaef102d56d0c3f0cdcbac7568f487fe" ] ], "1": [ @@ -18,7 +18,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,6c1393e34fc3ffe763b7c75725176463" + "test.vcf:md5,aaef102d56d0c3f0cdcbac7568f487fe" ] ], "versions": [ @@ -30,7 +30,7 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-05T11:14:07.57913" + "timestamp": "2025-11-13T11:14:06.920892" }, "homo sapiens - bcf - stub": { "content": [ @@ -40,7 +40,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -51,7 +51,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ @@ -63,7 +63,7 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-05T11:14:22.290473" + "timestamp": "2025-11-13T11:14:22.72139" }, "homo sapiens - vcf.gz": { "content": [ @@ -73,7 +73,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,75cc37af6bc118370251fee6ab1532ee" + "test.vcf:md5,2bb5028c50d643f0410ec3ee39979150" ] ], "1": [ @@ -84,7 +84,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,75cc37af6bc118370251fee6ab1532ee" + "test.vcf:md5,2bb5028c50d643f0410ec3ee39979150" ] ], "versions": [ @@ -96,7 +96,7 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-05T11:14:03.41245" + "timestamp": "2025-11-13T11:14:02.397466" }, "homo sapiens - vcf.gz - stub": { "content": [ @@ -106,7 +106,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -117,7 +117,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ @@ -129,7 +129,7 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-05T11:14:18.955755" + "timestamp": "2025-11-13T11:14:18.799085" }, "homo sapiens - bcf.gz - stub": { "content": [ @@ -139,7 +139,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -150,7 +150,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ @@ -162,7 +162,7 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-05T11:14:26.669552" + "timestamp": "2025-11-13T11:14:26.472957" }, "homo sapiens - bcf.gz": { "content": [ @@ -172,7 +172,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,71c159f1c953e33c94ad6fd5efbf719b" + "test.vcf:md5,24a5d6b414c345ebacf5dd6270d9e4d2" ] ], "1": [ @@ -183,7 +183,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,71c159f1c953e33c94ad6fd5efbf719b" + "test.vcf:md5,24a5d6b414c345ebacf5dd6270d9e4d2" ] ], "versions": [ @@ -195,7 +195,7 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-05T11:14:12.225232" + "timestamp": "2025-11-13T11:14:11.339463" }, "homo sapiens - vcf": { "content": [ @@ -205,7 +205,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,116c742876dd0ab00a936178f1da9c86" + "test.vcf:md5,e78b475d1d84834333b7273673530496" ] ], "1": [ @@ -216,7 +216,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,116c742876dd0ab00a936178f1da9c86" + "test.vcf:md5,e78b475d1d84834333b7273673530496" ] ], "versions": [ @@ -228,7 +228,7 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-05T11:13:59.313832" + "timestamp": "2025-11-13T11:13:57.672228" }, "homo sapiens - vcf - stub": { "content": [ @@ -238,7 +238,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -249,7 +249,7 @@ { "id": "test" }, - "test.filtered.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ @@ -261,6 +261,6 @@ "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-05T11:14:15.550717" + "timestamp": "2025-11-13T11:14:15.063118" } } \ No newline at end of file From 6ac59f88e91dca6594145f941034808aeb5880c6 Mon Sep 17 00:00:00 2001 From: dhtt Date: Wed, 19 Nov 2025 13:14:07 +0100 Subject: [PATCH 8/8] Minor fixes in snapshot test, main & meta output --- modules/nf-core/vembrane/filter/main.nf | 2 +- modules/nf-core/vembrane/filter/meta.yml | 2 +- .../vembrane/filter/tests/main.nf.test | 36 +++++++--- .../vembrane/filter/tests/main.nf.test.snap | 72 ++++++++++++++----- 4 files changed, 86 insertions(+), 26 deletions(-) diff --git a/modules/nf-core/vembrane/filter/main.nf b/modules/nf-core/vembrane/filter/main.nf index 3cbd1a7cd1fc..5df75fe7d302 100644 --- a/modules/nf-core/vembrane/filter/main.nf +++ b/modules/nf-core/vembrane/filter/main.nf @@ -12,7 +12,7 @@ process VEMBRANE_FILTER { val expression output: - tuple val(meta), path("*.{vcf,bcf,bcf.gz}"), emit: filtered_variant + tuple val(meta), path("*.{vcf,bcf,bcf.gz}"), emit: vcf path "versions.yml" , emit: versions when: diff --git a/modules/nf-core/vembrane/filter/meta.yml b/modules/nf-core/vembrane/filter/meta.yml index 1dc9d83ad135..7e654a3ff6a7 100644 --- a/modules/nf-core/vembrane/filter/meta.yml +++ b/modules/nf-core/vembrane/filter/meta.yml @@ -39,7 +39,7 @@ input: ontologies: [] output: - filtered_variant: + vcf: - - meta: type: map description: | diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test b/modules/nf-core/vembrane/filter/tests/main.nf.test index dff81dc5ea00..c5c2ebbb3773 100644 --- a/modules/nf-core/vembrane/filter/tests/main.nf.test +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test @@ -26,7 +26,10 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out, + path(process.out.versions[0]).yaml + ).match() } ) } @@ -49,7 +52,8 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - process.out + process.out, + path(process.out.versions[0]).yaml ).match() } ) } @@ -72,7 +76,10 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out, + path(process.out.versions[0]).yaml + ).match() } ) } @@ -94,7 +101,10 @@ test("homo sapiens - bcf.gz") { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out, + path(process.out.versions[0]).yaml + ).match() } ) } @@ -119,7 +129,10 @@ test("homo sapiens - bcf.gz") { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out, + path(process.out.versions[0]).yaml + ).match() } ) } @@ -145,7 +158,8 @@ test("homo sapiens - bcf.gz") { assertAll( { assert process.success }, { assert snapshot( - process.out + process.out, + path(process.out.versions[0]).yaml ).match() } ) } @@ -171,7 +185,10 @@ test("homo sapiens - bcf.gz") { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out, + path(process.out.versions[0]).yaml + ).match() } ) } @@ -196,7 +213,10 @@ test("homo sapiens - bcf.gz - stub") { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out, + path(process.out.versions[0]).yaml + ).match() } ) } diff --git a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap index f18e16006908..1afce22f4eb0 100644 --- a/modules/nf-core/vembrane/filter/tests/main.nf.test.snap +++ b/modules/nf-core/vembrane/filter/tests/main.nf.test.snap @@ -13,7 +13,7 @@ "1": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], - "filtered_variant": [ + "vcf": [ [ { "id": "test" @@ -24,13 +24,18 @@ "versions": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] + }, + { + "VEMBRANE_FILTER": { + "vembrane": "2.4.0" + } } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-13T11:14:06.920892" + "timestamp": "2025-11-19T13:01:08.406479" }, "homo sapiens - bcf - stub": { "content": [ @@ -46,7 +51,7 @@ "1": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], - "filtered_variant": [ + "vcf": [ [ { "id": "test" @@ -57,13 +62,18 @@ "versions": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] + }, + { + "VEMBRANE_FILTER": { + "vembrane": "2.4.0" + } } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-13T11:14:22.72139" + "timestamp": "2025-11-19T13:02:01.86051" }, "homo sapiens - vcf.gz": { "content": [ @@ -79,7 +89,7 @@ "1": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], - "filtered_variant": [ + "vcf": [ [ { "id": "test" @@ -90,13 +100,18 @@ "versions": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] + }, + { + "VEMBRANE_FILTER": { + "vembrane": "2.4.0" + } } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-13T11:14:02.397466" + "timestamp": "2025-11-19T13:00:53.748275" }, "homo sapiens - vcf.gz - stub": { "content": [ @@ -112,7 +127,7 @@ "1": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], - "filtered_variant": [ + "vcf": [ [ { "id": "test" @@ -123,13 +138,18 @@ "versions": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] + }, + { + "VEMBRANE_FILTER": { + "vembrane": "2.4.0" + } } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-13T11:14:18.799085" + "timestamp": "2025-11-19T13:01:48.889571" }, "homo sapiens - bcf.gz - stub": { "content": [ @@ -145,7 +165,7 @@ "1": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], - "filtered_variant": [ + "vcf": [ [ { "id": "test" @@ -156,13 +176,18 @@ "versions": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] + }, + { + "VEMBRANE_FILTER": { + "vembrane": "2.4.0" + } } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-13T11:14:26.472957" + "timestamp": "2025-11-19T13:02:16.104571" }, "homo sapiens - bcf.gz": { "content": [ @@ -178,7 +203,7 @@ "1": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], - "filtered_variant": [ + "vcf": [ [ { "id": "test" @@ -189,13 +214,18 @@ "versions": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] + }, + { + "VEMBRANE_FILTER": { + "vembrane": "2.4.0" + } } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-13T11:14:11.339463" + "timestamp": "2025-11-19T13:01:23.162816" }, "homo sapiens - vcf": { "content": [ @@ -211,7 +241,7 @@ "1": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], - "filtered_variant": [ + "vcf": [ [ { "id": "test" @@ -222,13 +252,18 @@ "versions": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] + }, + { + "VEMBRANE_FILTER": { + "vembrane": "2.4.0" + } } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-13T11:13:57.672228" + "timestamp": "2025-11-19T13:00:38.636223" }, "homo sapiens - vcf - stub": { "content": [ @@ -244,7 +279,7 @@ "1": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ], - "filtered_variant": [ + "vcf": [ [ { "id": "test" @@ -255,12 +290,17 @@ "versions": [ "versions.yml:md5,16c0e3eafdc08317b2a50616f2425a85" ] + }, + { + "VEMBRANE_FILTER": { + "vembrane": "2.4.0" + } } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.04.6" }, - "timestamp": "2025-11-13T11:14:15.063118" + "timestamp": "2025-11-19T13:01:34.578017" } } \ No newline at end of file