From 934acb9ebe3984fa00f26040e4d11d0c13a41f7e Mon Sep 17 00:00:00 2001 From: itrujnara Date: Thu, 7 May 2026 08:29:23 +0000 Subject: [PATCH 01/23] feat(htslib_bgziptabix): add module for bgzip compression and decompression with tests --- .../nf-core/htslib/bgziptabix/environment.yml | 7 + modules/nf-core/htslib/bgziptabix/main.nf | 77 ++ modules/nf-core/htslib/bgziptabix/meta.yml | 79 +++ .../htslib/bgziptabix/tests/main.nf.test | 382 ++++++++++ .../htslib/bgziptabix/tests/main.nf.test.snap | 666 ++++++++++++++++++ 5 files changed, 1211 insertions(+) create mode 100644 modules/nf-core/htslib/bgziptabix/environment.yml create mode 100644 modules/nf-core/htslib/bgziptabix/main.nf create mode 100644 modules/nf-core/htslib/bgziptabix/meta.yml create mode 100644 modules/nf-core/htslib/bgziptabix/tests/main.nf.test create mode 100644 modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap diff --git a/modules/nf-core/htslib/bgziptabix/environment.yml b/modules/nf-core/htslib/bgziptabix/environment.yml new file mode 100644 index 00000000000..0ef3e1c9a36 --- /dev/null +++ b/modules/nf-core/htslib/bgziptabix/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::htslib=1.23.1" diff --git a/modules/nf-core/htslib/bgziptabix/main.nf b/modules/nf-core/htslib/bgziptabix/main.nf new file mode 100644 index 00000000000..d18a7489866 --- /dev/null +++ b/modules/nf-core/htslib/bgziptabix/main.nf @@ -0,0 +1,77 @@ +process HTSLIB_BGZIPTABIX { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/53/53334d0d6ed42b863e50a0feb601505035ed5d5ae9fe6507cadceacc9f1545aa/data': + 'community.wave.seqera.io/library/htslib:1.23.1--45117a0a8dbaa21c' }" + + input: + tuple val(meta), path(in_file) + val action + val make_index + val out_ext + + output: + tuple val(meta), path("${outfile}") , emit: output + tuple val(meta), path("${outfile}.{tbi,csi}"), emit: index , optional: true + // all htslib tools have the same version, we use bgzip + tuple val("${task.process}"), val('htslib'), eval("bgzip --version | sed '1! d; s/bgzip (htslib) //'"), topic: versions, emit: versions_htslib + + when: + task.ext.when == null || task.ext.when + + script: + def allowed_actions = ["compress", "decompress"] + if (action !in allowed_actions) { + error "htslib/bgziptabix: Invalid action: ${action}. Allowed actions are: ${allowed_actions.join(', ')}" + } + + if (action == "decompress" && make_index) { + log.warn("htslib/bgziptabix: Cannot create index when decompressing. Ignoring make_index option.") + } + + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + outfile = action == "compress" ? (out_ext ? "${prefix}.${out_ext}.gz" : "${prefix}.gz") : (out_ext ? "${prefix}.${out_ext}" : "${prefix}") + + def compress_cmd = action == "compress" ? "bgzip -c ${args} -@ ${task.cpus}" : "cat" + def bgzip_cmd = action == "compress" ? "[ '\$(basename ${in_file})' != '\$(basename ${outfile})' ] && ln -s ${in_file} ${outfile} ;;" : "bgzip -d -c ${args} -@ ${task.cpus} ${in_file} > ${outfile} ;;" + def tabix_cmd = make_index ? "tabix -@ ${task.cpus} ${args2} -f ${outfile}" : "" + """ + FILE_TYPE=\$(htsfile ${in_file}) + case "\$FILE_TYPE" in + *BGZF-compressed*) + ${bgzip_cmd} + *gzip-compressed*) + [ "\$(basename ${in_file})" == "\$(basename ${outfile})" ] && echo "Input and output names cannot be the same" && exit 1 + zcat ${in_file} | ${compress_cmd} > ${outfile} ;; + *bzip2-compressed*) + bzcat ${in_file} | ${compress_cmd} > ${outfile} ;; + *XZ-compressed*) + xzcat ${in_file} | ${compress_cmd} > ${outfile} ;; + *) + ${compress_cmd} ${in_file} > ${outfile} ;; + esac + + ${tabix_cmd} + """ + + stub: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + outfile = action == "compress" ? (out_ext ? "${prefix}.${out_ext}.gz" : "${prefix}.gz") : (out_ext ? "${prefix}.${out_ext}" : "${prefix}") + + def touch_cmd = action == "compress" ? "echo | bgzip -c" : "echo" + def tabix_cmd = make_index ? "tabix -@ ${task.cpus} ${args2} -f ${outfile}" : "" + """ + echo $args + + $touch_cmd > $outfile + + ${tabix_cmd} + """ +} diff --git a/modules/nf-core/htslib/bgziptabix/meta.yml b/modules/nf-core/htslib/bgziptabix/meta.yml new file mode 100644 index 00000000000..f2bd4e2afbd --- /dev/null +++ b/modules/nf-core/htslib/bgziptabix/meta.yml @@ -0,0 +1,79 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "htslib_bgziptabix" +description: "Multi-purpose module to compress, decompress and index files using bgzip and tabix." +keywords: + - compress + - decompress + - index + - bgzip + - tabix + - gzip + - bzip + - xz +tools: + - "htslib": + description: "C library for high-throughput sequencing data formats." + homepage: "http://www.htslib.org/" + documentation: "http://www.htslib.org/doc/" + tool_dev_url: "https://github.com/samtools/htslib" + doi: "10.1093/gigascience/giab007" + licence: ["MIT"] + identifier: biotools:htslib + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample1' ] + - in_file: + type: file + description: Input file to compress or decompress + pattern: "*" + ontologies: [] + - action: + type: string + description: Action to perform, either `compress` or `decompress` + - make_index: + type: boolean + description: Whether to create a tabix index for the output file; only used if `action` is `compress` + - out_ext: + type: string + description: Output file extension without `.gz` suffix (for example `vcf`) +output: + output: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample1' ] + - "*": + type: file + description: Compressed or decompressed output file + pattern: "*" + ontologies: [] + versions_htslib: + - - ${task.process}: + type: string + description: The name of the process + - htslib: + type: string + description: The name of the tool + - "bgzip --version | sed '1! d; s/bgzip (htslib) //'": + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - htslib: + type: string + description: The name of the tool + - "bgzip --version | sed '1! d; s/bgzip (htslib) //'": + type: eval + description: The expression to obtain the version of the tool +authors: + - "@itrujnara" +maintainers: + - "@itrujnara" diff --git a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test new file mode 100644 index 00000000000..d60af9a7b24 --- /dev/null +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test @@ -0,0 +1,382 @@ +nextflow_process { + + name "Test Process HTSLIB_BGZIPTABIX" + script "../main.nf" + process "HTSLIB_BGZIPTABIX" + + tag "modules" + tag "modules_nfcore" + tag "htslib" + tag "htslib/bgziptabix" + + test("sarscov2 - vcf - decompress") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + ] + input[1] = 'decompress' // action + input[2] = false // make_index + input[3] = 'vcf' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() }, + { assert process.out.output.get(0).get(1).endsWith('.vcf') }, + { assert process.out.index.size() == 0 } + ) + } + + } + + test("sarscov2 - vcf - compress - index") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + ] + input[1] = 'compress' // action + input[2] = true // make_index + input[3] = 'vcf' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() }, + { assert process.out.output.get(0).get(1).endsWith('.vcf.gz') }, + { assert process.out.index.get(0).get(1).endsWith('.vcf.gz.tbi') } + ) + } + + } + + test("sarscov2 - bgzip - decompress") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + ] + input[1] = 'decompress' // action + input[2] = false // make_index + input[3] = 'vcf' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() }, + { assert process.out.output.get(0).get(1).endsWith('.vcf') }, + { assert process.out.index.size() == 0 } + ) + } + } + + test("sarscov2 - bgzip - compress - no index") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + ] + input[1] = 'compress' // action + input[2] = false // make_index + input[3] = 'vcf' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() }, + { assert process.out.output.get(0).get(1).endsWith('.vcf.gz') }, + { assert process.out.index.size() == 0 } + ) + } + + } + + test("sarscov2 - gzip - decompress") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + ] + input[1] = 'decompress' // action + input[2] = false // make_index + input[3] = 'fastq' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() }, + { assert process.out.output.get(0).get(1).endsWith('.fastq') }, + { assert process.out.index.size() == 0 } + ) + } + } + + test("sarscov2 - gzip - (re)compress - no index") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + ] + input[1] = 'compress' // action + input[2] = false // make_index + input[3] = 'fastq' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() }, + { assert process.out.output.get(0).get(1).endsWith('.fastq.gz') }, + { assert process.out.index.size() == 0 } + ) + } + } + + test("metagenome - bz2 - decompress") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/prokaryotes/metagenome/rgi/card-data.tar.bz2', checkIfExists: true), + ] + input[1] = 'decompress' // action + input[2] = false // make_index + input[3] = 'tar' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() }, + { assert process.out.output.get(0).get(1).endsWith('.tar') }, + { assert process.out.index.size() == 0 } + ) + } + } + + test("metagenome - bz2 - (re)compress - no index") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/prokaryotes/metagenome/rgi/card-data.tar.bz2', checkIfExists: true), + ] + input[1] = 'compress' // action + input[2] = false // make_index + input[3] = 'tar' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() }, + { assert process.out.output.get(0).get(1).endsWith('.tar.gz') }, + { assert process.out.index.size() == 0 } + ) + } + } + + test("metagenome - xz - decompress") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/prokaryotes/metagenome/taxonomy/misc/taxa_sqlite.xz', checkIfExists: true), + ] + input[1] = 'decompress' // action + input[2] = false // make_index + input[3] = '' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() }, + { assert process.out.output.get(0).get(1).endsWith('test') }, + { assert process.out.index.size() == 0 } + ) + } + } + + test("metagenome - xz - (re)compress - no index") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/prokaryotes/metagenome/taxonomy/misc/taxa_sqlite.xz', checkIfExists: true), + ] + input[1] = 'compress' // action + input[2] = false // make_index + input[3] = '' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() }, + { assert process.out.output.get(0).get(1).endsWith('.gz') }, + { assert process.out.index.size() == 0 } + ) + } + } + + test("sarscov2 - vcf - compress - no index - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + ] + input[1] = 'compress' // action + input[2] = false // make_index + input[3] = 'vcf' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - vcf - decompress - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + ] + input[1] = 'decompress' // action + input[2] = false // make_index + input[3] = 'vcf' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(process.out).match() } + ) + } + + } + + test("illegal action") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + ] + input[1] = 'invalid_action' // action + input[2] = true // make_index + input[3] = 'vcf' // out_ext + """ + } + } + + then { + assert process.failed + assert process.errorReport.contains("Invalid action: invalid_action. Allowed actions are: compress, decompress") + } + + } + +} diff --git a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap new file mode 100644 index 00000000000..12036717cd6 --- /dev/null +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap @@ -0,0 +1,666 @@ +{ + "sarscov2 - gzip - (re)compress - no index": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-06T15:00:03.802747158", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "metagenome - xz - (re)compress - no index": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-06T15:18:31.718868487", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "metagenome - bz2 - decompress": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.tar:md5,39e9e71fd16cfd09ceca12cd46e6abce" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.tar:md5,39e9e71fd16cfd09ceca12cd46e6abce" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-06T15:00:14.390739704", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "sarscov2 - vcf - decompress": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-07T08:23:51.042790177", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "metagenome - bz2 - (re)compress - no index": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.tar.gz:md5,39e9e71fd16cfd09ceca12cd46e6abce" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.tar.gz:md5,39e9e71fd16cfd09ceca12cd46e6abce" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-06T15:18:08.165435155", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "sarscov2 - vcf - compress - index": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,7f005943c935f2b55ba3f9d4802aa09f" + ] + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,7f005943c935f2b55ba3f9d4802aa09f" + ] + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-06T14:59:41.265882348", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "metagenome - xz - decompress": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-06T15:18:21.659347536", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "sarscov2 - vcf - decompress - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-06T15:18:46.671916956", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "sarscov2 - vcf - compress - no index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-06T15:27:48.766118732", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "sarscov2 - gzip - decompress": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-06T15:17:43.605725172", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "sarscov2 - bgzip - compress - no index": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-06T14:59:48.733485267", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "sarscov2 - bgzip - decompress": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-06T13:47:25.489040234", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + } +} \ No newline at end of file From e22514bd7234e8082fc813734e71f8bd18df33af Mon Sep 17 00:00:00 2001 From: itrujnara Date: Thu, 7 May 2026 11:26:21 +0000 Subject: [PATCH 02/23] feat(htslib_bgziptabix): update environment and main process for improved compatibility and add new tests for name clash handling --- .../nf-core/htslib/bgziptabix/environment.yml | 1 + modules/nf-core/htslib/bgziptabix/main.nf | 27 ++++++++--------- modules/nf-core/htslib/bgziptabix/meta.yml | 29 ++++++++++++++----- .../htslib/bgziptabix/tests/main.nf.test | 24 +++++++++++++++ .../htslib/bgziptabix/tests/main.nf.test.snap | 24 +++++++-------- 5 files changed, 72 insertions(+), 33 deletions(-) diff --git a/modules/nf-core/htslib/bgziptabix/environment.yml b/modules/nf-core/htslib/bgziptabix/environment.yml index 0ef3e1c9a36..69099380ea3 100644 --- a/modules/nf-core/htslib/bgziptabix/environment.yml +++ b/modules/nf-core/htslib/bgziptabix/environment.yml @@ -5,3 +5,4 @@ channels: - bioconda dependencies: - "bioconda::htslib=1.23.1" + - "conda-forge::xz=5.8.3" diff --git a/modules/nf-core/htslib/bgziptabix/main.nf b/modules/nf-core/htslib/bgziptabix/main.nf index d18a7489866..35d2fab708d 100644 --- a/modules/nf-core/htslib/bgziptabix/main.nf +++ b/modules/nf-core/htslib/bgziptabix/main.nf @@ -4,11 +4,11 @@ process HTSLIB_BGZIPTABIX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/53/53334d0d6ed42b863e50a0feb601505035ed5d5ae9fe6507cadceacc9f1545aa/data': - 'community.wave.seqera.io/library/htslib:1.23.1--45117a0a8dbaa21c' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/33/33a1f2c7f36ec58339e41cbea096d121f606918778a91cfbef944b40ba7ce48b/data': + 'community.wave.seqera.io/library/htslib_xz:49c8c84af5c4b3b9' }" input: - tuple val(meta), path(in_file) + tuple val(meta), path(infile) val action val make_index val out_ext @@ -37,23 +37,24 @@ process HTSLIB_BGZIPTABIX { prefix = task.ext.prefix ?: "${meta.id}" outfile = action == "compress" ? (out_ext ? "${prefix}.${out_ext}.gz" : "${prefix}.gz") : (out_ext ? "${prefix}.${out_ext}" : "${prefix}") - def compress_cmd = action == "compress" ? "bgzip -c ${args} -@ ${task.cpus}" : "cat" - def bgzip_cmd = action == "compress" ? "[ '\$(basename ${in_file})' != '\$(basename ${outfile})' ] && ln -s ${in_file} ${outfile} ;;" : "bgzip -d -c ${args} -@ ${task.cpus} ${in_file} > ${outfile} ;;" - def tabix_cmd = make_index ? "tabix -@ ${task.cpus} ${args2} -f ${outfile}" : "" + def compress_cmd = action == "compress" ? "bgzip -c ${args} -@ ${task.cpus}" : "cat" + def bgzip_cmd = action == "compress" ? "[ '\$(basename ${infile})' != '\$(basename ${outfile})' ] && ln -s ${infile} ${outfile}" : "${compress_cmd} ${infile} > ${outfile}" + def tabix_cmd = make_index ? "tabix -@ ${task.cpus} ${args2} -f ${outfile}" : "" + def uncompressed_cmd = action == "compress" ? "${compress_cmd} ${infile} > ${outfile}" : (infile.getName() == outfile ? "" : "ln -s ${infile} ${outfile}") """ - FILE_TYPE=\$(htsfile ${in_file}) + FILE_TYPE=\$(htsfile ${infile}) case "\$FILE_TYPE" in *BGZF-compressed*) - ${bgzip_cmd} + ${bgzip_cmd} ;; *gzip-compressed*) - [ "\$(basename ${in_file})" == "\$(basename ${outfile})" ] && echo "Input and output names cannot be the same" && exit 1 - zcat ${in_file} | ${compress_cmd} > ${outfile} ;; + [ "\$(basename ${infile})" == "\$(basename ${outfile})" ] && echo "Input and output names cannot be the same" && exit 1 + zcat ${infile} | ${compress_cmd} > ${outfile} ;; *bzip2-compressed*) - bzcat ${in_file} | ${compress_cmd} > ${outfile} ;; + bzcat ${infile} | ${compress_cmd} > ${outfile} ;; *XZ-compressed*) - xzcat ${in_file} | ${compress_cmd} > ${outfile} ;; + xzcat ${infile} | ${compress_cmd} > ${outfile} ;; *) - ${compress_cmd} ${in_file} > ${outfile} ;; + ${uncompressed_cmd} ;; esac ${tabix_cmd} diff --git a/modules/nf-core/htslib/bgziptabix/meta.yml b/modules/nf-core/htslib/bgziptabix/meta.yml index f2bd4e2afbd..6f958ef60ca 100644 --- a/modules/nf-core/htslib/bgziptabix/meta.yml +++ b/modules/nf-core/htslib/bgziptabix/meta.yml @@ -1,6 +1,6 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: "htslib_bgziptabix" -description: "Multi-purpose module to compress, decompress and index files using bgzip and tabix." +description: "Multi-purpose module to compress, decompress and index files using bgzip + and tabix." keywords: - compress - decompress @@ -17,9 +17,9 @@ tools: documentation: "http://www.htslib.org/doc/" tool_dev_url: "https://github.com/samtools/htslib" doi: "10.1093/gigascience/giab007" - licence: ["MIT"] + licence: + - "MIT" identifier: biotools:htslib - input: - - meta: type: map @@ -36,7 +36,8 @@ input: description: Action to perform, either `compress` or `decompress` - make_index: type: boolean - description: Whether to create a tabix index for the output file; only used if `action` is `compress` + description: Whether to create a tabix index for the output file; only used + if `action` is `compress` - out_ext: type: string description: Output file extension without `.gz` suffix (for example `vcf`) @@ -47,11 +48,23 @@ output: description: | Groovy Map containing sample information e.g. [ id:'sample1' ] - - "*": + - ${outfile}: type: file description: Compressed or decompressed output file pattern: "*" ontologies: [] + index: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample1' ] + - ${outfile}.{tbi,csi}: + type: file + description: Tabix index file for the compressed output file + pattern: "*.{tbi,csi}" + ontologies: + - edam: http://edamontology.org/format_3616 # tabix versions_htslib: - - ${task.process}: type: string @@ -59,7 +72,7 @@ output: - htslib: type: string description: The name of the tool - - "bgzip --version | sed '1! d; s/bgzip (htslib) //'": + - bgzip --version | sed '1! d; s/bgzip (htslib) //': type: eval description: The expression to obtain the version of the tool topics: @@ -70,7 +83,7 @@ topics: - htslib: type: string description: The name of the tool - - "bgzip --version | sed '1! d; s/bgzip (htslib) //'": + - bgzip --version | sed '1! d; s/bgzip (htslib) //': type: eval description: The expression to obtain the version of the tool authors: diff --git a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test index d60af9a7b24..b472e47e36a 100644 --- a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test @@ -186,6 +186,30 @@ nextflow_process { } } + test("sarscov2 - gzip - name clash") { + + when { + process { + """ + input[0] = [ + [ id:'test_1' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + ] + input[1] = 'compress' // action + input[2] = false // make_index + input[3] = 'fastq' // out_ext + """ + } + } + + then { + assert process.failed + assertAll( + { assert process.errorReport.contains("Input and output names cannot be the same") } + ) + } + } + test("metagenome - bz2 - decompress") { when { diff --git a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap index 12036717cd6..eb30bd69813 100644 --- a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap @@ -63,7 +63,7 @@ { "id": "test" }, - "test.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.gz:md5,b8d852a2b1ee52ed64d83046dcdb9de2" ] ], "1": [ @@ -84,7 +84,7 @@ { "id": "test" }, - "test.gz:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.gz:md5,b8d852a2b1ee52ed64d83046dcdb9de2" ] ], "versions_htslib": [ @@ -105,7 +105,7 @@ ] } ], - "timestamp": "2026-05-06T15:18:31.718868487", + "timestamp": "2026-05-07T09:51:48.280693973", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -175,7 +175,7 @@ { "id": "test" }, - "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf:md5,8e722884ffb75155212a3fc053918766" ] ], "1": [ @@ -196,7 +196,7 @@ { "id": "test" }, - "test.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf:md5,8e722884ffb75155212a3fc053918766" ] ], "versions_htslib": [ @@ -217,7 +217,7 @@ ] } ], - "timestamp": "2026-05-07T08:23:51.042790177", + "timestamp": "2026-05-07T10:01:52.038270626", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -353,7 +353,7 @@ { "id": "test" }, - "test:md5,d41d8cd98f00b204e9800998ecf8427e" + "test:md5,b8d852a2b1ee52ed64d83046dcdb9de2" ] ], "1": [ @@ -374,7 +374,7 @@ { "id": "test" }, - "test:md5,d41d8cd98f00b204e9800998ecf8427e" + "test:md5,b8d852a2b1ee52ed64d83046dcdb9de2" ] ], "versions_htslib": [ @@ -395,7 +395,7 @@ ] } ], - "timestamp": "2026-05-06T15:18:21.659347536", + "timestamp": "2026-05-07T09:51:11.862701779", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -615,7 +615,7 @@ { "id": "test" }, - "test.vcf:md5,8e722884ffb75155212a3fc053918766" + "test.vcf:md5,02aff9ae43faf2594f28e2cf87b32ba9" ] ], "1": [ @@ -636,7 +636,7 @@ { "id": "test" }, - "test.vcf:md5,8e722884ffb75155212a3fc053918766" + "test.vcf:md5,02aff9ae43faf2594f28e2cf87b32ba9" ] ], "versions_htslib": [ @@ -657,7 +657,7 @@ ] } ], - "timestamp": "2026-05-06T13:47:25.489040234", + "timestamp": "2026-05-07T09:49:59.75511926", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" From 10752d94ee7f1a2bc3d07e36c434334efb6b51aa Mon Sep 17 00:00:00 2001 From: itrujnara Date: Thu, 7 May 2026 12:19:58 +0000 Subject: [PATCH 03/23] feat(tabix_bgzip): deprecate TABIX/BGZIP --- modules/nf-core/tabix/bgzip/main.nf | 38 ++++------ modules/nf-core/tabix/bgzip/meta.yml | 2 +- .../nf-core/tabix/bgzip/tests/main.nf.test | 69 ++----------------- 3 files changed, 21 insertions(+), 88 deletions(-) diff --git a/modules/nf-core/tabix/bgzip/main.nf b/modules/nf-core/tabix/bgzip/main.nf index 9acb2ef8d90..8768c96b5ba 100644 --- a/modules/nf-core/tabix/bgzip/main.nf +++ b/modules/nf-core/tabix/bgzip/main.nf @@ -11,7 +11,7 @@ process TABIX_BGZIP { tuple val(meta), path(input) output: - tuple val(meta), path("${output}"), emit: output + tuple val(meta), path("output.gz"), emit: output tuple val(meta), path("*.gzi") , emit: gzi, optional: true tuple val("${task.process}"), val('tabix'), eval("tabix -h 2>&1 | grep -oP 'Version:\\s*\\K[^\\s]+'") , topic: versions , emit: versions_tabix @@ -19,30 +19,20 @@ process TABIX_BGZIP { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - in_bgzip = ["gz", "bgz", "bgzf"].contains(input.getExtension()) - extension = in_bgzip ? input.getBaseName().tokenize(".")[-1] : input.getExtension() - output = in_bgzip ? "${prefix}.${extension}" : "${prefix}.${extension}.gz" - command = in_bgzip ? '-d' : '' - // Name the index according to $prefix, unless a name has been requested - split_args = args.split(' +|=') - if ((split_args.contains('-i') || split_args.contains('--index')) && !split_args.contains('-I') && !split_args.contains('--index-name')) { - args = args + " -I ${output}.gzi" - } - """ - bgzip $command -c $args -@${task.cpus} $input > ${output} - - """ + def deprecation_message = """ + WARNING: This module has been deprecated. Please use HTSLIB/BGZIPTABIX instead. - stub: - prefix = task.ext.prefix ?: "${meta.id}" - in_bgzip = ["gz", "bgz", "bgzf"].contains(input.getExtension()) - output = in_bgzip ? input.getBaseName() : "${prefix}.${input.getExtension()}.gz" + Reason: + This module is duplicative of TABIX/BGZIPTABIX and SAMTOOLS/BGZIP. The new HTSLIB/BGZIPTABIX module provides equivalent functionality with a more predictable behavior and better interface. + """.stripIndent() + assert false: deprecation_message - """ - echo "" | gzip > ${output} - touch ${output}.gzi + stub: + def deprecation_message = """ + WARNING: This module has been deprecated. Please use HTSLIB/BGZIPTABIX instead. - """ + Reason: + This module is duplicative of TABIX/BGZIPTABIX and SAMTOOLS/BGZIP. The new HTSLIB/BGZIPTABIX module provides equivalent functionality with a more predictable behavior and better interface. + """.stripIndent() + assert false: deprecation_message } diff --git a/modules/nf-core/tabix/bgzip/meta.yml b/modules/nf-core/tabix/bgzip/meta.yml index 7b56e897cc1..a94e3a21ed7 100644 --- a/modules/nf-core/tabix/bgzip/meta.yml +++ b/modules/nf-core/tabix/bgzip/meta.yml @@ -1,5 +1,5 @@ name: tabix_bgzip -description: Compresses/decompresses files +description: DEPRECATED. Use HTSLIB/BGZIPTABIX instead. Compresses/decompresses files keywords: - compress - decompress diff --git a/modules/nf-core/tabix/bgzip/tests/main.nf.test b/modules/nf-core/tabix/bgzip/tests/main.nf.test index 00e7c098402..e4eca15e9c8 100644 --- a/modules/nf-core/tabix/bgzip/tests/main.nf.test +++ b/modules/nf-core/tabix/bgzip/tests/main.nf.test @@ -9,7 +9,7 @@ nextflow_process { tag "tabix" tag "tabix/bgzip" - test("sarscov2_vcf_bgzip_compress") { + test("sarscov2 - vcf - bgzip - compress - deprecated") { when { process { """ @@ -23,41 +23,13 @@ nextflow_process { then { assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() }, - { assert snapshot( - file(process.out.output[0][1]).name - ).match("bgzip_test") - } + { assert process.failed }, + { assert process.errorReport.contains("WARNING: This module has been deprecated.") } ) } } - test("homo_genome_bedgz_compress") { - when { - process { - """ - input[0] = [ - [ id:'bedgz_test' ], - [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz', checkIfExists: true) ] - ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() }, - { assert snapshot( - file(process.out.output[0][1]).name - ).match("bedgz_test") - } - ) - } - } - - test("sarscov2_vcf_bgzip_compress_stub") { + test("sarscov2 - vcf - bgzip - compress - deprecated - stub") { options '-stub' config "./bgzip_compress.config" @@ -74,37 +46,8 @@ nextflow_process { then { assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() }, - { assert snapshot( - file(process.out.output[0][1]).name - ).match("test_stub") - } - ) - } - } - - test("sarscov2_vcf_bgzip_compress_gzi") { - config "./bgzip_compress.config" - when { - process { - """ - input[0] = [ - [ id:"gzi_compress_test" ], - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) ] - ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() }, - { assert snapshot( - file(process.out.gzi[0][1]).name - ).match("gzi_compress_test") - } + { assert process.failed }, + { assert process.errorReport.contains("WARNING: This module has been deprecated.") } ) } } From eab5fd46418f02820927eb23893abc7d9004f16b Mon Sep 17 00:00:00 2001 From: itrujnara Date: Thu, 7 May 2026 12:20:37 +0000 Subject: [PATCH 04/23] feat: update references from TABIX_BGZIP to HTSLIB_BGZIPTABIX across multiple test files --- .../nf-core/bandage/image/tests/main.nf.test | 13 ++++--- .../geneticmapconvert/tests/main.nf.test | 13 ++++--- .../bedmethyltobigwig/tests/main.nf.test | 15 ++++---- .../multivcfanalyzer/tests/main.nf.test | 1 - modules/nf-core/paraphase/tests/main.nf.test | 25 ++++++++------ modules/nf-core/paraphrase/tests/main.nf.test | 13 ++++--- modules/nf-core/wittyer/tests/main.nf.test | 34 +++++++++++-------- .../tests/main.nf.test | 2 -- .../vcf_annotate_ensemblvep_snpeff/main.nf | 32 ++++++++++------- .../tests/main.nf.test | 3 +- 10 files changed, 88 insertions(+), 63 deletions(-) diff --git a/modules/nf-core/bandage/image/tests/main.nf.test b/modules/nf-core/bandage/image/tests/main.nf.test index f0f83453599..28973f3da7f 100644 --- a/modules/nf-core/bandage/image/tests/main.nf.test +++ b/modules/nf-core/bandage/image/tests/main.nf.test @@ -9,7 +9,7 @@ nextflow_process { tag "modules_nfcore" tag "bandage" tag "bandage/image" - tag "tabix/bgzip" + tag "htslib/bgziptabix" test("test-bandage-image") { @@ -41,14 +41,17 @@ nextflow_process { test("test-bandage-image - gzip") { setup { - run("TABIX_BGZIP"){ - script "../../../tabix/bgzip/main.nf" + run("HTSLIB_BGZIPTABIX"){ + script "../../../htslib/bgziptabix/main.nf" process { """ input[0] = [ [ id:'B-3106' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/gfa/assembly.gfa', checkIfExists: true) - ] + ], + input[1] = "compress", + input[2] = false, + input[3] = "gfa" """ } } @@ -57,7 +60,7 @@ nextflow_process { when { process { """ - input[0] = TABIX_BGZIP.out.output + input[0] = HTSLIB_BGZIPTABIX.out.output """ } } diff --git a/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test b/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test index 3fb055ee168..f6ffe9cd5d3 100644 --- a/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test +++ b/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test @@ -10,7 +10,7 @@ nextflow_process { tag "modules_nfcore" tag "custom" tag "custom/geneticmapconvert" - tag "tabix/bgzip" + tag "htslib/bgziptabix" test("Convert map with pos\\tchr\\tcm - with header - meta.chr (glimpse format)") { when { @@ -44,14 +44,17 @@ nextflow_process { test("Convert map with pos\\tchr\\tcM - with header - meta.chr (glimpse compressed format)") { setup { - run("TABIX_BGZIP"){ - script "../../../tabix/bgzip/main.nf" + run("HTSLIB_BGZIPTABIX"){ + script "../../../htslib/bgziptabix/main.nf" process { """ input[0] = [ [id: "test", chr:"chr21"], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr21.glimpse.map', checkIfExists: true) - ] + ], + input[1] = "compress", + input[2] = false, + input[3] = "map" """ } } @@ -62,7 +65,7 @@ nextflow_process { } process { """ - input[0] = TABIX_BGZIP.out.output + input[0] = HTSLIB_BGZIPTABIX.out.output """ } } diff --git a/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test b/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test index 699e3157b24..583d5089b47 100644 --- a/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test +++ b/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test @@ -9,7 +9,7 @@ nextflow_process { tag "modkit" tag "modkit/bedmethyltobigwig" tag "modkit/pileup" - tag "tabix/bgzip" + tag "htslib/bgziptabix" setup { run("MODKIT_PILEUP"){ @@ -27,11 +27,14 @@ nextflow_process { } } - run("TABIX_BGZIP"){ - script "../../../tabix/bgzip/main.nf" + run("HTSLIB_BGZIPTABIX"){ + script "../../../htslib/bgziptabix/main.nf" process { """ - input[0] = MODKIT_PILEUP.out.bedgz + input[0] = MODKIT_PILEUP.out.bedgz, + input[1] = "decompress", + input[2] = false, + input[3] = "bed" """ } } @@ -42,7 +45,7 @@ nextflow_process { when { process { """ - input[0] = TABIX_BGZIP.out.output + input[0] = HTSLIB_BGZIPTABIX.out.output input[1] = [ [ id : 'hg38' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) @@ -88,7 +91,7 @@ nextflow_process { when { process { """ - input[0] = TABIX_BGZIP.out.output + input[0] = HTSLIB_BGZIPTABIX.out.output input[1] = [ [ id : 'hg38' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) diff --git a/modules/nf-core/multivcfanalyzer/tests/main.nf.test b/modules/nf-core/multivcfanalyzer/tests/main.nf.test index a26d0b87916..6a892878022 100644 --- a/modules/nf-core/multivcfanalyzer/tests/main.nf.test +++ b/modules/nf-core/multivcfanalyzer/tests/main.nf.test @@ -7,7 +7,6 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "multivcfanalyzer" - tag "tabix/bgzip" tag "gatk/unifiedgenotyper" test("sarscov2 - vcf") { diff --git a/modules/nf-core/paraphase/tests/main.nf.test b/modules/nf-core/paraphase/tests/main.nf.test index 4705fc152cd..c998f6c13ef 100644 --- a/modules/nf-core/paraphase/tests/main.nf.test +++ b/modules/nf-core/paraphase/tests/main.nf.test @@ -8,17 +8,20 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "paraphase" - tag "tabix/bgzip" + tag "htslib/bgziptabix" setup { - run("TABIX_BGZIP") { - script "../../tabix/bgzip/main.nf" + run("HTSLIB_BGZIPTABIX") { + script "../../htslib/bgziptabix/main.nf" process { """ input[0] = [ [ id:'test_ref' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr22_chr22_KI270734v1_random/sequence/genome.fa.gz', checkIfExists: true), - ] + ], + input[1] = "decompress", + input[2] = false, + input[3] = "fa" """ } } @@ -37,7 +40,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), ] - input[1] = TABIX_BGZIP.out.output + input[1] = HTSLIB_BGZIPTABIX.out.output input[2] = [ [:], [] @@ -77,7 +80,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), ] - input[1] = TABIX_BGZIP.out.output + input[1] = HTSLIB_BGZIPTABIX.out.output input[2] = [ [ id:'test_config' ], file(params.modules_testdata_base_path + 'generic/config/paraphase_config.yaml', checkIfExists: true), @@ -116,7 +119,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), ] - input[1] = TABIX_BGZIP.out.output + input[1] = HTSLIB_BGZIPTABIX.out.output input[2] = [ [ id:'test_config' ], file(params.modules_testdata_base_path + 'generic/config/paraphase_config.yaml', checkIfExists: true), @@ -156,7 +159,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), ] - input[1] = TABIX_BGZIP.out.output + input[1] = HTSLIB_BGZIPTABIX.out.output input[2] = [ [ id:'test_config' ], file(params.modules_testdata_base_path + 'generic/config/paraphase_config.yaml', checkIfExists: true), @@ -197,7 +200,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), ] - input[1] = TABIX_BGZIP.out.output + input[1] = HTSLIB_BGZIPTABIX.out.output input[2] = [ [:], [] @@ -229,7 +232,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), ] - input[1] = TABIX_BGZIP.out.output + input[1] = HTSLIB_BGZIPTABIX.out.output input[2] = [ [ id:'test_config' ], file(params.modules_testdata_base_path + 'generic/config/paraphase_config.yaml', checkIfExists: true), @@ -262,7 +265,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), ] - input[1] = TABIX_BGZIP.out.output + input[1] = HTSLIB_BGZIPTABIX.out.output input[2] = [ [ id:'test_config' ], file(params.modules_testdata_base_path + 'generic/config/paraphase_config.yaml', checkIfExists: true), diff --git a/modules/nf-core/paraphrase/tests/main.nf.test b/modules/nf-core/paraphrase/tests/main.nf.test index 8f1494d1b2d..eb4cb982a6c 100644 --- a/modules/nf-core/paraphrase/tests/main.nf.test +++ b/modules/nf-core/paraphrase/tests/main.nf.test @@ -7,19 +7,22 @@ nextflow_process { tag "modules" tag "modules_nfcore" - tag "tabix/bgzip" + tag "htslib/bgziptabix" tag "paraphase" tag "paraphrase" setup { - run("TABIX_BGZIP") { - script "../../tabix/bgzip/main.nf" + run("HTSLIB_BGZIPTABIX") { + script "../../htslib/bgziptabix/main.nf" process { """ input[0] = [ [ id:'test_ref' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr22_chr22_KI270734v1_random/sequence/genome.fa.gz', checkIfExists: true), - ] + ], + input[1] = "decompress", + input[2] = false, + input[3] = "fa" """ } } @@ -32,7 +35,7 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true), ] - input[1] = TABIX_BGZIP.out.output + input[1] = HTSLIB_BGZIPTABIX.out.output input[2] = [ [:], [] diff --git a/modules/nf-core/wittyer/tests/main.nf.test b/modules/nf-core/wittyer/tests/main.nf.test index 3319f262076..bfeb2ae3564 100644 --- a/modules/nf-core/wittyer/tests/main.nf.test +++ b/modules/nf-core/wittyer/tests/main.nf.test @@ -7,33 +7,39 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "wittyer" - tag "tabix/bgzip" + tag "htslib/bgziptabix" config "./nextflow.config" setup { - run('TABIX_BGZIP', alias: 'TABIX_BGZIP_1') { - script "../../../nf-core/tabix/bgzip" + run('HTSLIB_BGZIPTABIX', alias: 'HTSLIB_BGZIPTABIX_1') { + script "../../../nf-core/htslib/bgziptabix/main.nf" process { """ input[0] = [ [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/chr21/simulated_sv.vcf.gz', checkIfExists: true) - ] + ], + input[1] = "decompress", + input[2] = false, + input[3] = "vcf" """ } } - run('TABIX_BGZIP', alias: 'TABIX_BGZIP_2') { - script "../../../nf-core/tabix/bgzip" + run('HTSLIB_BGZIPTABIX', alias: 'HTSLIB_BGZIPTABIX_2') { + script "../../../nf-core/htslib/bgziptabix/main.nf" process { """ input[0] = [ [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/chr21/simulated_sv2.vcf.gz', checkIfExists: true) - ] + ], + input[1] = "decompress", + input[2] = false, + input[3] = "vcf" """ } } @@ -44,7 +50,7 @@ nextflow_process { when { process { """ - input[0] = TABIX_BGZIP_1.out.output.join(TABIX_BGZIP_2.out.output).map{meta, vcf1, vcf2 -> tuple(meta, vcf1, vcf2, [], [])} + input[0] = HTSLIB_BGZIPTABIX_1.out.output.join(HTSLIB_BGZIPTABIX_2.out.output).map{meta, vcf1, vcf2 -> tuple(meta, vcf1, vcf2, [], [])} """ } } @@ -68,8 +74,8 @@ nextflow_process { when { process { """ - input[0] = TABIX_BGZIP_1.out.output - .join(TABIX_BGZIP_2.out.output) + input[0] = HTSLIB_BGZIPTABIX_1.out.output + .join(HTSLIB_BGZIPTABIX_2.out.output) .map{meta, vcf1, vcf2 -> tuple(meta, vcf1, vcf2, [file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true)], @@ -98,8 +104,8 @@ nextflow_process { when { process { """ - input[0] = TABIX_BGZIP_1.out.output - .join(TABIX_BGZIP_2.out.output) + input[0] = HTSLIB_BGZIPTABIX_1.out.output + .join(HTSLIB_BGZIPTABIX_2.out.output) .map{meta, vcf1, vcf2 -> tuple(meta, vcf1, vcf2, [], // change to config file @@ -130,8 +136,8 @@ nextflow_process { when { process { """ - input[0] = TABIX_BGZIP_1.out.output - .join(TABIX_BGZIP_2.out.output) + input[0] = HTSLIB_BGZIPTABIX_1.out.output + .join(HTSLIB_BGZIPTABIX_2.out.output) .map{meta, vcf1, vcf2 -> tuple(meta, vcf1, vcf2, [], [file(params.modules_testdata_base_path + 'generic/config/wittyer_config.json', checkIfExists: true)]) diff --git a/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test index 27fdc93b836..6965ce7da51 100644 --- a/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test +++ b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test @@ -14,8 +14,6 @@ nextflow_workflow { tag "vcf_gather_bcftools" tag "gawk" - tag "tabix" - tag "tabix/bgzip" tag "bcftools" tag "bcftools/mpileup" tag "bcftools/annotate" diff --git a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf index 3ee3fb26c75..a359068bc73 100644 --- a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf +++ b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf @@ -2,13 +2,13 @@ // Run VEP and/or SNPEFF to annotate VCF files // -include { BCFTOOLS_CONCAT } from '../../../modules/nf-core/bcftools/concat' -include { BCFTOOLS_PLUGINSCATTER } from '../../../modules/nf-core/bcftools/pluginscatter' -include { BCFTOOLS_SORT } from '../../../modules/nf-core/bcftools/sort' -include { ENSEMBLVEP_VEP } from '../../../modules/nf-core/ensemblvep/vep' -include { SNPEFF_SNPEFF } from '../../../modules/nf-core/snpeff/snpeff' -include { TABIX_BGZIP } from '../../../modules/nf-core/tabix/bgzip' -include { TABIX_TABIX } from '../../../modules/nf-core/tabix/tabix' +include { BCFTOOLS_CONCAT } from '../../../modules/nf-core/bcftools/concat' +include { BCFTOOLS_PLUGINSCATTER } from '../../../modules/nf-core/bcftools/pluginscatter' +include { BCFTOOLS_SORT } from '../../../modules/nf-core/bcftools/sort' +include { ENSEMBLVEP_VEP } from '../../../modules/nf-core/ensemblvep/vep' +include { SNPEFF_SNPEFF } from '../../../modules/nf-core/snpeff/snpeff' +include { HTSLIB_BGZIPTABIX as COMPRESS_VCF } from '../../../modules/nf-core/htslib/bgziptabix/main.nf' +include { HTSLIB_BGZIPTABIX as INDEX_VCF } from '../../../modules/nf-core/htslib/bgziptabix/main.nf' workflow VCF_ANNOTATE_ENSEMBLVEP_SNPEFF { take: @@ -116,11 +116,14 @@ workflow VCF_ANNOTATE_ENSEMBLVEP_SNPEFF { ch_snpeff_html = SNPEFF_SNPEFF.out.summary_html ch_snpeff_genes = SNPEFF_SNPEFF.out.genes_txt - TABIX_BGZIP( - SNPEFF_SNPEFF.out.vcf + COMPRESS_VCF( + SNPEFF_SNPEFF.out.vcf, + "compress", + false, + "vcf" ) - ch_snpeff_output = TABIX_BGZIP.out.output + ch_snpeff_output = COMPRESS_VCF.out.output } else { ch_snpeff_output = ch_vep_output @@ -166,10 +169,15 @@ workflow VCF_ANNOTATE_ENSEMBLVEP_SNPEFF { return [meta, vcf, []] } - TABIX_TABIX(ch_tabix_input.bgzip.map { meta, vcf -> [meta, vcf, [], []] }) + INDEX_VCF( + ch_tabix_input.bgzip.map { meta, vcf -> [meta, vcf, [], []] }, + "compress", + true, + "vcf" + ) def ch_vcf_tbi = ch_tabix_input.bgzip - .join(TABIX_TABIX.out.index, failOnDuplicate: true, failOnMismatch: true) + .join(INDEX_VCF.out.index, failOnDuplicate: true, failOnMismatch: true) .mix(ch_tabix_input.unzip) emit: diff --git a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/tests/main.nf.test b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/tests/main.nf.test index 85bc7a58e78..951d9f8be16 100644 --- a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/tests/main.nf.test +++ b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/tests/main.nf.test @@ -9,8 +9,7 @@ nextflow_workflow { tag "subworkflows/vcf_annotate_ensemblvep_snpeff" tag "ensemblvep/vep" tag "snpeff/snpeff" - tag "tabix/tabix" - tag "tabix/bgzip" + tag "htslib/bgziptabix" tag "bcftools/pluginscatter" tag "bcftools/concat" tag "bcftools/sort" From 1abe38afeebc43901451bae4bf1ff3344a8ae437 Mon Sep 17 00:00:00 2001 From: itrujnara Date: Thu, 7 May 2026 12:21:35 +0000 Subject: [PATCH 05/23] feat(tabix_bgziptabix): deprecate TABIX/BGZIPTABIX --- modules/nf-core/tabix/bgziptabix/main.nf | 28 ++++----- modules/nf-core/tabix/bgziptabix/meta.yml | 2 +- .../tabix/bgziptabix/tests/main.nf.test | 63 ++----------------- 3 files changed, 20 insertions(+), 73 deletions(-) diff --git a/modules/nf-core/tabix/bgziptabix/main.nf b/modules/nf-core/tabix/bgziptabix/main.nf index 9c901b6ba81..faf928fb44f 100644 --- a/modules/nf-core/tabix/bgziptabix/main.nf +++ b/modules/nf-core/tabix/bgziptabix/main.nf @@ -19,22 +19,20 @@ process TABIX_BGZIPTABIX { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def args2 = task.ext.args2 ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - """ - bgzip --threads ${task.cpus} -c $args $input > ${prefix}.${input.getExtension()}.gz - tabix --threads ${task.cpus} $args2 ${prefix}.${input.getExtension()}.gz + def deprecation_message = """ + WARNING: This module has been deprecated. Please use HTSLIB/BGZIPTABIX instead. - """ + Reason: + This module is duplicative of HTSLIB/BGZIPTABIX. The HTSLIB/BGZIPTABIX module is the canonical replacement and provides equivalent functionality through HTSlib with a more predictable behavior and better interface. + """.stripIndent() + assert false: deprecation_message stub: - def prefix = task.ext.prefix ?: "${meta.id}" - def args2 = task.ext.args2 ?: '' - def index = args2.contains("-C ") || args2.contains("--csi") ? "csi" : "tbi" - """ - echo "" | gzip > ${prefix}.${input.getExtension()}.gz - touch ${prefix}.${input.getExtension()}.gz.${index} - - """ + def deprecation_message = """ + WARNING: This module has been deprecated. Please use HTSLIB/BGZIPTABIX instead. + + Reason: + This module is duplicative of HTSLIB/BGZIPTABIX. The HTSLIB/BGZIPTABIX module is the canonical replacement and provides equivalent functionality through HTSlib with a more predictable behavior and better interface. + """.stripIndent() + assert false: deprecation_message } diff --git a/modules/nf-core/tabix/bgziptabix/meta.yml b/modules/nf-core/tabix/bgziptabix/meta.yml index 2a3078c55fa..ed6e1569c3a 100644 --- a/modules/nf-core/tabix/bgziptabix/meta.yml +++ b/modules/nf-core/tabix/bgziptabix/meta.yml @@ -1,5 +1,5 @@ name: tabix_bgziptabix -description: bgzip a sorted tab-delimited genome file and then create tabix +description: DEPRECATED. Use HTSLIB/BGZIPTABIX instead. bgzip a sorted tab-delimited genome file and then create tabix index keywords: - bgzip diff --git a/modules/nf-core/tabix/bgziptabix/tests/main.nf.test b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test index 1955b143e36..7f9f72bfd6a 100644 --- a/modules/nf-core/tabix/bgziptabix/tests/main.nf.test +++ b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test @@ -11,7 +11,7 @@ nextflow_process { config "./nextflow.config" - test("sarscov2_bed_tbi") { + test("sarscov2 - bed - tbi - deprecated") { when { params { module_args = '-p vcf' @@ -28,63 +28,13 @@ nextflow_process { then { assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } + { assert process.failed }, + { assert process.errorReport.contains("WARNING: This module has been deprecated.") } ) } } - test("sarscov2_bed_csi") { - when { - params { - module_args = '-p vcf --csi' - } - process { - """ - input[0] = [ - [ id:'csi_test' ], - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] - ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2_bed_csi_stub") { - options "-stub" - - when { - params { - module_args = '-p vcf --csi' - } - process { - """ - input[0] = [ - [ id:'test' ], - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] - ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2_bed_tbi_stub") { + test("sarscov2 - bed - tbi - deprecated - stub") { options "-stub" when { @@ -103,11 +53,10 @@ nextflow_process { then { assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } + { assert process.failed }, + { assert process.errorReport.contains("WARNING: This module has been deprecated.") } ) } - } } From 83b1596df0ac1cfe5a87ce2432638b70b7d53d47 Mon Sep 17 00:00:00 2001 From: itrujnara Date: Thu, 7 May 2026 15:37:23 +0000 Subject: [PATCH 06/23] feat: refactor input assignment in test processes for consistency --- .../nf-core/bandage/image/tests/main.nf.test | 6 +- .../geneticmapconvert/tests/main.nf.test | 6 +- modules/nf-core/htslib/bgziptabix/main.nf | 2 +- .../bedmethyltobigwig/tests/main.nf.test | 6 +- modules/nf-core/paraphase/tests/main.nf.test | 6 +- modules/nf-core/paraphrase/tests/main.nf.test | 6 +- .../nf-core/samtools/bgzip/tests/main.nf.test | 94 ++----------------- modules/nf-core/wittyer/tests/main.nf.test | 12 +-- modules/nf-core/wittyer/tests/nextflow.config | 8 +- 9 files changed, 32 insertions(+), 114 deletions(-) diff --git a/modules/nf-core/bandage/image/tests/main.nf.test b/modules/nf-core/bandage/image/tests/main.nf.test index 28973f3da7f..91234981679 100644 --- a/modules/nf-core/bandage/image/tests/main.nf.test +++ b/modules/nf-core/bandage/image/tests/main.nf.test @@ -48,9 +48,9 @@ nextflow_process { input[0] = [ [ id:'B-3106' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/gfa/assembly.gfa', checkIfExists: true) - ], - input[1] = "compress", - input[2] = false, + ] + input[1] = "compress" + input[2] = false input[3] = "gfa" """ } diff --git a/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test b/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test index f6ffe9cd5d3..1c5dc24475c 100644 --- a/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test +++ b/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test @@ -51,9 +51,9 @@ nextflow_process { input[0] = [ [id: "test", chr:"chr21"], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr21.glimpse.map', checkIfExists: true) - ], - input[1] = "compress", - input[2] = false, + ] + input[1] = "compress" + input[2] = false input[3] = "map" """ } diff --git a/modules/nf-core/htslib/bgziptabix/main.nf b/modules/nf-core/htslib/bgziptabix/main.nf index 35d2fab708d..68d9f4cb6f5 100644 --- a/modules/nf-core/htslib/bgziptabix/main.nf +++ b/modules/nf-core/htslib/bgziptabix/main.nf @@ -38,7 +38,7 @@ process HTSLIB_BGZIPTABIX { outfile = action == "compress" ? (out_ext ? "${prefix}.${out_ext}.gz" : "${prefix}.gz") : (out_ext ? "${prefix}.${out_ext}" : "${prefix}") def compress_cmd = action == "compress" ? "bgzip -c ${args} -@ ${task.cpus}" : "cat" - def bgzip_cmd = action == "compress" ? "[ '\$(basename ${infile})' != '\$(basename ${outfile})' ] && ln -s ${infile} ${outfile}" : "${compress_cmd} ${infile} > ${outfile}" + def bgzip_cmd = action == "compress" ? "[ '\$(basename ${infile})' != '\$(basename ${outfile})' ] && ln -s ${infile} ${outfile}" : "bgzip -c -d ${args} -@ ${task.cpus} ${infile} > ${outfile}" def tabix_cmd = make_index ? "tabix -@ ${task.cpus} ${args2} -f ${outfile}" : "" def uncompressed_cmd = action == "compress" ? "${compress_cmd} ${infile} > ${outfile}" : (infile.getName() == outfile ? "" : "ln -s ${infile} ${outfile}") """ diff --git a/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test b/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test index 583d5089b47..8a188231d47 100644 --- a/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test +++ b/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test @@ -31,9 +31,9 @@ nextflow_process { script "../../../htslib/bgziptabix/main.nf" process { """ - input[0] = MODKIT_PILEUP.out.bedgz, - input[1] = "decompress", - input[2] = false, + input[0] = MODKIT_PILEUP.out.bedgz + input[1] = "decompress" + input[2] = false input[3] = "bed" """ } diff --git a/modules/nf-core/paraphase/tests/main.nf.test b/modules/nf-core/paraphase/tests/main.nf.test index c998f6c13ef..61c43545854 100644 --- a/modules/nf-core/paraphase/tests/main.nf.test +++ b/modules/nf-core/paraphase/tests/main.nf.test @@ -18,9 +18,9 @@ nextflow_process { input[0] = [ [ id:'test_ref' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr22_chr22_KI270734v1_random/sequence/genome.fa.gz', checkIfExists: true), - ], - input[1] = "decompress", - input[2] = false, + ] + input[1] = "decompress" + input[2] = false input[3] = "fa" """ } diff --git a/modules/nf-core/paraphrase/tests/main.nf.test b/modules/nf-core/paraphrase/tests/main.nf.test index eb4cb982a6c..344545d6364 100644 --- a/modules/nf-core/paraphrase/tests/main.nf.test +++ b/modules/nf-core/paraphrase/tests/main.nf.test @@ -19,9 +19,9 @@ nextflow_process { input[0] = [ [ id:'test_ref' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr22_chr22_KI270734v1_random/sequence/genome.fa.gz', checkIfExists: true), - ], - input[1] = "decompress", - input[2] = false, + ] + input[1] = "decompress" + input[2] = false input[3] = "fa" """ } diff --git a/modules/nf-core/samtools/bgzip/tests/main.nf.test b/modules/nf-core/samtools/bgzip/tests/main.nf.test index feb92ff2367..03325cf36c2 100644 --- a/modules/nf-core/samtools/bgzip/tests/main.nf.test +++ b/modules/nf-core/samtools/bgzip/tests/main.nf.test @@ -9,7 +9,7 @@ nextflow_process { tag "samtools" tag "samtools/bgzip" - test("test_samtools_bgzip - fasta") { + test("test_samtools_bgzip - deprecated") { when { process { @@ -23,95 +23,13 @@ nextflow_process { then { assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } + { assert process.failed }, + { assert process.errorReport.contains("WARNING: This module has been deprecated.") } ) } } - test("test_samtools_bgzip - fasta bgzipped") { - - when { - process { - """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) ] - input[1] = 'fasta' // suffix - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("test_samtools_bgzip - fasta bgzipped same name") { - // This checks that the module avoids file name clashes when input is already bzipped. - - when { - process { - """ - input[0] = [ [ id:'genome', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) ] - input[1] = 'fasta' // suffix - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("test_samtools_bgzip - proteome gzipped") { - // This file is not bgziped. It is used to check the re-zipping branch of the case statement in the module. - - when { - process { - """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta.gz', checkIfExists: true) ] - input[1] = 'fasta' // suffix - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("test_samtools_bgzip - vcf gzipped") { - - when { - process { - """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) ] - input[1] = 'vcf' // suffix - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - test("test_samtools_bgzip - fasta stub") { + test("test_samtools_bgzip - deprecated - stub") { options "-stub" when { @@ -126,8 +44,8 @@ nextflow_process { then { assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } + { assert process.failed }, + { assert process.errorReport.contains("WARNING: This module has been deprecated.") } ) } } diff --git a/modules/nf-core/wittyer/tests/main.nf.test b/modules/nf-core/wittyer/tests/main.nf.test index bfeb2ae3564..e501c51b292 100644 --- a/modules/nf-core/wittyer/tests/main.nf.test +++ b/modules/nf-core/wittyer/tests/main.nf.test @@ -20,9 +20,9 @@ nextflow_process { input[0] = [ [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/chr21/simulated_sv.vcf.gz', checkIfExists: true) - ], - input[1] = "decompress", - input[2] = false, + ] + input[1] = "decompress" + input[2] = false input[3] = "vcf" """ } @@ -36,9 +36,9 @@ nextflow_process { input[0] = [ [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/chr21/simulated_sv2.vcf.gz', checkIfExists: true) - ], - input[1] = "decompress", - input[2] = false, + ] + input[1] = "decompress" + input[2] = false input[3] = "vcf" """ } diff --git a/modules/nf-core/wittyer/tests/nextflow.config b/modules/nf-core/wittyer/tests/nextflow.config index a78e2026563..93616609b8b 100644 --- a/modules/nf-core/wittyer/tests/nextflow.config +++ b/modules/nf-core/wittyer/tests/nextflow.config @@ -1,9 +1,9 @@ process{ - withName: TABIX_BGZIP_1 { - ext.prefix = {input.toString() - ".vcf.gz"} + withName: HTSLIB_BGZIPTABIX_1 { + ext.prefix = {infile.getName() - ".vcf.gz"} } - withName: TABIX_BGZIP_2 { - ext.prefix = {input.toString() - ".vcf.gz"} + withName: HTSLIB_BGZIPTABIX_2 { + ext.prefix = {infile.getName() - ".vcf.gz"} } withName: WITTYER { containerOptions = { From 3b15095a3ae87b50787002ffb4a6871c1a76a9e8 Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 08:42:36 +0000 Subject: [PATCH 07/23] feat: update test snapshots and fix timestamp formatting in VCF annotation workflow --- .../htslib/bgziptabix/tests/main.nf.test.snap | 6 ++--- .../vcf_annotate_ensemblvep_snpeff/main.nf | 2 +- .../tests/main.nf.test.snap | 26 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap index eb30bd69813..394a6b0a3fd 100644 --- a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap @@ -615,7 +615,7 @@ { "id": "test" }, - "test.vcf:md5,02aff9ae43faf2594f28e2cf87b32ba9" + "test.vcf:md5,8e722884ffb75155212a3fc053918766" ] ], "1": [ @@ -636,7 +636,7 @@ { "id": "test" }, - "test.vcf:md5,02aff9ae43faf2594f28e2cf87b32ba9" + "test.vcf:md5,8e722884ffb75155212a3fc053918766" ] ], "versions_htslib": [ @@ -657,7 +657,7 @@ ] } ], - "timestamp": "2026-05-07T09:49:59.75511926", + "timestamp": "2026-05-08T08:10:06.769087104", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" diff --git a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf index a359068bc73..96323f135ab 100644 --- a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf +++ b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf @@ -170,7 +170,7 @@ workflow VCF_ANNOTATE_ENSEMBLVEP_SNPEFF { } INDEX_VCF( - ch_tabix_input.bgzip.map { meta, vcf -> [meta, vcf, [], []] }, + ch_tabix_input.bgzip, "compress", true, "vcf" diff --git a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/tests/main.nf.test.snap b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/tests/main.nf.test.snap index f400e4c7640..1691027d4e7 100644 --- a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/tests/main.nf.test.snap +++ b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/tests/main.nf.test.snap @@ -146,11 +146,11 @@ ] ], + "timestamp": "2026-01-27T15:42:18.478291", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.3" - }, - "timestamp": "2026-01-27T15:42:18.478291" + } }, "sarscov2 - ensemblvep - large chunks": { "content": [ @@ -191,11 +191,11 @@ ] ], + "timestamp": "2026-01-20T12:44:15.673809362", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.2" - }, - "timestamp": "2026-01-20T12:44:15.673809362" + } }, "sarscov2 - snpeff + ensemblvep": { "content": [ @@ -296,11 +296,11 @@ ] ], + "timestamp": "2026-01-27T15:43:01.336201", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.3" - }, - "timestamp": "2026-01-27T15:43:01.336201" + } }, "sarscov2 - ensemblvep - no scatter": { "content": [ @@ -311,7 +311,7 @@ "single_end": false }, "custom_test.vep.vcf.gz,variantsMD5:38fc31c1429fffc7727ce5db161fdb66", - "custom_test.vep.vcf.gz.tbi" + "custom_test.vcf.gz.tbi" ] ], [ @@ -338,11 +338,11 @@ ] ], + "timestamp": "2026-05-08T08:21:33.916839923", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-01-20T10:47:27.604904698" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } }, "sarscov2 - ensemblvep": { "content": [ @@ -392,10 +392,10 @@ ] ], + "timestamp": "2026-01-20T12:42:57.541734749", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.2" - }, - "timestamp": "2026-01-20T12:42:57.541734749" + } } } \ No newline at end of file From cb0ef77ecafba5893b2f334c53e66946530202eb Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 11:35:03 +0000 Subject: [PATCH 08/23] feat: deprecate SAMTOOLS_BGZIP --- modules/nf-core/samtools/bgzip/main.nf | 44 +++++++++---------------- modules/nf-core/samtools/bgzip/meta.yml | 2 +- 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/modules/nf-core/samtools/bgzip/main.nf b/modules/nf-core/samtools/bgzip/main.nf index 424e9968886..87b33350e2a 100644 --- a/modules/nf-core/samtools/bgzip/main.nf +++ b/modules/nf-core/samtools/bgzip/main.nf @@ -12,41 +12,27 @@ process SAMTOOLS_BGZIP { val out_ext output: - tuple val(meta), path("${outfile}"), emit: output + tuple val(meta), path("output.gz"), emit: output tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), emit: versions_samtools, topic: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - out_ext = out_ext ?: "fasta" - outfile = "${prefix}.${out_ext}.gz" - """ - FILE_TYPE=\$(htsfile ${infile}) - case "\$FILE_TYPE" in - *BGZF-compressed*) - # Do nothing or just rename if the file was already compressed - [ "\$(basename ${infile})" != "\$(basename ${outfile})" ] && ln -s ${infile} ${outfile} ;; - *gzip-compressed*) - [ "\$(basename ${infile})" == "\$(basename ${outfile})" ] && echo "Filename collision (\$basename ${infile})" && exit 1 - zcat ${infile} | bgzip -c ${args} -@${task.cpus} > ${outfile} ;; - *bzip2-compressed*) - bzcat ${infile} | bgzip -c ${args} -@${task.cpus} > ${outfile} ;; - *XZ-compressed*) - xzcat ${infile} | bgzip -c ${args} -@${task.cpus} > ${outfile} ;; - *) - bgzip -c ${args} -@${task.cpus} ${infile} > ${outfile} ;; - esac - """ + def deprecation_message = """ + WARNING: This module has been deprecated. Please use HTSLIB/BGZIPTABIX instead. + + Reason: + This module is duplicative of TABIX/BGZIPTABIX and HTSLIB/BGZIPTABIX. The new HTSLIB/BGZIPTABIX module provides equivalent functionality with a more predictable behavior and better interface. + """.stripIndent() + assert false: deprecation_message stub: - def prefix = task.ext.prefix ?: "${meta.id}" - out_ext = out_ext ?: "fasta" - outfile = "${prefix}.${out_ext}.gz" - """ - [ "\$(basename ${infile})" == "\$(basename ${outfile})" ] && echo "Filename collision \$(basename ${infile})" && exit 1 - echo '' | bgzip > ${outfile} - """ + def deprecation_message = """ + WARNING: This module has been deprecated. Please use HTSLIB/BGZIPTABIX instead. + + Reason: + This module is duplicative of TABIX/BGZIPTABIX and HTSLIB/BGZIPTABIX. The new HTSLIB/BGZIPTABIX module provides equivalent functionality with a more predictable behavior and better interface. + """.stripIndent() + assert false: deprecation_message } diff --git a/modules/nf-core/samtools/bgzip/meta.yml b/modules/nf-core/samtools/bgzip/meta.yml index 91eca4bfea5..be4a04a092e 100644 --- a/modules/nf-core/samtools/bgzip/meta.yml +++ b/modules/nf-core/samtools/bgzip/meta.yml @@ -1,5 +1,5 @@ name: samtools_bgzip -description: Converts an arbitrary compressed or uncompressed file to BGZIP +description: DEPRECATED. Use HTSLIB/BGZIPTABIX instead. Converts an arbitrary compressed or uncompressed file to BGZIP keywords: - compression - fasta From 1f0b792622ccc12c043efaced02149a225abb180 Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 11:36:17 +0000 Subject: [PATCH 09/23] feat: Refactor and deprecate tabix module in favor of HTSLIB/BGZIPTABIX - Updated tests across multiple modules to include empty input arrays for compatibility. - Introduced new test cases for compressing VCF files with regions and indexing. - Deprecated the tabix module, replacing its functionality with HTSLIB/BGZIPTABIX. - Adjusted workflow and test configurations to reflect the new module structure. - Updated metadata and tags in various subworkflows to align with the new HTSLIB module. --- .../nf-core/bandage/image/tests/main.nf.test | 4 +- .../geneticmapconvert/tests/main.nf.test | 4 +- modules/nf-core/htslib/bgziptabix/main.nf | 17 +- .../htslib/bgziptabix/tests/main.nf.test | 57 +++++++ .../htslib/bgziptabix/tests/main.nf.test.snap | 147 ++++++++++------- .../bedmethyltobigwig/tests/main.nf.test | 1 + modules/nf-core/paraphase/tests/main.nf.test | 2 + modules/nf-core/paraphrase/tests/main.nf.test | 2 + modules/nf-core/tabix/tabix/main.nf | 46 +++--- modules/nf-core/tabix/tabix/meta.yml | 5 +- .../nf-core/tabix/tabix/tests/main.nf.test | 151 ++---------------- modules/nf-core/wittyer/tests/main.nf.test | 8 +- .../tests/main.nf.test | 1 - .../vcf_annotate_ensemblvep_snpeff/main.nf | 4 +- .../nf-core/vcf_annotate_snpeff/main.nf | 11 +- .../vcf_annotate_snpeff/tests/main.nf.test | 2 +- .../vcf_extract_relate_somalier/main.nf | 15 +- .../tests/main.nf.test | 4 +- .../vcf_filter_bcftools_ensemblvep/main.nf | 13 +- .../tests/main.nf.test | 2 +- .../nf-core/vcf_gather_bcftools/main.nf | 13 +- .../vcf_gather_bcftools/tests/main.nf.test | 4 +- 22 files changed, 247 insertions(+), 266 deletions(-) diff --git a/modules/nf-core/bandage/image/tests/main.nf.test b/modules/nf-core/bandage/image/tests/main.nf.test index 91234981679..8500d1c8b9b 100644 --- a/modules/nf-core/bandage/image/tests/main.nf.test +++ b/modules/nf-core/bandage/image/tests/main.nf.test @@ -47,7 +47,9 @@ nextflow_process { """ input[0] = [ [ id:'B-3106' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/gfa/assembly.gfa', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/gfa/assembly.gfa', checkIfExists: true), + [], + [] ] input[1] = "compress" input[2] = false diff --git a/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test b/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test index 1c5dc24475c..c231b37d51b 100644 --- a/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test +++ b/modules/nf-core/custom/geneticmapconvert/tests/main.nf.test @@ -50,7 +50,9 @@ nextflow_process { """ input[0] = [ [id: "test", chr:"chr21"], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr21.glimpse.map', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr21.glimpse.map', checkIfExists: true), + [], + [] ] input[1] = "compress" input[2] = false diff --git a/modules/nf-core/htslib/bgziptabix/main.nf b/modules/nf-core/htslib/bgziptabix/main.nf index 68d9f4cb6f5..4ede4fbaaaa 100644 --- a/modules/nf-core/htslib/bgziptabix/main.nf +++ b/modules/nf-core/htslib/bgziptabix/main.nf @@ -8,7 +8,7 @@ process HTSLIB_BGZIPTABIX { 'community.wave.seqera.io/library/htslib_xz:49c8c84af5c4b3b9' }" input: - tuple val(meta), path(infile) + tuple val(meta), path(infile), path(infile_tbi), path(regions) val action val make_index val out_ext @@ -39,10 +39,16 @@ process HTSLIB_BGZIPTABIX { def compress_cmd = action == "compress" ? "bgzip -c ${args} -@ ${task.cpus}" : "cat" def bgzip_cmd = action == "compress" ? "[ '\$(basename ${infile})' != '\$(basename ${outfile})' ] && ln -s ${infile} ${outfile}" : "bgzip -c -d ${args} -@ ${task.cpus} ${infile} > ${outfile}" - def tabix_cmd = make_index ? "tabix -@ ${task.cpus} ${args2} -f ${outfile}" : "" + + def regions_arg = regions ? "-R ${regions}" : "" + def tabix_cmd = make_index ? "tabix -@ ${task.cpus} ${regions_arg} ${args2} -f ${outfile}" : "" + def link_tabix_cmd = make_index && infile_tbi ? "ln -s ${infile_tbi} ${outfile}.${infile_tbi.extension}" : "" def uncompressed_cmd = action == "compress" ? "${compress_cmd} ${infile} > ${outfile}" : (infile.getName() == outfile ? "" : "ln -s ${infile} ${outfile}") """ + ${link_tabix_cmd} + FILE_TYPE=\$(htsfile ${infile}) + case "\$FILE_TYPE" in *BGZF-compressed*) ${bgzip_cmd} ;; @@ -66,13 +72,16 @@ process HTSLIB_BGZIPTABIX { prefix = task.ext.prefix ?: "${meta.id}" outfile = action == "compress" ? (out_ext ? "${prefix}.${out_ext}.gz" : "${prefix}.gz") : (out_ext ? "${prefix}.${out_ext}" : "${prefix}") - def touch_cmd = action == "compress" ? "echo | bgzip -c" : "echo" - def tabix_cmd = make_index ? "tabix -@ ${task.cpus} ${args2} -f ${outfile}" : "" + def touch_cmd = action == "compress" ? "echo | bgzip -c" : "echo" + def index_fmt = args2.contains('-C') ? 'csi' : 'tbi' + def tabix_cmd = make_index ? "touch ${outfile}.${index_fmt}" : "" + def link_tabix_cmd = make_index && infile_tbi ? "ln -s ${infile_tbi} ${outfile}.${infile_tbi.extension}" : "" """ echo $args $touch_cmd > $outfile ${tabix_cmd} + ${link_tabix_cmd} """ } diff --git a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test index b472e47e36a..9cfa6d83466 100644 --- a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test @@ -17,6 +17,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + [], + [] ] input[1] = 'decompress' // action input[2] = false // make_index @@ -47,6 +49,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + [], + [] ] input[1] = 'compress' // action input[2] = true // make_index @@ -69,6 +73,35 @@ nextflow_process { } + test("sarscov2 - vcf + regions - compress - index") { + when { + process { + """ + input[0] = [ + [ id:'example' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), + file('https://raw.githubusercontent.com/luisas/test-datasets/refs/heads/add-bedgraph-subset-illumina/data/genomics/sarscov2/illumina/bed/test.bed', checkIfExists: true) + ] + input[1] = 'compress' // action + input[2] = true // make_index + input[3] = 'vcf' // out_ext + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out.index, + path(process.out.output[0][1]).vcf.getVariantsMD5(), + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } + ) + } + } + test("sarscov2 - bgzip - decompress") { when { @@ -77,6 +110,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [], + [] ] input[1] = 'decompress' // action input[2] = false // make_index @@ -106,6 +141,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [], + [] ] input[1] = 'compress' // action input[2] = false // make_index @@ -136,6 +173,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + [], + [] ] input[1] = 'decompress' // action input[2] = false // make_index @@ -165,6 +204,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + [], + [] ] input[1] = 'compress' // action input[2] = false // make_index @@ -194,6 +235,8 @@ nextflow_process { input[0] = [ [ id:'test_1' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + [], + [] ] input[1] = 'compress' // action input[2] = false // make_index @@ -218,6 +261,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/prokaryotes/metagenome/rgi/card-data.tar.bz2', checkIfExists: true), + [], + [] ] input[1] = 'decompress' // action input[2] = false // make_index @@ -247,6 +292,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/prokaryotes/metagenome/rgi/card-data.tar.bz2', checkIfExists: true), + [], + [] ] input[1] = 'compress' // action input[2] = false // make_index @@ -276,6 +323,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/prokaryotes/metagenome/taxonomy/misc/taxa_sqlite.xz', checkIfExists: true), + [], + [] ] input[1] = 'decompress' // action input[2] = false // make_index @@ -305,6 +354,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/prokaryotes/metagenome/taxonomy/misc/taxa_sqlite.xz', checkIfExists: true), + [], + [] ] input[1] = 'compress' // action input[2] = false // make_index @@ -336,6 +387,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + [], + [] ] input[1] = 'compress' // action input[2] = false // make_index @@ -363,6 +416,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [], + [] ] input[1] = 'decompress' // action input[2] = false // make_index @@ -388,6 +443,8 @@ nextflow_process { input[0] = [ [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + [], + [] ] input[1] = 'invalid_action' // action input[2] = true // make_index diff --git a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap index 394a6b0a3fd..b8fed9df012 100644 --- a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap @@ -167,7 +167,7 @@ "nextflow": "26.04.0" } }, - "sarscov2 - vcf - decompress": { + "sarscov2 - vcf - decompress - stub": { "content": [ { "0": [ @@ -175,7 +175,7 @@ { "id": "test" }, - "test.vcf:md5,8e722884ffb75155212a3fc053918766" + "test.vcf:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "1": [ @@ -196,7 +196,7 @@ { "id": "test" }, - "test.vcf:md5,8e722884ffb75155212a3fc053918766" + "test.vcf:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "versions_htslib": [ @@ -206,24 +206,15 @@ "1.23.1" ] ] - }, - { - "versions_htslib": [ - [ - "HTSLIB_BGZIPTABIX", - "htslib", - "1.23.1" - ] - ] } ], - "timestamp": "2026-05-07T10:01:52.038270626", + "timestamp": "2026-05-06T15:18:46.671916956", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" } }, - "metagenome - bz2 - (re)compress - no index": { + "sarscov2 - gzip - decompress": { "content": [ { "0": [ @@ -231,7 +222,7 @@ { "id": "test" }, - "test.tar.gz:md5,39e9e71fd16cfd09ceca12cd46e6abce" + "test.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" ] ], "1": [ @@ -252,7 +243,7 @@ { "id": "test" }, - "test.tar.gz:md5,39e9e71fd16cfd09ceca12cd46e6abce" + "test.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" ] ], "versions_htslib": [ @@ -273,13 +264,13 @@ ] } ], - "timestamp": "2026-05-06T15:18:08.165435155", + "timestamp": "2026-05-06T15:17:43.605725172", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" } }, - "sarscov2 - vcf - compress - index": { + "sarscov2 - vcf - decompress": { "content": [ { "0": [ @@ -287,16 +278,11 @@ { "id": "test" }, - "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + "test.vcf:md5,8e722884ffb75155212a3fc053918766" ] ], "1": [ - [ - { - "id": "test" - }, - "test.vcf.gz.tbi:md5,7f005943c935f2b55ba3f9d4802aa09f" - ] + ], "2": [ [ @@ -306,19 +292,14 @@ ] ], "index": [ - [ - { - "id": "test" - }, - "test.vcf.gz.tbi:md5,7f005943c935f2b55ba3f9d4802aa09f" - ] + ], "output": [ [ { "id": "test" }, - "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + "test.vcf:md5,8e722884ffb75155212a3fc053918766" ] ], "versions_htslib": [ @@ -339,13 +320,13 @@ ] } ], - "timestamp": "2026-05-06T14:59:41.265882348", + "timestamp": "2026-05-07T10:01:52.038270626", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" } }, - "metagenome - xz - decompress": { + "metagenome - bz2 - (re)compress - no index": { "content": [ { "0": [ @@ -353,7 +334,7 @@ { "id": "test" }, - "test:md5,b8d852a2b1ee52ed64d83046dcdb9de2" + "test.tar.gz:md5,39e9e71fd16cfd09ceca12cd46e6abce" ] ], "1": [ @@ -374,7 +355,7 @@ { "id": "test" }, - "test:md5,b8d852a2b1ee52ed64d83046dcdb9de2" + "test.tar.gz:md5,39e9e71fd16cfd09ceca12cd46e6abce" ] ], "versions_htslib": [ @@ -395,13 +376,13 @@ ] } ], - "timestamp": "2026-05-07T09:51:11.862701779", + "timestamp": "2026-05-06T15:18:08.165435155", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" } }, - "sarscov2 - vcf - decompress - stub": { + "sarscov2 - vcf - compress - index": { "content": [ { "0": [ @@ -409,11 +390,16 @@ { "id": "test" }, - "test.vcf:md5,68b329da9893e34099c7d8ad5cb9c940" + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" ] ], "1": [ - + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,7f005943c935f2b55ba3f9d4802aa09f" + ] ], "2": [ [ @@ -423,14 +409,19 @@ ] ], "index": [ - + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,7f005943c935f2b55ba3f9d4802aa09f" + ] ], "output": [ [ { "id": "test" }, - "test.vcf:md5,68b329da9893e34099c7d8ad5cb9c940" + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" ] ], "versions_htslib": [ @@ -440,15 +431,24 @@ "1.23.1" ] ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] } ], - "timestamp": "2026-05-06T15:18:46.671916956", + "timestamp": "2026-05-06T14:59:41.265882348", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" } }, - "sarscov2 - vcf - compress - no index - stub": { + "metagenome - xz - decompress": { "content": [ { "0": [ @@ -456,7 +456,7 @@ { "id": "test" }, - "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test:md5,b8d852a2b1ee52ed64d83046dcdb9de2" ] ], "1": [ @@ -477,7 +477,7 @@ { "id": "test" }, - "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "test:md5,b8d852a2b1ee52ed64d83046dcdb9de2" ] ], "versions_htslib": [ @@ -487,15 +487,24 @@ "1.23.1" ] ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] } ], - "timestamp": "2026-05-06T15:27:48.766118732", + "timestamp": "2026-05-07T09:51:11.862701779", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" } }, - "sarscov2 - gzip - decompress": { + "sarscov2 - vcf - compress - no index - stub": { "content": [ { "0": [ @@ -503,7 +512,7 @@ { "id": "test" }, - "test.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "1": [ @@ -524,7 +533,7 @@ { "id": "test" }, - "test.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "versions_htslib": [ @@ -534,18 +543,9 @@ "1.23.1" ] ] - }, - { - "versions_htslib": [ - [ - "HTSLIB_BGZIPTABIX", - "htslib", - "1.23.1" - ] - ] } ], - "timestamp": "2026-05-06T15:17:43.605725172", + "timestamp": "2026-05-06T15:27:48.766118732", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -607,6 +607,33 @@ "nextflow": "26.04.0" } }, + "sarscov2 - vcf + regions - compress - index": { + "content": [ + [ + [ + { + "id": "example" + }, + "example.vcf.gz.tbi:md5,d22e5b84e4fcd18792179f72e6da702e" + ] + ], + "bc7bf3ee9e8430e064c539eb81e59bf9", + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-08T10:20:13.674891739", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, "sarscov2 - bgzip - decompress": { "content": [ { diff --git a/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test b/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test index 8a188231d47..8816277ee94 100644 --- a/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test +++ b/modules/nf-core/modkit/bedmethyltobigwig/tests/main.nf.test @@ -32,6 +32,7 @@ nextflow_process { process { """ input[0] = MODKIT_PILEUP.out.bedgz + .map { meta, bedgz -> [meta, bedgz, [], []] } input[1] = "decompress" input[2] = false input[3] = "bed" diff --git a/modules/nf-core/paraphase/tests/main.nf.test b/modules/nf-core/paraphase/tests/main.nf.test index 61c43545854..3b29259dd5b 100644 --- a/modules/nf-core/paraphase/tests/main.nf.test +++ b/modules/nf-core/paraphase/tests/main.nf.test @@ -18,6 +18,8 @@ nextflow_process { input[0] = [ [ id:'test_ref' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr22_chr22_KI270734v1_random/sequence/genome.fa.gz', checkIfExists: true), + [], + [] ] input[1] = "decompress" input[2] = false diff --git a/modules/nf-core/paraphrase/tests/main.nf.test b/modules/nf-core/paraphrase/tests/main.nf.test index 344545d6364..ba02a403092 100644 --- a/modules/nf-core/paraphrase/tests/main.nf.test +++ b/modules/nf-core/paraphrase/tests/main.nf.test @@ -19,6 +19,8 @@ nextflow_process { input[0] = [ [ id:'test_ref' ], // meta map file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr22_chr22_KI270734v1_random/sequence/genome.fa.gz', checkIfExists: true), + [], + [] ] input[1] = "decompress" input[2] = false diff --git a/modules/nf-core/tabix/tabix/main.nf b/modules/nf-core/tabix/tabix/main.nf index 6ade1976071..a150f0a260b 100644 --- a/modules/nf-core/tabix/tabix/main.nf +++ b/modules/nf-core/tabix/tabix/main.nf @@ -11,37 +11,29 @@ process TABIX_TABIX { tuple val(meta), path(tab), path(tai), path(regions) output: - tuple val(meta), path("*.{tbi,csi}"), emit: index, optional: true - tuple val(meta), path("${prefix}.*gz"), emit: extracted, optional: true - tuple val("${task.process}"), val('tabix'), eval("tabix -h 2>&1 | grep -oP 'Version:\\s*\\K[^\\s]+'") , topic: versions , emit: versions_tabix + tuple val(meta), path("*.{tbi,csi}"), emit: index , optional: true + tuple val(meta), path("output.*gz") , emit: extracted, optional: true + tuple val("${task.process}"), val('tabix'), eval("tabix -h 2>&1 | grep -oP 'Version:\\s*\\K[^\\s]+'"), topic: versions, emit: versions_tabix when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - def tab_suffix = tab.name.indexOf('.') >= 0 ? tab.name.substring(tab.name.indexOf('.')) : '' - def regions_arg = regions ? "-R ${regions}" : "" - def output_arg = regions ? "| bgzip --threads ${task.cpus} > ${prefix}${tab_suffix}" : "" - """ - tabix \\ - ${regions_arg} \\ - --threads $task.cpus \\ - $args \\ - $tab \\ - ${output_arg} - - """ + def deprecation_message = """ + WARNING: This module has been deprecated. Please use HTSLIB/BGZIPTABIX instead. + + Reason: + This module is duplicative of HTSLIB/BGZIPTABIX. The HTSLIB/BGZIPTABIX module is the canonical replacement and provides equivalent functionality through HTSlib with a more predictable behavior and better interface. + """.stripIndent() + assert false: deprecation_message + stub: - def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - def tab_suffix = tab.name.indexOf('.') >= 0 ? tab.name.substring(tab.name.indexOf('.')) : '' - def ext = args.contains("-C ") || args.contains("--csi") ? "csi" : "tbi" - def index = regions ? "" : "touch ${tab}.${ext}" - def extracted = regions ? "echo | gzip > ${prefix}${tab_suffix}" : "" - """ - ${index} - ${extracted} - """ + def deprecation_message = """ + WARNING: This module has been deprecated. Please use HTSLIB/BGZIPTABIX instead. + + Reason: + This module is duplicative of HTSLIB/BGZIPTABIX. The HTSLIB/BGZIPTABIX module is the canonical replacement and provides equivalent functionality through HTSlib with a more predictable behavior and better interface. + """.stripIndent() + assert false: deprecation_message + } diff --git a/modules/nf-core/tabix/tabix/meta.yml b/modules/nf-core/tabix/tabix/meta.yml index 5c32b22a26b..4acd4bb57b2 100644 --- a/modules/nf-core/tabix/tabix/meta.yml +++ b/modules/nf-core/tabix/tabix/meta.yml @@ -1,7 +1,8 @@ name: tabix_tabix description: | - Create a tabix index from a sorted bgzip TAB-delimited genome file, or - extract regions from a bgzipped VCF file using an optional regions file. + DEPRECATED. Use HTSLIB/BGZIPTABIX instead. Create a tabix index from a sorted + bgzip TAB-delimited genome file, or extract regions from a bgzipped VCF file + using an optional regions file. keywords: - index - tabix diff --git a/modules/nf-core/tabix/tabix/tests/main.nf.test b/modules/nf-core/tabix/tabix/tests/main.nf.test index 280eac25959..aa0df9701c2 100644 --- a/modules/nf-core/tabix/tabix/tests/main.nf.test +++ b/modules/nf-core/tabix/tabix/tests/main.nf.test @@ -11,7 +11,7 @@ nextflow_process { config "./nextflow.config" - test("sarscov2_bedgz_tbi") { + test("sarscov2 - bed gz - deprecated") { when { params { module_args = '-p bed' @@ -30,156 +30,23 @@ nextflow_process { then { assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } + { assert process.failed }, + { assert process.errorReport.contains("WARNING: This module has been deprecated.") } ) } } - test("sarscov2_gff_tbi") { - when { - params { - module_args = '-p gff' - } - process { - """ - input[0] = [ - [ id:'tbi_gff' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3.gz', checkIfExists: true), - [], - [] - ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2_vcf_tbi") { - when { - params { - module_args = '-p vcf' - } - process { - """ - input[0] = [ - [ id:'tbi_vcf' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), - [], - [] - ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2_vcf_csi") { - when { - params { - module_args = '-p vcf --csi' - } - process { - """ - input[0] = [ - [ id:'vcf_csi' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), - [], - [] - ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2_vcf_tbi_regions") { - when { - params { - module_args = '-h' - } - process { - """ - input[0] = [ - [ id:'vcf_regions' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), - file('https://raw.githubusercontent.com/luisas/test-datasets/refs/heads/add-bedgraph-subset-illumina/data/genomics/sarscov2/illumina/bed/test.bed', checkIfExists: true) - ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot( - process.out.index, - path(process.out.extracted[0][1]).vcf.getVariantsMD5(), - process.out.versions_tabix - ).match() } - ) - } - } - - test("sarscov2_vcf_tbi_regions_stub") { + test("sarscov2 - bed gz - deprecated - stub") { options "-stub" when { params { - module_args = '' + module_args = '-p bed' } process { """ input[0] = [ - [ id:'vcf_regions_stub' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true), - file('https://raw.githubusercontent.com/luisas/test-datasets/refs/heads/add-bedgraph-subset-illumina/data/genomics/sarscov2/illumina/bed/test.bed', checkIfExists: true) - ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(sanitizeOutput(process.out)).match() } - ) - } - } - - test("sarscov2_vcf_csi_stub") { - options "-stub" - when { - params { - module_args = '-p vcf --csi' - } - process { - """ - input[0] = [ - [ id:'vcf_csi_stub' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [ id:'tbi_bed_stub' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed.gz', checkIfExists: true), [], [] ] @@ -189,8 +56,8 @@ nextflow_process { then { assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } + { assert process.failed }, + { assert process.errorReport.contains("WARNING: This module has been deprecated.") } ) } } diff --git a/modules/nf-core/wittyer/tests/main.nf.test b/modules/nf-core/wittyer/tests/main.nf.test index e501c51b292..b807a99f37d 100644 --- a/modules/nf-core/wittyer/tests/main.nf.test +++ b/modules/nf-core/wittyer/tests/main.nf.test @@ -19,7 +19,9 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/chr21/simulated_sv.vcf.gz', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/chr21/simulated_sv.vcf.gz', checkIfExists: true), + [], + [] ] input[1] = "decompress" input[2] = false @@ -35,7 +37,9 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/chr21/simulated_sv2.vcf.gz', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/chr21/simulated_sv2.vcf.gz', checkIfExists: true), + [], + [] ] input[1] = "decompress" input[2] = false diff --git a/subworkflows/nf-core/vcf_annotate_ensemblvep/tests/main.nf.test b/subworkflows/nf-core/vcf_annotate_ensemblvep/tests/main.nf.test index 03e186d7db8..17f402d4bbb 100644 --- a/subworkflows/nf-core/vcf_annotate_ensemblvep/tests/main.nf.test +++ b/subworkflows/nf-core/vcf_annotate_ensemblvep/tests/main.nf.test @@ -8,7 +8,6 @@ nextflow_workflow { tag "subworkflows_nfcore" tag "subworkflows/vcf_annotate_ensemblvep" tag "ensemblvep/vep" - tag "tabix/tabix" config "./nextflow.config" diff --git a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf index 96323f135ab..cb644303443 100644 --- a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf +++ b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/main.nf @@ -117,7 +117,7 @@ workflow VCF_ANNOTATE_ENSEMBLVEP_SNPEFF { ch_snpeff_genes = SNPEFF_SNPEFF.out.genes_txt COMPRESS_VCF( - SNPEFF_SNPEFF.out.vcf, + SNPEFF_SNPEFF.out.vcf.map { meta, vcf -> [meta, vcf, [], []] }, "compress", false, "vcf" @@ -170,7 +170,7 @@ workflow VCF_ANNOTATE_ENSEMBLVEP_SNPEFF { } INDEX_VCF( - ch_tabix_input.bgzip, + ch_tabix_input.bgzip.map { meta, vcf -> [meta, vcf, [], []] }, "compress", true, "vcf" diff --git a/subworkflows/nf-core/vcf_annotate_snpeff/main.nf b/subworkflows/nf-core/vcf_annotate_snpeff/main.nf index 3eccc896f89..0c01c256ea5 100644 --- a/subworkflows/nf-core/vcf_annotate_snpeff/main.nf +++ b/subworkflows/nf-core/vcf_annotate_snpeff/main.nf @@ -3,7 +3,7 @@ // include { SNPEFF_SNPEFF } from '../../../modules/nf-core/snpeff/snpeff' -include { TABIX_BGZIPTABIX } from '../../../modules/nf-core/tabix/bgziptabix' +include { HTSLIB_BGZIPTABIX } from '../../../modules/nf-core/htslib/bgziptabix' workflow VCF_ANNOTATE_SNPEFF { take: @@ -13,11 +13,16 @@ workflow VCF_ANNOTATE_SNPEFF { main: SNPEFF_SNPEFF(ch_vcf, val_snpeff_db, ch_snpeff_cache) - TABIX_BGZIPTABIX(SNPEFF_SNPEFF.out.vcf) + HTSLIB_BGZIPTABIX( + SNPEFF_SNPEFF.out.vcf, + "compress", + true, + "vcf" + ) emit: - vcf_tbi = TABIX_BGZIPTABIX.out.gz_index // channel: [ val(meta), path(vcf), path(tbi) ] + vcf_tbi = HTSLIB_BGZIPTABIX.out.gz_index // channel: [ val(meta), path(vcf), path(tbi) ] reports = SNPEFF_SNPEFF.out.report // channel: [ path(html) ] summary = SNPEFF_SNPEFF.out.summary_html // channel: [ path(html) ] genes_txt = SNPEFF_SNPEFF.out.genes_txt // channel: [ path(genes.txt) ] diff --git a/subworkflows/nf-core/vcf_annotate_snpeff/tests/main.nf.test b/subworkflows/nf-core/vcf_annotate_snpeff/tests/main.nf.test index 5c508267d6c..86fc3c8c4ca 100644 --- a/subworkflows/nf-core/vcf_annotate_snpeff/tests/main.nf.test +++ b/subworkflows/nf-core/vcf_annotate_snpeff/tests/main.nf.test @@ -8,7 +8,7 @@ nextflow_workflow { tag "subworkflows_nfcore" tag "subworkflows/vcf_annotate_snpeff" tag "snpeff/snpeff" - tag "tabix/bgziptabix" + tag "htslib/bgziptabix" config "./nextflow.config" diff --git a/subworkflows/nf-core/vcf_extract_relate_somalier/main.nf b/subworkflows/nf-core/vcf_extract_relate_somalier/main.nf index 4b4f593c803..031bb50f3d0 100644 --- a/subworkflows/nf-core/vcf_extract_relate_somalier/main.nf +++ b/subworkflows/nf-core/vcf_extract_relate_somalier/main.nf @@ -1,6 +1,6 @@ -include { SOMALIER_EXTRACT } from '../../../modules/nf-core/somalier/extract/main' -include { SOMALIER_RELATE } from '../../../modules/nf-core/somalier/relate/main' -include { TABIX_TABIX } from '../../../modules/nf-core/tabix/tabix/main' +include { SOMALIER_EXTRACT } from '../../../modules/nf-core/somalier/extract/main' +include { SOMALIER_RELATE } from '../../../modules/nf-core/somalier/relate/main' +include { HTSLIB_BGZIPTABIX } from '../../../modules/nf-core/htslib/bgziptabix/main' workflow VCF_EXTRACT_RELATE_SOMALIER { take: @@ -21,12 +21,15 @@ workflow VCF_EXTRACT_RELATE_SOMALIER { return [ meta, vcf ] } - TABIX_TABIX( - ch_input.no_tbi.map { meta, vcf -> [meta, vcf, [], []] } + HTSLIB_BGZIPTABIX( + ch_input.no_tbi.map { meta, vcf -> [meta, vcf, [], []] }, + "compress", + true, + "vcf" ) ch_somalierextract_input = ch_input.no_tbi - .join(TABIX_TABIX.out.index) + .join(HTSLIB_BGZIPTABIX.out.index) .mix(ch_input.tbi) SOMALIER_EXTRACT( diff --git a/subworkflows/nf-core/vcf_extract_relate_somalier/tests/main.nf.test b/subworkflows/nf-core/vcf_extract_relate_somalier/tests/main.nf.test index fe71eda43c7..f94df0bc770 100644 --- a/subworkflows/nf-core/vcf_extract_relate_somalier/tests/main.nf.test +++ b/subworkflows/nf-core/vcf_extract_relate_somalier/tests/main.nf.test @@ -15,8 +15,8 @@ nextflow_workflow { tag "somalier/extract" tag "somalier/relate" tag "somalier" - tag "tabix/tabix" - tag "tabix" + tag "htslib/bgziptabix" + tag "htslib" tag "bcftools/merge" tag "bcftools" diff --git a/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/main.nf b/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/main.nf index 00c75250283..77f10952ba2 100644 --- a/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/main.nf +++ b/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/main.nf @@ -1,6 +1,6 @@ include { BCFTOOLS_VIEW } from '../../../modules/nf-core/bcftools/view' include { ENSEMBLVEP_FILTERVEP } from '../../../modules/nf-core/ensemblvep/filtervep' -include { TABIX_BGZIPTABIX } from '../../../modules/nf-core/tabix/bgziptabix' +include { HTSLIB_BGZIPTABIX } from '../../../modules/nf-core/htslib/bgziptabix' // Please note this subworkflow requires the options for bcftools_view that are included in the nextflow.config workflow VCF_FILTER_BCFTOOLS_ENSEMBLVEP { @@ -35,12 +35,15 @@ workflow VCF_FILTER_BCFTOOLS_ENSEMBLVEP { ch_filter_vep_feature_file.map { _meta, file -> file }, ) - TABIX_BGZIPTABIX( - ENSEMBLVEP_FILTERVEP.out.output + HTSLIB_BGZIPTABIX( + ENSEMBLVEP_FILTERVEP.out.output.map { meta, vcf -> [meta, vcf, [], []] }, + "compress", + true, + "vcf" ) - ch_vcf = TABIX_BGZIPTABIX.out.gz_index.map { meta, vcf, _tbi -> [meta, vcf] } - ch_tbi = TABIX_BGZIPTABIX.out.gz_index.map { meta, _vcf, tbi -> [meta, tbi] } + ch_vcf = HTSLIB_BGZIPTABIX.out.index.map { meta, vcf, _tbi -> [meta, vcf] } + ch_tbi = HTSLIB_BGZIPTABIX.out.index.map { meta, _vcf, tbi -> [meta, tbi] } } emit: diff --git a/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/tests/main.nf.test b/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/tests/main.nf.test index fb000d16adb..8b7020fbdf6 100644 --- a/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/tests/main.nf.test +++ b/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/tests/main.nf.test @@ -10,7 +10,7 @@ nextflow_workflow { tag "subworkflows/vcf_filter_bcftools_ensemblvep" tag "bcftools/view" tag "ensemblvep/filtervep" - tag "tabix/bgziptabix" + tag "htslib/bgziptabix" test("vcf, hgnc_ids - filter on expression") { diff --git a/subworkflows/nf-core/vcf_gather_bcftools/main.nf b/subworkflows/nf-core/vcf_gather_bcftools/main.nf index 0d0df166b65..1542b3f76af 100644 --- a/subworkflows/nf-core/vcf_gather_bcftools/main.nf +++ b/subworkflows/nf-core/vcf_gather_bcftools/main.nf @@ -1,6 +1,6 @@ include { BCFTOOLS_CONCAT } from '../../../modules/nf-core/bcftools/concat/main' include { BCFTOOLS_SORT } from '../../../modules/nf-core/bcftools/sort/main' -include { TABIX_TABIX } from '../../../modules/nf-core/tabix/tabix/main' +include { HTSLIB_BGZIPTABIX } from '../../../modules/nf-core/htslib/bgziptabix/main' workflow VCF_GATHER_BCFTOOLS { take: @@ -54,13 +54,18 @@ workflow VCF_GATHER_BCFTOOLS { ch_tabix_input = ch_vcf_concat } - TABIX_TABIX(ch_tabix_input.map { meta, vcf -> [meta, vcf, [], []] }) + HTSLIB_BGZIPTABIX( + ch_tabix_input.map { meta, vcf -> [meta, vcf, [], []] }, + "compress", + true, + "vcf" + ) ch_vcf_index = ch_tabix_input - .join(TABIX_TABIX.out.index) + .join(HTSLIB_BGZIPTABIX.out.index) emit: vcf = ch_vcf_concat // channel: [ val(meta), [ vcf ] ] - index = TABIX_TABIX.out.index // channel: [ val(meta), [ tbi or csi ] ] + index = HTSLIB_BGZIPTABIX.out.index // channel: [ val(meta), [ tbi or csi ] ] vcf_index = ch_vcf_index // channel: [ val(meta), [ vcf ], [ tbi or csi ] ] } diff --git a/subworkflows/nf-core/vcf_gather_bcftools/tests/main.nf.test b/subworkflows/nf-core/vcf_gather_bcftools/tests/main.nf.test index fc6902661f7..0ab0938398d 100644 --- a/subworkflows/nf-core/vcf_gather_bcftools/tests/main.nf.test +++ b/subworkflows/nf-core/vcf_gather_bcftools/tests/main.nf.test @@ -14,8 +14,8 @@ nextflow_workflow { tag "bcftools/concat" tag "bcftools/sort" tag "bcftools" - tag "tabix/tabix" - tag "tabix" + tag "htslib/bgziptabix" + tag "htslib" test("homo_sapiens - [vcf, tbi] [vcf, tbi] - meta [] 2 - sample, key - true") { when { From d9d8010fa976364b43a88bf693eb1d8e94c7deda Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 12:15:34 +0000 Subject: [PATCH 10/23] feat: update VCF processing workflows to improve output handling and metadata consistency --- .../nf-core/vcf_annotate_snpeff/main.nf | 11 +++-- .../tests/main.nf.test.snap | 28 ++++++------ .../vcf_extract_relate_somalier/main.nf | 8 ++-- .../vcf_filter_bcftools_ensemblvep/main.nf | 4 +- .../tests/main.nf.test.snap | 44 +++++++++---------- 5 files changed, 50 insertions(+), 45 deletions(-) diff --git a/subworkflows/nf-core/vcf_annotate_snpeff/main.nf b/subworkflows/nf-core/vcf_annotate_snpeff/main.nf index 0c01c256ea5..3ffe0ebf50f 100644 --- a/subworkflows/nf-core/vcf_annotate_snpeff/main.nf +++ b/subworkflows/nf-core/vcf_annotate_snpeff/main.nf @@ -14,16 +14,19 @@ workflow VCF_ANNOTATE_SNPEFF { main: SNPEFF_SNPEFF(ch_vcf, val_snpeff_db, ch_snpeff_cache) HTSLIB_BGZIPTABIX( - SNPEFF_SNPEFF.out.vcf, + SNPEFF_SNPEFF.out.vcf.map { meta, vcf -> [ meta, vcf, [], [] ] }, "compress", true, "vcf" ) + ch_vcf_tbi = HTSLIB_BGZIPTABIX.out.output.join( + HTSLIB_BGZIPTABIX.out.index + ) emit: - vcf_tbi = HTSLIB_BGZIPTABIX.out.gz_index // channel: [ val(meta), path(vcf), path(tbi) ] - reports = SNPEFF_SNPEFF.out.report // channel: [ path(html) ] + vcf_tbi = ch_vcf_tbi // channel: [ val(meta), path(vcf), path(tbi) ] + reports = SNPEFF_SNPEFF.out.report // channel: [ path(html) ] summary = SNPEFF_SNPEFF.out.summary_html // channel: [ path(html) ] - genes_txt = SNPEFF_SNPEFF.out.genes_txt // channel: [ path(genes.txt) ] + genes_txt = SNPEFF_SNPEFF.out.genes_txt // channel: [ path(genes.txt) ] } diff --git a/subworkflows/nf-core/vcf_annotate_snpeff/tests/main.nf.test.snap b/subworkflows/nf-core/vcf_annotate_snpeff/tests/main.nf.test.snap index bd5ab4ce4e3..45fbf0f734b 100644 --- a/subworkflows/nf-core/vcf_annotate_snpeff/tests/main.nf.test.snap +++ b/subworkflows/nf-core/vcf_annotate_snpeff/tests/main.nf.test.snap @@ -7,8 +7,8 @@ "id": "test", "single_end": false }, - "test_snpEff.ann.vcf.gz,variantsMD5:fd266e623365c7d1837bc9eb088fe70c", - "test_snpEff.ann.vcf.gz.tbi" + "test.vcf.gz,variantsMD5:fd266e623365c7d1837bc9eb088fe70c", + "test.vcf.gz.tbi" ] ], [ @@ -45,11 +45,11 @@ ] ] ], + "timestamp": "2026-05-08T11:58:11.23938487", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-02-11T11:34:58.21819" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } }, "WBcel235.99 - test.vcf.gz - stub": { "content": [ @@ -60,8 +60,8 @@ "id": "test", "single_end": false }, - "test_snpEff.ann.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test_snpEff.ann.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -136,16 +136,16 @@ "id": "test", "single_end": false }, - "test_snpEff.ann.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test_snpEff.ann.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ] } ], + "timestamp": "2026-05-08T11:58:18.853879167", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-02-11T11:35:06.006968" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } } } \ No newline at end of file diff --git a/subworkflows/nf-core/vcf_extract_relate_somalier/main.nf b/subworkflows/nf-core/vcf_extract_relate_somalier/main.nf index 031bb50f3d0..3c7e54ca683 100644 --- a/subworkflows/nf-core/vcf_extract_relate_somalier/main.nf +++ b/subworkflows/nf-core/vcf_extract_relate_somalier/main.nf @@ -28,9 +28,11 @@ workflow VCF_EXTRACT_RELATE_SOMALIER { "vcf" ) - ch_somalierextract_input = ch_input.no_tbi - .join(HTSLIB_BGZIPTABIX.out.index) - .mix(ch_input.tbi) + ch_somalierextract_input = HTSLIB_BGZIPTABIX.out.output.join( + HTSLIB_BGZIPTABIX.out.index + ).mix( + ch_input.tbi + ) SOMALIER_EXTRACT( ch_somalierextract_input, diff --git a/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/main.nf b/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/main.nf index 77f10952ba2..aef3d71291a 100644 --- a/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/main.nf +++ b/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/main.nf @@ -42,8 +42,8 @@ workflow VCF_FILTER_BCFTOOLS_ENSEMBLVEP { "vcf" ) - ch_vcf = HTSLIB_BGZIPTABIX.out.index.map { meta, vcf, _tbi -> [meta, vcf] } - ch_tbi = HTSLIB_BGZIPTABIX.out.index.map { meta, _vcf, tbi -> [meta, tbi] } + ch_vcf = HTSLIB_BGZIPTABIX.out.output + ch_tbi = HTSLIB_BGZIPTABIX.out.index } emit: diff --git a/subworkflows/nf-core/vcf_gather_bcftools/tests/main.nf.test.snap b/subworkflows/nf-core/vcf_gather_bcftools/tests/main.nf.test.snap index 6658f35462c..220e9a7f32c 100644 --- a/subworkflows/nf-core/vcf_gather_bcftools/tests/main.nf.test.snap +++ b/subworkflows/nf-core/vcf_gather_bcftools/tests/main.nf.test.snap @@ -37,15 +37,15 @@ } ] }, - "null.sorted.vcf.gz.tbi" + "null.vcf.gz.tbi" ] ] ], + "timestamp": "2026-05-08T12:11:39.669945556", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-02-03T14:03:09.814655722" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } }, "homo_sapiens - [vcf, tbi] [vcf, tbi] - meta [] 1 - id - false": { "content": [ @@ -86,7 +86,7 @@ } ] }, - "test2_haplotc.ann.vcf.gz.tbi" + "test_1.vcf.gz.tbi" ], [ { @@ -98,15 +98,15 @@ } ] }, - "test2_haplotc.vcf.gz.tbi" + "test_2.vcf.gz.tbi" ] ] ], + "timestamp": "2026-05-08T12:11:47.25104859", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-02-03T14:03:15.844814123" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } }, "homo_sapiens no_meta - [vcf, tbi] [vcf, tbi] - meta equal [] 2 - [] - true": { "content": [ @@ -124,15 +124,15 @@ { "id": "test" }, - "test.sorted.vcf.gz.tbi" + "test.vcf.gz.tbi" ] ] ], + "timestamp": "2026-05-08T12:11:55.989957001", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-02-03T13:59:22.879536838" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } }, "homo_sapiens no_meta - [vcf, tbi] [vcf, tbi] - meta equal [] 2 - [] - true -- stub": { "content": [ @@ -143,7 +143,7 @@ "other_meta": "test" }, "test.sorted.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test.sorted.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ], [ { @@ -151,14 +151,14 @@ "other_meta": "test2" }, "test2.sorted.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test2.sorted.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test2.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ] ], + "timestamp": "2026-05-08T12:12:05.096756591", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-02-03T14:03:34.21563537" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } } } \ No newline at end of file From 64170abe547847b9f7e91b8fb0841c4afd2d60ba Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 13:36:39 +0000 Subject: [PATCH 11/23] feat: update tabix command logic and add test for VCF compression with index --- modules/nf-core/htslib/bgziptabix/main.nf | 2 +- .../htslib/bgziptabix/tests/main.nf.test | 4 +- .../htslib/bgziptabix/tests/main.nf.test.snap | 57 +++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/htslib/bgziptabix/main.nf b/modules/nf-core/htslib/bgziptabix/main.nf index 4ede4fbaaaa..adb7c00bb6f 100644 --- a/modules/nf-core/htslib/bgziptabix/main.nf +++ b/modules/nf-core/htslib/bgziptabix/main.nf @@ -41,7 +41,7 @@ process HTSLIB_BGZIPTABIX { def bgzip_cmd = action == "compress" ? "[ '\$(basename ${infile})' != '\$(basename ${outfile})' ] && ln -s ${infile} ${outfile}" : "bgzip -c -d ${args} -@ ${task.cpus} ${infile} > ${outfile}" def regions_arg = regions ? "-R ${regions}" : "" - def tabix_cmd = make_index ? "tabix -@ ${task.cpus} ${regions_arg} ${args2} -f ${outfile}" : "" + def tabix_cmd = (make_index && !infile_tbi) ? "tabix -@ ${task.cpus} ${regions_arg} ${args2} -f ${outfile}" : "" def link_tabix_cmd = make_index && infile_tbi ? "ln -s ${infile_tbi} ${outfile}.${infile_tbi.extension}" : "" def uncompressed_cmd = action == "compress" ? "${compress_cmd} ${infile} > ${outfile}" : (infile.getName() == outfile ? "" : "ln -s ${infile} ${outfile}") """ diff --git a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test index 9cfa6d83466..cde03546fd0 100644 --- a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test @@ -377,7 +377,7 @@ nextflow_process { } } - test("sarscov2 - vcf - compress - no index - stub") { + test("sarscov2 - vcf - compress - index - stub") { options "-stub" @@ -391,7 +391,7 @@ nextflow_process { [] ] input[1] = 'compress' // action - input[2] = false // make_index + input[2] = true // make_index input[3] = 'vcf' // out_ext """ } diff --git a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap index b8fed9df012..435f89d5f68 100644 --- a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap @@ -270,6 +270,63 @@ "nextflow": "26.04.0" } }, + "sarscov2 - vcf - compress - index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ], + "index": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.23.1" + ] + ] + } + ], + "timestamp": "2026-05-08T13:19:43.890425188", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, "sarscov2 - vcf - decompress": { "content": [ { From 7c60cfd7efe9a4d170041a5f487e7220cd591e99 Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 13:36:52 +0000 Subject: [PATCH 12/23] feat: update input file definitions and add optional regions file support in bgziptabix module --- modules/nf-core/htslib/bgziptabix/meta.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/htslib/bgziptabix/meta.yml b/modules/nf-core/htslib/bgziptabix/meta.yml index 6f958ef60ca..800af17de47 100644 --- a/modules/nf-core/htslib/bgziptabix/meta.yml +++ b/modules/nf-core/htslib/bgziptabix/meta.yml @@ -26,11 +26,26 @@ input: description: | Groovy Map containing sample information e.g. [ id:'sample1' ] - - in_file: + - infile: type: file description: Input file to compress or decompress pattern: "*" ontologies: [] + - infile_tbi: + type: file + description: Optional tabix index for the input file. Required when decompressing + and creating an index for the output file. + pattern: "*.{tbi,csi}" + ontologies: + - edam: http://edamontology.org/format_3616 # tabix + - regions: + type: file + description: Optional file of regions to extract (BED or chr:start-end format). + Only used when creating an index for the output file. + pattern: "*.{bed,txt,tsv}" + ontologies: + - edam: http://edamontology.org/format_3475 # TSV + - edam: http://edamontology.org/format_3003 # BED - action: type: string description: Action to perform, either `compress` or `decompress` From 74279c7e7fc31336e09746373a0471e41460391c Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 13:45:14 +0000 Subject: [PATCH 13/23] feat: update output file definitions to use consistent naming for compressed files --- modules/nf-core/samtools/bgzip/meta.yml | 2 +- modules/nf-core/tabix/bgzip/meta.yml | 2 +- modules/nf-core/tabix/tabix/meta.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/samtools/bgzip/meta.yml b/modules/nf-core/samtools/bgzip/meta.yml index be4a04a092e..57566342398 100644 --- a/modules/nf-core/samtools/bgzip/meta.yml +++ b/modules/nf-core/samtools/bgzip/meta.yml @@ -43,7 +43,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - ${outfile}: + - output.gz: type: map description: | A FASTA file compressed with the BGZF algorithm. It will be diff --git a/modules/nf-core/tabix/bgzip/meta.yml b/modules/nf-core/tabix/bgzip/meta.yml index a94e3a21ed7..d704dcf2982 100644 --- a/modules/nf-core/tabix/bgzip/meta.yml +++ b/modules/nf-core/tabix/bgzip/meta.yml @@ -31,7 +31,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - ${output}: + - output.gz: type: file description: Output compressed/decompressed file pattern: "*." diff --git a/modules/nf-core/tabix/tabix/meta.yml b/modules/nf-core/tabix/tabix/meta.yml index 4acd4bb57b2..244ed18a3a9 100644 --- a/modules/nf-core/tabix/tabix/meta.yml +++ b/modules/nf-core/tabix/tabix/meta.yml @@ -63,7 +63,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "${prefix}.*gz": + - "output.*gz": type: file description: Bgzipped file of extracted regions, preserving the input file extension. Emitted when a regions file is provided. From 4c4cf8595727daa91cfd55e9fdb08b0698715baa Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 13:48:52 +0000 Subject: [PATCH 14/23] fix: Add missing module information in subworkflow meta.yml --- subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/meta.yml | 3 +-- subworkflows/nf-core/vcf_annotate_snpeff/meta.yml | 2 +- subworkflows/nf-core/vcf_extract_relate_somalier/meta.yml | 2 +- subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/meta.yml | 2 +- subworkflows/nf-core/vcf_gather_bcftools/meta.yml | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/meta.yml b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/meta.yml index 8e0e205537f..26f6b5b5c0a 100644 --- a/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/meta.yml +++ b/subworkflows/nf-core/vcf_annotate_ensemblvep_snpeff/meta.yml @@ -12,8 +12,7 @@ components: - ensemblvep/vep - snpeff/download - snpeff/snpeff - - tabix/tabix - - tabix/bgzip + - htslib/bgziptabix - bcftools/pluginscatter - bcftools/concat - bcftools/sort diff --git a/subworkflows/nf-core/vcf_annotate_snpeff/meta.yml b/subworkflows/nf-core/vcf_annotate_snpeff/meta.yml index bf2db6523b5..17aa43605d7 100644 --- a/subworkflows/nf-core/vcf_annotate_snpeff/meta.yml +++ b/subworkflows/nf-core/vcf_annotate_snpeff/meta.yml @@ -8,7 +8,7 @@ keywords: components: - snpeff - snpeff/snpeff - - tabix/bgziptabix + - htslib/bgziptabix input: - ch_vcf: description: | diff --git a/subworkflows/nf-core/vcf_extract_relate_somalier/meta.yml b/subworkflows/nf-core/vcf_extract_relate_somalier/meta.yml index 76b97228a87..f31ac706f25 100644 --- a/subworkflows/nf-core/vcf_extract_relate_somalier/meta.yml +++ b/subworkflows/nf-core/vcf_extract_relate_somalier/meta.yml @@ -8,7 +8,7 @@ keywords: - ped - relatedness components: - - tabix/tabix + - htslib/bgziptabix - somalier/extract - somalier/relate input: diff --git a/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/meta.yml b/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/meta.yml index b9d3d7c40ad..34a65794161 100644 --- a/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/meta.yml +++ b/subworkflows/nf-core/vcf_filter_bcftools_ensemblvep/meta.yml @@ -9,7 +9,7 @@ keywords: components: - bcftools/view - ensemblvep/filtervep - - tabix/bgziptabix + - htslib/bgziptabix input: - ch_vcf: type: file diff --git a/subworkflows/nf-core/vcf_gather_bcftools/meta.yml b/subworkflows/nf-core/vcf_gather_bcftools/meta.yml index cadb33e3f85..5198a01d0d2 100644 --- a/subworkflows/nf-core/vcf_gather_bcftools/meta.yml +++ b/subworkflows/nf-core/vcf_gather_bcftools/meta.yml @@ -12,7 +12,7 @@ keywords: components: - bcftools/sort - bcftools/concat - - tabix/tabix + - htslib/bgziptabix input: - meta: type: map From 03f2444fe3183cd58e62dd625eea69fe4d950715 Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 14:12:32 +0000 Subject: [PATCH 15/23] fix: update samtools version to 1.23.1 in environment.yml --- modules/nf-core/paraphase/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/paraphase/environment.yml b/modules/nf-core/paraphase/environment.yml index 64644194458..d9211e4a3dd 100644 --- a/modules/nf-core/paraphase/environment.yml +++ b/modules/nf-core/paraphase/environment.yml @@ -10,4 +10,4 @@ dependencies: # renovate: datasource=conda depName=bioconda/paraphase - bioconda::paraphase=3.5.0 # renovate: datasource=conda depName=bioconda/samtools - - bioconda::samtools=1.23 + - bioconda::samtools=1.23.1 From 3ef74c528a30bf1dbe24631cfc43378a7f677997 Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 14:31:01 +0000 Subject: [PATCH 16/23] test: Update snapshot for bam_variant_calling_mpileup_bcftools --- .../tests/main.nf.test.snap | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test.snap b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test.snap index c749af80c6c..58c04be86b4 100644 --- a/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_variant_calling_mpileup_bcftools/tests/main.nf.test.snap @@ -11,17 +11,17 @@ "NA12878_22.vcf.gz", "VcfFile [chromosomes=[chr22], sampleCount=1, variantCount=902, phased=false, phasedAutodetect=false]", "b852b1cae943360e00ab93004509808a", - "NA12878_22.vcf.gz.tbi" + "all_samples.vcf.gz.tbi" ] ], [ "NA12878_22.bcftools_stats.txt:md5,99e061326bb518f555db886788420467" ] ], - "timestamp": "2026-03-23T01:55:41.061652061", + "timestamp": "2026-05-08T14:29:45.990449432", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.2" + "nf-test": "0.9.5", + "nextflow": "26.04.0" } }, "Two individuals and two chromosomes, sort and annotate": { @@ -64,7 +64,7 @@ "all_samples_all_chr.concat.vcf.gz", "VcfFile [chromosomes=[chr21, chr22], sampleCount=1, variantCount=1737, phased=false, phasedAutodetect=false]", "2e125158b5531e9325cc00f004cebeeb", - "all_samples_all_chr.concat.vcf.gz.tbi" + "all_samples.vcf.gz.tbi" ] ], [ @@ -72,10 +72,10 @@ "NA12878_22.bcftools_stats.txt:md5,99e061326bb518f555db886788420467" ] ], - "timestamp": "2026-03-23T01:55:55.943228912", + "timestamp": "2026-05-08T14:29:58.835487732", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.2" + "nf-test": "0.9.5", + "nextflow": "26.04.0" } } } \ No newline at end of file From 7db504a8c949a3afc1a24f956bf91b8c4c2b7a34 Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 14:56:03 +0000 Subject: [PATCH 17/23] fix: update container image and samtools version in PARAPHASE process --- modules/nf-core/paraphase/main.nf | 4 +- .../nf-core/paraphase/tests/main.nf.test.snap | 56 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/modules/nf-core/paraphase/main.nf b/modules/nf-core/paraphase/main.nf index 04231185ce1..203efdb809f 100644 --- a/modules/nf-core/paraphase/main.nf +++ b/modules/nf-core/paraphase/main.nf @@ -5,8 +5,8 @@ process PARAPHASE { conda "${moduleDir}/environment.yml" container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container - ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/d2/d2f7e7ef6dd6def56bef5252c28a65f279d5fcef09a832510d0de1d6dab09194/data' - : 'community.wave.seqera.io/library/minimap2_paraphase_samtools:2c52f03fe994efa6'}" + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/44/4438b3091fe6cc6f4c5bc79c1722f359155539b5f657846d11a76cd36b1df729/data' + : 'community.wave.seqera.io/library/minimap2_paraphase_samtools:a2e6a25ed8d1a8e5'}" input: tuple val(meta), path(bam), path(bai) diff --git a/modules/nf-core/paraphase/tests/main.nf.test.snap b/modules/nf-core/paraphase/tests/main.nf.test.snap index 5016be3d0e7..4d8c79a24cf 100644 --- a/modules/nf-core/paraphase/tests/main.nf.test.snap +++ b/modules/nf-core/paraphase/tests/main.nf.test.snap @@ -66,15 +66,15 @@ [ "PARAPHASE", "samtools", - "1.23" + "1.23.1" ] ] } ], - "timestamp": "2026-03-05T14:04:38.827925407", + "timestamp": "2026-05-08T14:50:17.296254762", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.0" } }, "homo_sapiens - [ bam, bai ], no_vcf": { @@ -131,15 +131,15 @@ [ "PARAPHASE", "samtools", - "1.23" + "1.23.1" ] ] } ], - "timestamp": "2026-03-05T14:22:39.219497979", + "timestamp": "2026-05-08T14:50:46.83589087", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.0" } }, "homo_sapiens - [ bam, bai ], config - stub": { @@ -208,15 +208,15 @@ [ "PARAPHASE", "samtools", - "1.23" + "1.23.1" ] ] } ], - "timestamp": "2026-03-05T14:05:34.4449022", + "timestamp": "2026-05-08T14:51:24.50756361", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.0" } }, "homo_sapiens - [ bam, bai ], config - csi_index": { @@ -286,15 +286,15 @@ [ "PARAPHASE", "samtools", - "1.23" + "1.23.1" ] ] } ], - "timestamp": "2026-03-05T14:05:16.809547984", + "timestamp": "2026-05-08T14:51:03.735069977", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.0" } }, "homo_sapiens - [ bam, bai ], [] - stub": { @@ -363,15 +363,15 @@ [ "PARAPHASE", "samtools", - "1.23" + "1.23.1" ] ] } ], - "timestamp": "2026-03-05T14:05:25.477896955", + "timestamp": "2026-05-08T14:51:13.727430134", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.0" } }, "homo_sapiens - [ bam, bai ], config": { @@ -441,15 +441,15 @@ [ "PARAPHASE", "samtools", - "1.23" + "1.23.1" ] ] } ], - "timestamp": "2026-03-05T14:04:52.751574184", + "timestamp": "2026-05-08T14:50:34.175416206", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.0" } }, "homo_sapiens - [ bam, bai ], config - stub - csi_index": { @@ -518,15 +518,15 @@ [ "PARAPHASE", "samtools", - "1.23" + "1.23.1" ] ] } ], - "timestamp": "2026-03-05T14:05:43.65305743", + "timestamp": "2026-05-08T14:51:34.514801984", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.0" } } } \ No newline at end of file From cd93d556f1bc0e22c369753701a18e339df9283f Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 15:00:32 +0000 Subject: [PATCH 18/23] fix (multivcfanalyzer): update htslib version to 1.23.1 and adjust test snapshots --- .../nf-core/multivcfanalyzer/environment.yml | 2 +- modules/nf-core/multivcfanalyzer/main.nf | 4 ++-- .../multivcfanalyzer/tests/main.nf.test.snap | 24 +++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/nf-core/multivcfanalyzer/environment.yml b/modules/nf-core/multivcfanalyzer/environment.yml index 52d9057cfaf..259a2b9564b 100644 --- a/modules/nf-core/multivcfanalyzer/environment.yml +++ b/modules/nf-core/multivcfanalyzer/environment.yml @@ -4,5 +4,5 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::htslib=1.23 + - bioconda::htslib=1.23.1 - bioconda::multivcfanalyzer=0.89.0 diff --git a/modules/nf-core/multivcfanalyzer/main.nf b/modules/nf-core/multivcfanalyzer/main.nf index 8b8c01e5c9e..5192a9a37c7 100644 --- a/modules/nf-core/multivcfanalyzer/main.nf +++ b/modules/nf-core/multivcfanalyzer/main.nf @@ -4,8 +4,8 @@ process MULTIVCFANALYZER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/07/0713bc8b2176da50f1967ae24dd955f913b7288b966408220596e91c5c14aeeb/data' : - 'community.wave.seqera.io/library/htslib_multivcfanalyzer:6387733614faccad' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/79/7946097c8ad51df09c52ebf0b91d4f2c42ab74fd37ac3c00fd6acab0e3602136/data' : + 'community.wave.seqera.io/library/htslib_multivcfanalyzer:a64c201b4804e6cd' }" input: tuple val(meta), path(vcfs) diff --git a/modules/nf-core/multivcfanalyzer/tests/main.nf.test.snap b/modules/nf-core/multivcfanalyzer/tests/main.nf.test.snap index baacc84175f..b16dd77d887 100644 --- a/modules/nf-core/multivcfanalyzer/tests/main.nf.test.snap +++ b/modules/nf-core/multivcfanalyzer/tests/main.nf.test.snap @@ -13,7 +13,7 @@ [ "MULTIVCFANALYZER", "tabix", - "1.23" + "1.23.1" ] ] }, @@ -63,11 +63,11 @@ } } ], + "timestamp": "2026-05-08T14:59:53.626235086", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-03-18T15:41:27.085433" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } }, "sarscov2 - vcf - stub": { "content": [ @@ -107,7 +107,7 @@ [ "MULTIVCFANALYZER", "tabix", - "1.23" + "1.23.1" ] ], "2": [ @@ -273,7 +273,7 @@ [ "MULTIVCFANALYZER", "tabix", - "1.23" + "1.23.1" ] ] }, @@ -289,15 +289,15 @@ [ "MULTIVCFANALYZER", "tabix", - "1.23" + "1.23.1" ] ] } ], + "timestamp": "2026-05-08T15:00:05.521714771", "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-03-18T15:45:17.21456" + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } } } \ No newline at end of file From 69f07c3aa186101216c762d34608ea5a27568b46 Mon Sep 17 00:00:00 2001 From: itrujnara Date: Fri, 8 May 2026 15:05:34 +0000 Subject: [PATCH 19/23] fix(paraphase): standardize quotes in gzip command for consistency --- modules/nf-core/paraphase/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/paraphase/main.nf b/modules/nf-core/paraphase/main.nf index 203efdb809f..7f060e24183 100644 --- a/modules/nf-core/paraphase/main.nf +++ b/modules/nf-core/paraphase/main.nf @@ -68,7 +68,7 @@ process PARAPHASE { touch ${prefix}.paraphase.json touch ${prefix}.paraphase.bam touch ${prefix}.paraphase.bam.bai - echo '' | gzip > ${prefix}_paraphase_vcfs/${prefix}_stub.vcf.gz + echo "" | gzip > ${prefix}_paraphase_vcfs/${prefix}_stub.vcf.gz touch ${prefix}_paraphase_vcfs/${prefix}_stub.vcf.gz.${index} """ } From 1747b37a699f1f57bbc522b2a29bc6cd19bc78a5 Mon Sep 17 00:00:00 2001 From: itrujnara Date: Tue, 12 May 2026 10:01:48 +0000 Subject: [PATCH 20/23] fix(htslib_bgziptabix): improve string interpolation and update description for optional input file index --- modules/nf-core/htslib/bgziptabix/main.nf | 49 +++++++++++----------- modules/nf-core/htslib/bgziptabix/meta.yml | 3 +- modules/nf-core/paraphase/main.nf | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/modules/nf-core/htslib/bgziptabix/main.nf b/modules/nf-core/htslib/bgziptabix/main.nf index adb7c00bb6f..9efe9689bfe 100644 --- a/modules/nf-core/htslib/bgziptabix/main.nf +++ b/modules/nf-core/htslib/bgziptabix/main.nf @@ -1,11 +1,11 @@ process HTSLIB_BGZIPTABIX { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/33/33a1f2c7f36ec58339e41cbea096d121f606918778a91cfbef944b40ba7ce48b/data': - 'community.wave.seqera.io/library/htslib_xz:49c8c84af5c4b3b9' }" + container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/33/33a1f2c7f36ec58339e41cbea096d121f606918778a91cfbef944b40ba7ce48b/data' + : 'community.wave.seqera.io/library/htslib_xz:49c8c84af5c4b3b9'}" input: tuple val(meta), path(infile), path(infile_tbi), path(regions) @@ -14,10 +14,11 @@ process HTSLIB_BGZIPTABIX { val out_ext output: - tuple val(meta), path("${outfile}") , emit: output - tuple val(meta), path("${outfile}.{tbi,csi}"), emit: index , optional: true + tuple val(meta), path("${outfile}"), emit: output + tuple val(meta), path("${outfile}.{tbi,csi}"), emit: index, optional: true // all htslib tools have the same version, we use bgzip tuple val("${task.process}"), val('htslib'), eval("bgzip --version | sed '1! d; s/bgzip (htslib) //'"), topic: versions, emit: versions_htslib + tuple val("${task.process}"), val('xz'), eval("xz --version | sed '1! d; s/xz (XZ Utils) //'"), topic: versions, emit: versions_xz when: task.ext.when == null || task.ext.when @@ -25,24 +26,24 @@ process HTSLIB_BGZIPTABIX { script: def allowed_actions = ["compress", "decompress"] if (action !in allowed_actions) { - error "htslib/bgziptabix: Invalid action: ${action}. Allowed actions are: ${allowed_actions.join(', ')}" + error("htslib/bgziptabix: Invalid action: ${action}. Allowed actions are: ${allowed_actions.join(', ')}") } if (action == "decompress" && make_index) { log.warn("htslib/bgziptabix: Cannot create index when decompressing. Ignoring make_index option.") } - def args = task.ext.args ?: '' - def args2 = task.ext.args2 ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - outfile = action == "compress" ? (out_ext ? "${prefix}.${out_ext}.gz" : "${prefix}.gz") : (out_ext ? "${prefix}.${out_ext}" : "${prefix}") + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + outfile = action == "compress" ? (out_ext ? "${prefix}.${out_ext}.gz" : "${prefix}.gz") : (out_ext ? "${prefix}.${out_ext}" : "${prefix}") - def compress_cmd = action == "compress" ? "bgzip -c ${args} -@ ${task.cpus}" : "cat" - def bgzip_cmd = action == "compress" ? "[ '\$(basename ${infile})' != '\$(basename ${outfile})' ] && ln -s ${infile} ${outfile}" : "bgzip -c -d ${args} -@ ${task.cpus} ${infile} > ${outfile}" + def compress_cmd = action == "compress" ? "bgzip -c ${args} -@ ${task.cpus}" : "cat" + def bgzip_cmd = action == "compress" ? "[ '\$(basename ${infile})' != '\$(basename ${outfile})' ] && ln -s ${infile} ${outfile}" : "bgzip -c -d ${args} -@ ${task.cpus} ${infile} > ${outfile}" - def regions_arg = regions ? "-R ${regions}" : "" - def tabix_cmd = (make_index && !infile_tbi) ? "tabix -@ ${task.cpus} ${regions_arg} ${args2} -f ${outfile}" : "" - def link_tabix_cmd = make_index && infile_tbi ? "ln -s ${infile_tbi} ${outfile}.${infile_tbi.extension}" : "" + def regions_arg = regions ? "-R ${regions}" : "" + def tabix_cmd = (make_index && !infile_tbi) ? "tabix -@ ${task.cpus} ${regions_arg} ${args2} -f ${outfile}" : "" + def link_tabix_cmd = make_index && infile_tbi ? "ln -s ${infile_tbi} ${outfile}.${infile_tbi.extension}" : "" def uncompressed_cmd = action == "compress" ? "${compress_cmd} ${infile} > ${outfile}" : (infile.getName() == outfile ? "" : "ln -s ${infile} ${outfile}") """ ${link_tabix_cmd} @@ -67,19 +68,19 @@ process HTSLIB_BGZIPTABIX { """ stub: - def args = task.ext.args ?: '' + def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - outfile = action == "compress" ? (out_ext ? "${prefix}.${out_ext}.gz" : "${prefix}.gz") : (out_ext ? "${prefix}.${out_ext}" : "${prefix}") + prefix = task.ext.prefix ?: "${meta.id}" + outfile = action == "compress" ? (out_ext ? "${prefix}.${out_ext}.gz" : "${prefix}.gz") : (out_ext ? "${prefix}.${out_ext}" : "${prefix}") - def touch_cmd = action == "compress" ? "echo | bgzip -c" : "echo" - def index_fmt = args2.contains('-C') ? 'csi' : 'tbi' - def tabix_cmd = make_index ? "touch ${outfile}.${index_fmt}" : "" + def touch_cmd = action == "compress" ? "echo | bgzip -c" : "echo" + def index_fmt = args2.contains('-C') ? 'csi' : 'tbi' + def tabix_cmd = make_index ? "touch ${outfile}.${index_fmt}" : "" def link_tabix_cmd = make_index && infile_tbi ? "ln -s ${infile_tbi} ${outfile}.${infile_tbi.extension}" : "" """ - echo $args + echo ${args} - $touch_cmd > $outfile + ${touch_cmd} > ${outfile} ${tabix_cmd} ${link_tabix_cmd} diff --git a/modules/nf-core/htslib/bgziptabix/meta.yml b/modules/nf-core/htslib/bgziptabix/meta.yml index 800af17de47..7a09ff8a1d4 100644 --- a/modules/nf-core/htslib/bgziptabix/meta.yml +++ b/modules/nf-core/htslib/bgziptabix/meta.yml @@ -33,8 +33,7 @@ input: ontologies: [] - infile_tbi: type: file - description: Optional tabix index for the input file. Required when decompressing - and creating an index for the output file. + description: Optional tabix index for the input file. pattern: "*.{tbi,csi}" ontologies: - edam: http://edamontology.org/format_3616 # tabix diff --git a/modules/nf-core/paraphase/main.nf b/modules/nf-core/paraphase/main.nf index 7f060e24183..eeeb5807195 100644 --- a/modules/nf-core/paraphase/main.nf +++ b/modules/nf-core/paraphase/main.nf @@ -68,7 +68,7 @@ process PARAPHASE { touch ${prefix}.paraphase.json touch ${prefix}.paraphase.bam touch ${prefix}.paraphase.bam.bai - echo "" | gzip > ${prefix}_paraphase_vcfs/${prefix}_stub.vcf.gz + echo | gzip > ${prefix}_paraphase_vcfs/${prefix}_stub.vcf.gz touch ${prefix}_paraphase_vcfs/${prefix}_stub.vcf.gz.${index} """ } From fddf2584558a1404e6cddd50e7b0e1a97bec8a45 Mon Sep 17 00:00:00 2001 From: itrujnara Date: Tue, 12 May 2026 10:33:05 +0000 Subject: [PATCH 21/23] fix: fix linting in htslib meta nd paraphase stub --- modules/nf-core/htslib/bgziptabix/meta.yml | 19 +++++++++++++++++++ modules/nf-core/paraphase/main.nf | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/htslib/bgziptabix/meta.yml b/modules/nf-core/htslib/bgziptabix/meta.yml index 7a09ff8a1d4..4cdefd0e16d 100644 --- a/modules/nf-core/htslib/bgziptabix/meta.yml +++ b/modules/nf-core/htslib/bgziptabix/meta.yml @@ -89,6 +89,16 @@ output: - bgzip --version | sed '1! d; s/bgzip (htslib) //': type: eval description: The expression to obtain the version of the tool + versions_xz: + - - ${task.process}: + type: string + description: The name of the process + - xz: + type: string + description: The name of the tool + - xz --version | sed '1! d; s/xz (XZ Utils) //': + type: eval + description: The expression to obtain the version of the tool topics: versions: - - ${task.process}: @@ -100,6 +110,15 @@ topics: - bgzip --version | sed '1! d; s/bgzip (htslib) //': type: eval description: The expression to obtain the version of the tool + - - ${task.process}: + type: string + description: The name of the process + - xz: + type: string + description: The name of the tool + - xz --version | sed '1! d; s/xz (XZ Utils) //': + type: eval + description: The expression to obtain the version of the tool authors: - "@itrujnara" maintainers: diff --git a/modules/nf-core/paraphase/main.nf b/modules/nf-core/paraphase/main.nf index eeeb5807195..7f060e24183 100644 --- a/modules/nf-core/paraphase/main.nf +++ b/modules/nf-core/paraphase/main.nf @@ -68,7 +68,7 @@ process PARAPHASE { touch ${prefix}.paraphase.json touch ${prefix}.paraphase.bam touch ${prefix}.paraphase.bam.bai - echo | gzip > ${prefix}_paraphase_vcfs/${prefix}_stub.vcf.gz + echo "" | gzip > ${prefix}_paraphase_vcfs/${prefix}_stub.vcf.gz touch ${prefix}_paraphase_vcfs/${prefix}_stub.vcf.gz.${index} """ } From a5a8ec9e9a9e23796d7f38c61fb881662bf19fad Mon Sep 17 00:00:00 2001 From: itrujnara Date: Tue, 12 May 2026 11:33:54 +0000 Subject: [PATCH 22/23] test: update snapshot for htslib/bgziptabix --- .../htslib/bgziptabix/tests/main.nf.test.snap | 216 +++++++++++++++++- 1 file changed, 206 insertions(+), 10 deletions(-) diff --git a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap index 435f89d5f68..b97a375fbc4 100644 --- a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap @@ -20,6 +20,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ ], @@ -37,6 +44,13 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] }, { @@ -46,10 +60,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-06T15:00:03.802747158", + "timestamp": "2026-05-12T11:30:32.391550457", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -132,6 +153,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ ], @@ -149,6 +177,13 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] }, { @@ -158,10 +193,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-06T15:00:14.390739704", + "timestamp": "2026-05-12T11:30:48.48636532", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -235,6 +277,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ ], @@ -252,6 +301,13 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] }, { @@ -261,10 +317,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-06T15:17:43.605725172", + "timestamp": "2026-05-12T11:30:25.541539783", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -348,6 +411,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ ], @@ -365,6 +435,13 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] }, { @@ -374,10 +451,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-07T10:01:52.038270626", + "timestamp": "2026-05-12T11:29:51.051014953", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -404,6 +488,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ ], @@ -421,6 +512,13 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] }, { @@ -430,10 +528,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-06T15:18:08.165435155", + "timestamp": "2026-05-12T11:30:58.628427144", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -465,6 +570,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ [ { @@ -487,6 +599,13 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] }, { @@ -496,10 +615,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-06T14:59:41.265882348", + "timestamp": "2026-05-12T11:29:57.777418731", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -526,6 +652,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ ], @@ -543,6 +676,13 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] }, { @@ -552,10 +692,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-07T09:51:11.862701779", + "timestamp": "2026-05-12T11:31:30.587093278", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -629,6 +776,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ ], @@ -646,6 +800,13 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] }, { @@ -655,10 +816,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-06T14:59:48.733485267", + "timestamp": "2026-05-12T11:30:18.777591499", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -682,10 +850,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-08T10:20:13.674891739", + "timestamp": "2026-05-12T11:30:05.072037581", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -712,6 +887,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ ], @@ -729,6 +911,13 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] }, { @@ -738,10 +927,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-08T08:10:06.769087104", + "timestamp": "2026-05-12T11:30:11.845127997", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" From a8f76212fa0bd1b12edc182a06f7dd152dc6595c Mon Sep 17 00:00:00 2001 From: itrujnara Date: Tue, 12 May 2026 11:48:23 +0000 Subject: [PATCH 23/23] test: update snapshot for htslib/bgziptabix --- .../htslib/bgziptabix/tests/main.nf.test.snap | 55 ++++++++++++++++++- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap index b97a375fbc4..cbd4e3bc886 100644 --- a/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap @@ -97,6 +97,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ ], @@ -114,6 +121,13 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] }, { @@ -123,10 +137,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-07T09:51:48.280693973", + "timestamp": "2026-05-12T11:44:52.395458538", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -230,6 +251,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ ], @@ -247,10 +275,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-06T15:18:46.671916956", + "timestamp": "2026-05-12T11:45:40.441558804", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0" @@ -359,6 +394,13 @@ "1.23.1" ] ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], "index": [ [ { @@ -381,10 +423,17 @@ "htslib", "1.23.1" ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] ] } ], - "timestamp": "2026-05-08T13:19:43.890425188", + "timestamp": "2026-05-12T11:45:16.347879793", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.0"