From 66588fcd100e084793b2d541194ece7fda32ff7c Mon Sep 17 00:00:00 2001 From: Maria Katsantoni Date: Tue, 28 Oct 2025 16:19:48 +0100 Subject: [PATCH 1/7] fix: linting error --- .../nf-core/vembrane/table/environment.yml | 7 + modules/nf-core/vembrane/table/main.nf | 49 ++++ modules/nf-core/vembrane/table/meta.yml | 63 ++++ .../nf-core/vembrane/table/tests/main.nf.test | 137 +++++++++ .../vembrane/table/tests/main.nf.test.snap | 270 ++++++++++++++++++ .../vembrane/table/tests/nextflow.config | 6 + 6 files changed, 532 insertions(+) create mode 100644 modules/nf-core/vembrane/table/environment.yml create mode 100644 modules/nf-core/vembrane/table/main.nf create mode 100644 modules/nf-core/vembrane/table/meta.yml create mode 100644 modules/nf-core/vembrane/table/tests/main.nf.test create mode 100644 modules/nf-core/vembrane/table/tests/main.nf.test.snap create mode 100644 modules/nf-core/vembrane/table/tests/nextflow.config diff --git a/modules/nf-core/vembrane/table/environment.yml b/modules/nf-core/vembrane/table/environment.yml new file mode 100644 index 00000000000..825a5fac4b7 --- /dev/null +++ b/modules/nf-core/vembrane/table/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::vembrane=2.4.0 diff --git a/modules/nf-core/vembrane/table/main.nf b/modules/nf-core/vembrane/table/main.nf new file mode 100644 index 00000000000..b7de2105c41 --- /dev/null +++ b/modules/nf-core/vembrane/table/main.nf @@ -0,0 +1,49 @@ + + +process VEMBRANE_TABLE { + tag "$meta.id" + label 'process_low' + + 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'}" + + input: + tuple val(meta), path(vcf) + val expression + + output: + tuple val(meta), path("*.tsv"), emit: table + 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 table \\ + $args \\ + --output ${prefix}.tsv \\ + '$expression' \\ + $vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vembrane: \$(vembrane --version 2>&1 | head -n1 | sed 's/vembrane //') + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vembrane: \$(vembrane --version 2>&1 | head -n1 | sed 's/vembrane //') + END_VERSIONS + """ +} diff --git a/modules/nf-core/vembrane/table/meta.yml b/modules/nf-core/vembrane/table/meta.yml new file mode 100644 index 00000000000..2743421d4d6 --- /dev/null +++ b/modules/nf-core/vembrane/table/meta.yml @@ -0,0 +1,63 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "vembrane_table" +description: Creates tabular (TSV) files from VCF/BCF data with flexible Python expressions +keywords: + - vcf + - bcf + - table + - genomics + - variant + - annotation +tools: + - "vembrane": + description: "Filter VCF/BCF files with Python expressions" + homepage: "https://vembrane.github.io/" + documentation: "https://github.com/vembrane/vembrane/blob/main/docs/table.md" + tool_dev_url: "https://github.com/vembrane/vembrane" + doi: "10.1093/bioinformatics/btac810" + licence: ["MIT"] + identifier: biotools:vembrane + args_id: "$args" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - vcf: + type: file + description: VCF/BCF file to extract tabular data from + pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" + ontologies: + - edam: http://edamontology.org/format_3016 # VCF + - expression: + type: string + description: A comma-separated tuple of expressions that define the table column contents + +output: + table: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - "*.tsv": + type: file + description: TSV file containing tabular data from VCF/BCF + pattern: "*.tsv" + ontologies: + - edam: http://edamontology.org/format_3475 # TSV + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML +authors: +- "@mkatsanto" +- "@trangdo-hsc" +maintainers: +- "@mkatsanto" +- "@trangdo-hsc" diff --git a/modules/nf-core/vembrane/table/tests/main.nf.test b/modules/nf-core/vembrane/table/tests/main.nf.test new file mode 100644 index 00000000000..8cb4ec33da0 --- /dev/null +++ b/modules/nf-core/vembrane/table/tests/main.nf.test @@ -0,0 +1,137 @@ + +nextflow_process { + + name "Test Process VEMBRANE_TABLE" + script "../main.nf" + process "VEMBRANE_TABLE" + + tag "modules" + tag "modules_nfcore" + tag "vembrane" + tag "vembrane/table" + + test("homo_sapiens - [vcf] - tsv") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_vcf'], checkIfExists: true) + ] + input[1] = 'CHROM, POS, REF, ALT, QUAL' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [bcf.gz] - tsv") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['popgen']['plink_case_control_bcf_gz'], checkIfExists: true) + ] + input[1] = 'CHROM, POS, REF, ALT, QUAL' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [vcf] - csv - custom_separator") { + + config "./nextflow.config" + + when { + params { + vembrane_args = '--separator ,' + vembrane_prefix = 'test.csv' + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_vcf'], checkIfExists: true) + ] + input[1] = 'CHROM, POS, REF, ALT' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [vcf] - tsv - custom_header") { + + config "./nextflow.config" + + when { + params { + vembrane_args = '--header "Chromosome,Position,Variant_ID,Quality"' + vembrane_prefix = 'test.custom_header' + } + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_vcf'], checkIfExists: true) + ] + input[1] = 'CHROM, POS, ID, QUAL' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [vcf] - tsv - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_vcf'], checkIfExists: true) + ] + input[1] = 'CHROM, POS, REF, ALT, QUAL' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/vembrane/table/tests/main.nf.test.snap b/modules/nf-core/vembrane/table/tests/main.nf.test.snap new file mode 100644 index 00000000000..f368bf75e9a --- /dev/null +++ b/modules/nf-core/vembrane/table/tests/main.nf.test.snap @@ -0,0 +1,270 @@ +{ + "homo_sapiens - vcf": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,bc377c509db1bea19cb2d13b7e3b5480" + ] + ], + "1": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ], + "table": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,bc377c509db1bea19cb2d13b7e3b5480" + ] + ], + "versions": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-28T15:02:19.949621" + }, + "homo_sapiens - [vcf] - tsv - custom_header": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.custom_header.tsv:md5,a000109bce654d2d6f8ce132c03d27b4" + ] + ], + "1": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ], + "table": [ + [ + { + "id": "test", + "single_end": false + }, + "test.custom_header.tsv:md5,a000109bce654d2d6f8ce132c03d27b4" + ] + ], + "versions": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-28T16:01:22.053958" + }, + "homo_sapiens - [vcf] - tsv": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,bc377c509db1bea19cb2d13b7e3b5480" + ] + ], + "1": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ], + "table": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,bc377c509db1bea19cb2d13b7e3b5480" + ] + ], + "versions": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-28T15:35:10.060963" + }, + "sarscov2 - [bcf] - tsv": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "table": [ + + ], + "versions": [ + + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-28T15:29:36.091335" + }, + "homo_sapiens - [bcf.gz] - tsv": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,f0d357c993b9c0463b4564681ffffa2e" + ] + ], + "1": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ], + "table": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,f0d357c993b9c0463b4564681ffffa2e" + ] + ], + "versions": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-28T15:35:53.162346" + }, + "homo_sapiens - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ], + "table": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-28T15:02:57.900961" + }, + "homo_sapiens - [vcf] - csv - custom_separator": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.csv.tsv:md5,f8616b2040be43518e270c02aac600f6" + ] + ], + "1": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ], + "table": [ + [ + { + "id": "test", + "single_end": false + }, + "test.csv.tsv:md5,f8616b2040be43518e270c02aac600f6" + ] + ], + "versions": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-28T15:45:34.223565" + }, + "homo_sapiens - [vcf] - tsv - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ], + "table": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,24635137815ac702717f1edf14621d8c" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-28T15:24:08.270925" + } +} \ No newline at end of file diff --git a/modules/nf-core/vembrane/table/tests/nextflow.config b/modules/nf-core/vembrane/table/tests/nextflow.config new file mode 100644 index 00000000000..9c430bae52e --- /dev/null +++ b/modules/nf-core/vembrane/table/tests/nextflow.config @@ -0,0 +1,6 @@ +process { + withName: 'VEMBRANE_TABLE' { + ext.args = params.vembrane_args ?: '' + ext.prefix = { params.vembrane_prefix ?: "${meta.id}" } + } +} From fd659e31edd54d7cdfafc2b3bb5b629415572ab6 Mon Sep 17 00:00:00 2001 From: Maria Katsantoni Date: Tue, 28 Oct 2025 17:07:34 +0100 Subject: [PATCH 2/7] fix: add conda snapshot --- .../vembrane/table/tests/main.nf.test.snap | 93 ------------------- 1 file changed, 93 deletions(-) diff --git a/modules/nf-core/vembrane/table/tests/main.nf.test.snap b/modules/nf-core/vembrane/table/tests/main.nf.test.snap index f368bf75e9a..26df26170bc 100644 --- a/modules/nf-core/vembrane/table/tests/main.nf.test.snap +++ b/modules/nf-core/vembrane/table/tests/main.nf.test.snap @@ -1,39 +1,4 @@ { - "homo_sapiens - vcf": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,bc377c509db1bea19cb2d13b7e3b5480" - ] - ], - "1": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ], - "table": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,bc377c509db1bea19cb2d13b7e3b5480" - ] - ], - "versions": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-10-28T15:02:19.949621" - }, "homo_sapiens - [vcf] - tsv - custom_header": { "content": [ { @@ -104,29 +69,6 @@ }, "timestamp": "2025-10-28T15:35:10.060963" }, - "sarscov2 - [bcf] - tsv": { - "content": [ - { - "0": [ - - ], - "1": [ - - ], - "table": [ - - ], - "versions": [ - - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-10-28T15:29:36.091335" - }, "homo_sapiens - [bcf.gz] - tsv": { "content": [ { @@ -162,41 +104,6 @@ }, "timestamp": "2025-10-28T15:35:53.162346" }, - "homo_sapiens - vcf - stub": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ], - "table": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-10-28T15:02:57.900961" - }, "homo_sapiens - [vcf] - csv - custom_separator": { "content": [ { From 28d37a0b6a231aa2bf3087d071baef7672250525 Mon Sep 17 00:00:00 2001 From: Maria Katsantoni Date: Wed, 29 Oct 2025 09:55:24 +0100 Subject: [PATCH 3/7] fix: test path specification and removed test prefix --- modules/nf-core/vembrane/table/tests/main.nf.test | 12 +++++------- .../nf-core/vembrane/table/tests/main.nf.test.snap | 12 ++++++------ modules/nf-core/vembrane/table/tests/nextflow.config | 1 - 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/modules/nf-core/vembrane/table/tests/main.nf.test b/modules/nf-core/vembrane/table/tests/main.nf.test index 8cb4ec33da0..6ada32e843d 100644 --- a/modules/nf-core/vembrane/table/tests/main.nf.test +++ b/modules/nf-core/vembrane/table/tests/main.nf.test @@ -17,7 +17,7 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_vcf'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) ] input[1] = 'CHROM, POS, REF, ALT, QUAL' """ @@ -39,7 +39,7 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['popgen']['plink_case_control_bcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bcf.gz', checkIfExists: true) ] input[1] = 'CHROM, POS, REF, ALT, QUAL' """ @@ -61,13 +61,12 @@ nextflow_process { when { params { vembrane_args = '--separator ,' - vembrane_prefix = 'test.csv' } process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_vcf'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) ] input[1] = 'CHROM, POS, REF, ALT' """ @@ -89,13 +88,12 @@ nextflow_process { when { params { vembrane_args = '--header "Chromosome,Position,Variant_ID,Quality"' - vembrane_prefix = 'test.custom_header' } process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_vcf'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) ] input[1] = 'CHROM, POS, ID, QUAL' """ @@ -119,7 +117,7 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_rnaseq_vcf'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) ] input[1] = 'CHROM, POS, REF, ALT, QUAL' """ diff --git a/modules/nf-core/vembrane/table/tests/main.nf.test.snap b/modules/nf-core/vembrane/table/tests/main.nf.test.snap index 26df26170bc..75d5ed95413 100644 --- a/modules/nf-core/vembrane/table/tests/main.nf.test.snap +++ b/modules/nf-core/vembrane/table/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": false }, - "test.custom_header.tsv:md5,a000109bce654d2d6f8ce132c03d27b4" + "test.tsv:md5,a000109bce654d2d6f8ce132c03d27b4" ] ], "1": [ @@ -20,7 +20,7 @@ "id": "test", "single_end": false }, - "test.custom_header.tsv:md5,a000109bce654d2d6f8ce132c03d27b4" + "test.tsv:md5,a000109bce654d2d6f8ce132c03d27b4" ] ], "versions": [ @@ -32,7 +32,7 @@ "nf-test": "0.9.3", "nextflow": "25.10.0" }, - "timestamp": "2025-10-28T16:01:22.053958" + "timestamp": "2025-10-29T09:52:24.816246" }, "homo_sapiens - [vcf] - tsv": { "content": [ @@ -113,7 +113,7 @@ "id": "test", "single_end": false }, - "test.csv.tsv:md5,f8616b2040be43518e270c02aac600f6" + "test.tsv:md5,f8616b2040be43518e270c02aac600f6" ] ], "1": [ @@ -125,7 +125,7 @@ "id": "test", "single_end": false }, - "test.csv.tsv:md5,f8616b2040be43518e270c02aac600f6" + "test.tsv:md5,f8616b2040be43518e270c02aac600f6" ] ], "versions": [ @@ -137,7 +137,7 @@ "nf-test": "0.9.3", "nextflow": "25.10.0" }, - "timestamp": "2025-10-28T15:45:34.223565" + "timestamp": "2025-10-29T09:53:37.401847" }, "homo_sapiens - [vcf] - tsv - stub": { "content": [ diff --git a/modules/nf-core/vembrane/table/tests/nextflow.config b/modules/nf-core/vembrane/table/tests/nextflow.config index 9c430bae52e..95dbb06496f 100644 --- a/modules/nf-core/vembrane/table/tests/nextflow.config +++ b/modules/nf-core/vembrane/table/tests/nextflow.config @@ -1,6 +1,5 @@ process { withName: 'VEMBRANE_TABLE' { ext.args = params.vembrane_args ?: '' - ext.prefix = { params.vembrane_prefix ?: "${meta.id}" } } } From bb1bdec8731e3315aaf53fc74e6bf08f15169305 Mon Sep 17 00:00:00 2001 From: Maria Katsantoni Date: Wed, 29 Oct 2025 11:37:18 +0100 Subject: [PATCH 4/7] feat: addition of vembrane sort module --- modules/nf-core/vembrane/sort/environment.yml | 7 + modules/nf-core/vembrane/sort/main.nf | 47 ++++++ modules/nf-core/vembrane/sort/meta.yml | 63 ++++++++ .../nf-core/vembrane/sort/tests/main.nf.test | 112 ++++++++++++++ .../vembrane/sort/tests/main.nf.test.snap | 142 ++++++++++++++++++ .../vembrane/sort/tests/nextflow.config | 5 + 6 files changed, 376 insertions(+) create mode 100644 modules/nf-core/vembrane/sort/environment.yml create mode 100644 modules/nf-core/vembrane/sort/main.nf create mode 100644 modules/nf-core/vembrane/sort/meta.yml create mode 100644 modules/nf-core/vembrane/sort/tests/main.nf.test create mode 100644 modules/nf-core/vembrane/sort/tests/main.nf.test.snap create mode 100644 modules/nf-core/vembrane/sort/tests/nextflow.config diff --git a/modules/nf-core/vembrane/sort/environment.yml b/modules/nf-core/vembrane/sort/environment.yml new file mode 100644 index 00000000000..825a5fac4b7 --- /dev/null +++ b/modules/nf-core/vembrane/sort/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::vembrane=2.4.0 diff --git a/modules/nf-core/vembrane/sort/main.nf b/modules/nf-core/vembrane/sort/main.nf new file mode 100644 index 00000000000..16ba0bf1f41 --- /dev/null +++ b/modules/nf-core/vembrane/sort/main.nf @@ -0,0 +1,47 @@ +process VEMBRANE_SORT { + tag "$meta.id" + label 'process_low' + + 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'}" + + input: + tuple val(meta), path(vcf) + val expression + + output: + tuple val(meta), path("*.vcf"), emit: vcf + 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 sort \\ + $args \\ + --output ${prefix}.vcf \\ + '$expression' \\ + $vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vembrane: \$(vembrane --version 2>&1 | head -n1 | sed 's/vembrane //') + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vembrane: \$(vembrane --version 2>&1 | head -n1 | sed 's/vembrane //') + END_VERSIONS + """ +} diff --git a/modules/nf-core/vembrane/sort/meta.yml b/modules/nf-core/vembrane/sort/meta.yml new file mode 100644 index 00000000000..c18b8bd2a0d --- /dev/null +++ b/modules/nf-core/vembrane/sort/meta.yml @@ -0,0 +1,63 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "vembrane_sort" +description: Sort VCF/BCF files by custom Python expressions for variant prioritization +keywords: + - vcf + - bcf + - sort + - genomics + - variant + - prioritization +tools: + - "vembrane": + description: "Filter VCF/BCF files with Python expressions" + homepage: "https://vembrane.github.io/" + documentation: "https://github.com/vembrane/vembrane/blob/main/docs/sort.md" + tool_dev_url: "https://github.com/vembrane/vembrane" + doi: "10.1093/bioinformatics/btac810" + licence: ["MIT"] + identifier: biotools:vembrane + args_id: "$args" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - vcf: + type: file + description: VCF/BCF file to sort + pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" + ontologies: + - edam: http://edamontology.org/format_3016 # VCF + - expression: + type: string + description: Python expression (or tuple of expressions) returning orderable values to sort by + +output: + vcf: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + - "*.vcf": + type: file + description: Sorted VCF file + pattern: "*.vcf" + ontologies: + - edam: http://edamontology.org/format_3016 # VCF + versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 # YAML +authors: +- "@mkatsanto" +- "@trangdo-hsc" +maintainers: +- "@mkatsanto" +- "@trangdo-hsc" diff --git a/modules/nf-core/vembrane/sort/tests/main.nf.test b/modules/nf-core/vembrane/sort/tests/main.nf.test new file mode 100644 index 00000000000..3dba3223fd1 --- /dev/null +++ b/modules/nf-core/vembrane/sort/tests/main.nf.test @@ -0,0 +1,112 @@ +nextflow_process { + + name "Test Process VEMBRANE_SORT" + script "../main.nf" + process "VEMBRANE_SORT" + + tag "modules" + tag "modules_nfcore" + tag "vembrane" + tag "vembrane/sort" + + test("homo_sapiens - [vcf] - vcf - quality_sort") { + + 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' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [vcf] - vcf - position_sort") { + + config "./nextflow.config" + + when { + params { + vembrane_args = '--output-fmt vcf' + } + 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] = 'CHROM, POS' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [vcf] - vcf - descending_sort") { + + config "./nextflow.config" + + when { + params { + vembrane_args = '--preserve-annotation-order' + } + 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] = 'desc(QUAL)' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [vcf] - vcf - stub") { + + options "-stub" + + 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' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/vembrane/sort/tests/main.nf.test.snap b/modules/nf-core/vembrane/sort/tests/main.nf.test.snap new file mode 100644 index 00000000000..61cbeff9dcf --- /dev/null +++ b/modules/nf-core/vembrane/sort/tests/main.nf.test.snap @@ -0,0 +1,142 @@ +{ + "homo_sapiens - [vcf] - vcf - descending_sort": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf:md5,c843f4078a1e55b518f7bb06f2b7ca95" + ] + ], + "1": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf:md5,c843f4078a1e55b518f7bb06f2b7ca95" + ] + ], + "versions": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T11:04:14.876462" + }, + "homo_sapiens - [vcf] - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T11:04:27.91684" + }, + "homo_sapiens - [vcf] - vcf - position_sort": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf:md5,7baef79f7f0d1927f47b80d49aa18004" + ] + ], + "1": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf:md5,7baef79f7f0d1927f47b80d49aa18004" + ] + ], + "versions": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T11:03:59.609938" + }, + "homo_sapiens - [vcf] - vcf - quality_sort": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf:md5,67de3aeba1654914c674bfd8be189577" + ] + ], + "1": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf:md5,67de3aeba1654914c674bfd8be189577" + ] + ], + "versions": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T11:03:45.306624" + } +} \ No newline at end of file diff --git a/modules/nf-core/vembrane/sort/tests/nextflow.config b/modules/nf-core/vembrane/sort/tests/nextflow.config new file mode 100644 index 00000000000..11c78c5322b --- /dev/null +++ b/modules/nf-core/vembrane/sort/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'VEMBRANE_SORT' { + ext.args = params.vembrane_args ?: '' + } +} From 0a0f4f19d18230042ecfcefb04de90eda6b25cea Mon Sep 17 00:00:00 2001 From: Maria Katsantoni Date: Wed, 29 Oct 2025 14:32:15 +0100 Subject: [PATCH 5/7] fix: remove the vembrane table from this branch --- .../nf-core/vembrane/table/environment.yml | 7 - modules/nf-core/vembrane/table/main.nf | 49 ----- modules/nf-core/vembrane/table/meta.yml | 63 ------- .../nf-core/vembrane/table/tests/main.nf.test | 135 ------------- .../vembrane/table/tests/main.nf.test.snap | 177 ------------------ .../vembrane/table/tests/nextflow.config | 5 - 6 files changed, 436 deletions(-) delete mode 100644 modules/nf-core/vembrane/table/environment.yml delete mode 100644 modules/nf-core/vembrane/table/main.nf delete mode 100644 modules/nf-core/vembrane/table/meta.yml delete mode 100644 modules/nf-core/vembrane/table/tests/main.nf.test delete mode 100644 modules/nf-core/vembrane/table/tests/main.nf.test.snap delete mode 100644 modules/nf-core/vembrane/table/tests/nextflow.config diff --git a/modules/nf-core/vembrane/table/environment.yml b/modules/nf-core/vembrane/table/environment.yml deleted file mode 100644 index 825a5fac4b7..00000000000 --- a/modules/nf-core/vembrane/table/environment.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json -channels: - - conda-forge - - bioconda -dependencies: - - bioconda::vembrane=2.4.0 diff --git a/modules/nf-core/vembrane/table/main.nf b/modules/nf-core/vembrane/table/main.nf deleted file mode 100644 index b7de2105c41..00000000000 --- a/modules/nf-core/vembrane/table/main.nf +++ /dev/null @@ -1,49 +0,0 @@ - - -process VEMBRANE_TABLE { - tag "$meta.id" - label 'process_low' - - 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'}" - - input: - tuple val(meta), path(vcf) - val expression - - output: - tuple val(meta), path("*.tsv"), emit: table - 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 table \\ - $args \\ - --output ${prefix}.tsv \\ - '$expression' \\ - $vcf - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - vembrane: \$(vembrane --version 2>&1 | head -n1 | sed 's/vembrane //') - END_VERSIONS - """ - - stub: - def prefix = task.ext.prefix ?: "${meta.id}" - """ - touch ${prefix}.tsv - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - vembrane: \$(vembrane --version 2>&1 | head -n1 | sed 's/vembrane //') - END_VERSIONS - """ -} diff --git a/modules/nf-core/vembrane/table/meta.yml b/modules/nf-core/vembrane/table/meta.yml deleted file mode 100644 index 2743421d4d6..00000000000 --- a/modules/nf-core/vembrane/table/meta.yml +++ /dev/null @@ -1,63 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json -name: "vembrane_table" -description: Creates tabular (TSV) files from VCF/BCF data with flexible Python expressions -keywords: - - vcf - - bcf - - table - - genomics - - variant - - annotation -tools: - - "vembrane": - description: "Filter VCF/BCF files with Python expressions" - homepage: "https://vembrane.github.io/" - documentation: "https://github.com/vembrane/vembrane/blob/main/docs/table.md" - tool_dev_url: "https://github.com/vembrane/vembrane" - doi: "10.1093/bioinformatics/btac810" - licence: ["MIT"] - identifier: biotools:vembrane - args_id: "$args" - -input: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1', single_end:false ]` - - vcf: - type: file - description: VCF/BCF file to extract tabular data from - pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" - ontologies: - - edam: http://edamontology.org/format_3016 # VCF - - expression: - type: string - description: A comma-separated tuple of expressions that define the table column contents - -output: - table: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1', single_end:false ]` - - "*.tsv": - type: file - description: TSV file containing tabular data from VCF/BCF - pattern: "*.tsv" - ontologies: - - edam: http://edamontology.org/format_3475 # TSV - versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" - ontologies: - - edam: http://edamontology.org/format_3750 # YAML -authors: -- "@mkatsanto" -- "@trangdo-hsc" -maintainers: -- "@mkatsanto" -- "@trangdo-hsc" diff --git a/modules/nf-core/vembrane/table/tests/main.nf.test b/modules/nf-core/vembrane/table/tests/main.nf.test deleted file mode 100644 index 6ada32e843d..00000000000 --- a/modules/nf-core/vembrane/table/tests/main.nf.test +++ /dev/null @@ -1,135 +0,0 @@ - -nextflow_process { - - name "Test Process VEMBRANE_TABLE" - script "../main.nf" - process "VEMBRANE_TABLE" - - tag "modules" - tag "modules_nfcore" - tag "vembrane" - tag "vembrane/table" - - test("homo_sapiens - [vcf] - tsv") { - - 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] = 'CHROM, POS, REF, ALT, QUAL' - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("homo_sapiens - [bcf.gz] - tsv") { - - 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] = 'CHROM, POS, REF, ALT, QUAL' - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("homo_sapiens - [vcf] - csv - custom_separator") { - - config "./nextflow.config" - - when { - params { - vembrane_args = '--separator ,' - } - 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] = 'CHROM, POS, REF, ALT' - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("homo_sapiens - [vcf] - tsv - custom_header") { - - config "./nextflow.config" - - when { - params { - vembrane_args = '--header "Chromosome,Position,Variant_ID,Quality"' - } - 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] = 'CHROM, POS, ID, QUAL' - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("homo_sapiens - [vcf] - tsv - stub") { - - options "-stub" - - 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] = 'CHROM, POS, REF, ALT, QUAL' - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - -} diff --git a/modules/nf-core/vembrane/table/tests/main.nf.test.snap b/modules/nf-core/vembrane/table/tests/main.nf.test.snap deleted file mode 100644 index 75d5ed95413..00000000000 --- a/modules/nf-core/vembrane/table/tests/main.nf.test.snap +++ /dev/null @@ -1,177 +0,0 @@ -{ - "homo_sapiens - [vcf] - tsv - custom_header": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,a000109bce654d2d6f8ce132c03d27b4" - ] - ], - "1": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ], - "table": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,a000109bce654d2d6f8ce132c03d27b4" - ] - ], - "versions": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-10-29T09:52:24.816246" - }, - "homo_sapiens - [vcf] - tsv": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,bc377c509db1bea19cb2d13b7e3b5480" - ] - ], - "1": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ], - "table": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,bc377c509db1bea19cb2d13b7e3b5480" - ] - ], - "versions": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-10-28T15:35:10.060963" - }, - "homo_sapiens - [bcf.gz] - tsv": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,f0d357c993b9c0463b4564681ffffa2e" - ] - ], - "1": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ], - "table": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,f0d357c993b9c0463b4564681ffffa2e" - ] - ], - "versions": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-10-28T15:35:53.162346" - }, - "homo_sapiens - [vcf] - csv - custom_separator": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,f8616b2040be43518e270c02aac600f6" - ] - ], - "1": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ], - "table": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,f8616b2040be43518e270c02aac600f6" - ] - ], - "versions": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-10-29T09:53:37.401847" - }, - "homo_sapiens - [vcf] - tsv - stub": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ], - "table": [ - [ - { - "id": "test", - "single_end": false - }, - "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions": [ - "versions.yml:md5,24635137815ac702717f1edf14621d8c" - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-10-28T15:24:08.270925" - } -} \ No newline at end of file diff --git a/modules/nf-core/vembrane/table/tests/nextflow.config b/modules/nf-core/vembrane/table/tests/nextflow.config deleted file mode 100644 index 95dbb06496f..00000000000 --- a/modules/nf-core/vembrane/table/tests/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - withName: 'VEMBRANE_TABLE' { - ext.args = params.vembrane_args ?: '' - } -} From 12570bccb82bfed057d4b77013267f4330ce6a58 Mon Sep 17 00:00:00 2001 From: Maria Katsantoni Date: Wed, 29 Oct 2025 16:29:57 +0100 Subject: [PATCH 6/7] fix: vembrane sort fixes like the table module --- modules/nf-core/vembrane/sort/main.nf | 29 +-- modules/nf-core/vembrane/sort/meta.yml | 6 +- .../nf-core/vembrane/sort/tests/main.nf.test | 107 ++++++++++- .../vembrane/sort/tests/main.nf.test.snap | 176 ++++++++++++++++-- 4 files changed, 283 insertions(+), 35 deletions(-) diff --git a/modules/nf-core/vembrane/sort/main.nf b/modules/nf-core/vembrane/sort/main.nf index 16ba0bf1f41..4d0c809db7a 100644 --- a/modules/nf-core/vembrane/sort/main.nf +++ b/modules/nf-core/vembrane/sort/main.nf @@ -1,19 +1,19 @@ process VEMBRANE_SORT { - tag "$meta.id" + tag "${meta.id}" label 'process_low' 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(vcf) val expression output: - tuple val(meta), path("*.vcf"), emit: vcf - path "versions.yml" , emit: versions + tuple val(meta), path("*.vcf*"), emit: vcf + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -21,12 +21,15 @@ process VEMBRANE_SORT { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = args.contains('--output-fmt vcf.gz') ? 'vcf.gz' : + args.contains('--output-fmt bcf') ? 'bcf' : + args.contains('--output-fmt bcf.gz') ? 'bcf.gz' : 'vcf' """ vembrane sort \\ - $args \\ - --output ${prefix}.vcf \\ - '$expression' \\ - $vcf + ${args} \\ + --output ${prefix}.${suffix} \\ + '${expression}' \\ + ${vcf} cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -35,9 +38,13 @@ process VEMBRANE_SORT { """ stub: + def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = args.contains('--output-fmt vcf.gz') ? 'vcf.gz' : + args.contains('--output-fmt bcf') ? 'bcf' : + args.contains('--output-fmt bcf.gz') ? 'bcf.gz' : 'vcf' """ - touch ${prefix}.vcf + touch ${prefix}.${suffix} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/vembrane/sort/meta.yml b/modules/nf-core/vembrane/sort/meta.yml index c18b8bd2a0d..8b5c42c0d44 100644 --- a/modules/nf-core/vembrane/sort/meta.yml +++ b/modules/nf-core/vembrane/sort/meta.yml @@ -42,10 +42,10 @@ output: description: | Groovy Map containing sample information e.g. `[ id:'sample1', single_end:false ]` - - "*.vcf": + - "*.vcf*": type: file - description: Sorted VCF file - pattern: "*.vcf" + description: Sorted VCF file (can be compressed) + pattern: "*.{vcf,vcf.gz}" ontologies: - edam: http://edamontology.org/format_3016 # VCF versions: diff --git a/modules/nf-core/vembrane/sort/tests/main.nf.test b/modules/nf-core/vembrane/sort/tests/main.nf.test index 3dba3223fd1..d6c3bfeba80 100644 --- a/modules/nf-core/vembrane/sort/tests/main.nf.test +++ b/modules/nf-core/vembrane/sort/tests/main.nf.test @@ -15,7 +15,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/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) ] input[1] = 'QUAL' @@ -42,7 +42,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/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) ] input[1] = 'CHROM, POS' @@ -69,7 +69,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/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) ] input[1] = 'desc(QUAL)' @@ -85,6 +85,100 @@ nextflow_process { } } + + test("homo_sapiens - [vcf] - vcf - compressed_output") { + + config "./nextflow.config" + + when { + params { + vembrane_args = '--output-fmt vcf.gz' + } + process { + """ + input[0] = [ + [ id:'test_gz' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) + ] + input[1] = 'QUAL' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [vcf] - vcf - depth_sort") { + + when { + process { + """ + input[0] = [ + [ id:'test_depth' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) + ] + input[1] = 'INFO["DP"] if "DP" in INFO else 0' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [vcf] - vcf - numeric_expression") { + + when { + process { + """ + input[0] = [ + [ id:'test_numeric' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) + ] + input[1] = 'POS % 1000' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens - [vcf] - vcf - multi_field_sort") { + + when { + process { + """ + input[0] = [ + [ id:'test_multi' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) + ] + input[1] = '(CHROM, POS, QUAL)' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + test("homo_sapiens - [vcf] - vcf - stub") { options "-stub" @@ -93,7 +187,7 @@ nextflow_process { process { """ input[0] = [ - [ id:'test', single_end:false ], // meta map + [ id:'test_stub' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) ] input[1] = 'QUAL' @@ -104,7 +198,10 @@ nextflow_process { 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/sort/tests/main.nf.test.snap b/modules/nf-core/vembrane/sort/tests/main.nf.test.snap index 61cbeff9dcf..5a8365f6b7b 100644 --- a/modules/nf-core/vembrane/sort/tests/main.nf.test.snap +++ b/modules/nf-core/vembrane/sort/tests/main.nf.test.snap @@ -1,12 +1,77 @@ { + "homo_sapiens - [vcf] - vcf - numeric_expression": { + "content": [ + { + "0": [ + [ + { + "id": "test_numeric" + }, + "test_numeric.vcf:md5,4ca96524fc3f76d7bf893f4cb4a657f0" + ] + ], + "1": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ], + "vcf": [ + [ + { + "id": "test_numeric" + }, + "test_numeric.vcf:md5,4ca96524fc3f76d7bf893f4cb4a657f0" + ] + ], + "versions": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T16:25:43.059651" + }, + "homo_sapiens - [vcf] - vcf - multi_field_sort": { + "content": [ + { + "0": [ + [ + { + "id": "test_multi" + }, + "test_multi.vcf:md5,bc3e7d2374c38dbdefc03788f0aa6dfa" + ] + ], + "1": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ], + "vcf": [ + [ + { + "id": "test_multi" + }, + "test_multi.vcf:md5,bc3e7d2374c38dbdefc03788f0aa6dfa" + ] + ], + "versions": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T16:25:57.553286" + }, "homo_sapiens - [vcf] - vcf - descending_sort": { "content": [ { "0": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.vcf:md5,c843f4078a1e55b518f7bb06f2b7ca95" ] @@ -17,8 +82,7 @@ "vcf": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.vcf:md5,c843f4078a1e55b518f7bb06f2b7ca95" ] @@ -32,7 +96,30 @@ "nf-test": "0.9.3", "nextflow": "25.10.0" }, - "timestamp": "2025-10-29T11:04:14.876462" + "timestamp": "2025-10-29T16:24:51.085182" + }, + "homo_sapiens - [vcf] - vcf - complex_expression": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "vcf": [ + + ], + "versions": [ + + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T16:25:02.792878" }, "homo_sapiens - [vcf] - vcf - stub": { "content": [ @@ -61,13 +148,51 @@ "versions": [ "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" ] + }, + { + "VEMBRANE_SORT": { + "vembrane": "2.4.0" + } + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T16:10:08.227226" + }, + "homo_sapiens - [vcf] - vcf - depth_sort": { + "content": [ + { + "0": [ + [ + { + "id": "test_depth" + }, + "test_depth.vcf:md5,3b1f4f8d274bccc6f9df5029be4da0d7" + ] + ], + "1": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ], + "vcf": [ + [ + { + "id": "test_depth" + }, + "test_depth.vcf:md5,3b1f4f8d274bccc6f9df5029be4da0d7" + ] + ], + "versions": [ + "versions.yml:md5,3e1b564ae9797cf30cb8871cda395a6b" + ] } ], "meta": { "nf-test": "0.9.3", "nextflow": "25.10.0" }, - "timestamp": "2025-10-29T11:04:27.91684" + "timestamp": "2025-10-29T16:25:29.224789" }, "homo_sapiens - [vcf] - vcf - position_sort": { "content": [ @@ -75,8 +200,7 @@ "0": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.vcf:md5,7baef79f7f0d1927f47b80d49aa18004" ] @@ -87,8 +211,7 @@ "vcf": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.vcf:md5,7baef79f7f0d1927f47b80d49aa18004" ] @@ -102,7 +225,30 @@ "nf-test": "0.9.3", "nextflow": "25.10.0" }, - "timestamp": "2025-10-29T11:03:59.609938" + "timestamp": "2025-10-29T16:24:35.504169" + }, + "homo_sapiens - [vcf] - vcf - compressed_output": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "vcf": [ + + ], + "versions": [ + + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-10-29T16:25:15.297894" }, "homo_sapiens - [vcf] - vcf - quality_sort": { "content": [ @@ -110,8 +256,7 @@ "0": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.vcf:md5,67de3aeba1654914c674bfd8be189577" ] @@ -122,8 +267,7 @@ "vcf": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.vcf:md5,67de3aeba1654914c674bfd8be189577" ] @@ -137,6 +281,6 @@ "nf-test": "0.9.3", "nextflow": "25.10.0" }, - "timestamp": "2025-10-29T11:03:45.306624" + "timestamp": "2025-10-29T16:24:19.895047" } } \ No newline at end of file From c7fd05c4c7f12c8dc940d0519b6437051d5f04dd Mon Sep 17 00:00:00 2001 From: Maria Katsantoni Date: Wed, 29 Oct 2025 17:18:15 +0100 Subject: [PATCH 7/7] fix: apply code review fixes --- modules/nf-core/vembrane/sort/main.nf | 18 +++--- .../nf-core/vembrane/sort/tests/main.nf.test | 28 --------- .../vembrane/sort/tests/main.nf.test.snap | 58 ++----------------- 3 files changed, 16 insertions(+), 88 deletions(-) diff --git a/modules/nf-core/vembrane/sort/main.nf b/modules/nf-core/vembrane/sort/main.nf index 4d0c809db7a..fe6d68a47dc 100644 --- a/modules/nf-core/vembrane/sort/main.nf +++ b/modules/nf-core/vembrane/sort/main.nf @@ -13,7 +13,7 @@ process VEMBRANE_SORT { output: tuple val(meta), path("*.vcf*"), emit: vcf - path "versions.yml" , emit: versions + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -21,9 +21,11 @@ process VEMBRANE_SORT { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def suffix = args.contains('--output-fmt vcf.gz') ? 'vcf.gz' : - args.contains('--output-fmt bcf') ? 'bcf' : - args.contains('--output-fmt bcf.gz') ? 'bcf.gz' : 'vcf' + def suffix = args.contains('--output-fmt vcf.gz') + ? 'vcf.gz' + : args.contains('--output-fmt bcf') + ? 'bcf' + : args.contains('--output-fmt bcf.gz') ? 'bcf.gz' : 'vcf' """ vembrane sort \\ ${args} \\ @@ -40,9 +42,11 @@ process VEMBRANE_SORT { stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def suffix = args.contains('--output-fmt vcf.gz') ? 'vcf.gz' : - args.contains('--output-fmt bcf') ? 'bcf' : - args.contains('--output-fmt bcf.gz') ? 'bcf.gz' : 'vcf' + def suffix = args.contains('--output-fmt vcf.gz') + ? 'vcf.gz' + : args.contains('--output-fmt bcf') + ? 'bcf' + : args.contains('--output-fmt bcf.gz') ? 'bcf.gz' : 'vcf' """ touch ${prefix}.${suffix} diff --git a/modules/nf-core/vembrane/sort/tests/main.nf.test b/modules/nf-core/vembrane/sort/tests/main.nf.test index d6c3bfeba80..2113b848b8e 100644 --- a/modules/nf-core/vembrane/sort/tests/main.nf.test +++ b/modules/nf-core/vembrane/sort/tests/main.nf.test @@ -85,34 +85,6 @@ nextflow_process { } } - - test("homo_sapiens - [vcf] - vcf - compressed_output") { - - config "./nextflow.config" - - when { - params { - vembrane_args = '--output-fmt vcf.gz' - } - process { - """ - input[0] = [ - [ id:'test_gz' ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) - ] - input[1] = 'QUAL' - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - test("homo_sapiens - [vcf] - vcf - depth_sort") { when { diff --git a/modules/nf-core/vembrane/sort/tests/main.nf.test.snap b/modules/nf-core/vembrane/sort/tests/main.nf.test.snap index 5a8365f6b7b..fc21a3171de 100644 --- a/modules/nf-core/vembrane/sort/tests/main.nf.test.snap +++ b/modules/nf-core/vembrane/sort/tests/main.nf.test.snap @@ -98,39 +98,15 @@ }, "timestamp": "2025-10-29T16:24:51.085182" }, - "homo_sapiens - [vcf] - vcf - complex_expression": { - "content": [ - { - "0": [ - - ], - "1": [ - - ], - "vcf": [ - - ], - "versions": [ - - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-10-29T16:25:02.792878" - }, "homo_sapiens - [vcf] - vcf - stub": { "content": [ { "0": [ [ { - "id": "test", - "single_end": false + "id": "test_stub" }, - "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test_stub.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -139,10 +115,9 @@ "vcf": [ [ { - "id": "test", - "single_end": false + "id": "test_stub" }, - "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test_stub.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ @@ -159,7 +134,7 @@ "nf-test": "0.9.3", "nextflow": "25.10.0" }, - "timestamp": "2025-10-29T16:10:08.227226" + "timestamp": "2025-10-29T17:07:09.663691" }, "homo_sapiens - [vcf] - vcf - depth_sort": { "content": [ @@ -227,29 +202,6 @@ }, "timestamp": "2025-10-29T16:24:35.504169" }, - "homo_sapiens - [vcf] - vcf - compressed_output": { - "content": [ - { - "0": [ - - ], - "1": [ - - ], - "vcf": [ - - ], - "versions": [ - - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.0" - }, - "timestamp": "2025-10-29T16:25:15.297894" - }, "homo_sapiens - [vcf] - vcf - quality_sort": { "content": [ {