diff --git a/CHANGELOG.md b/CHANGELOG.md index e4cda7d0..4597abdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,10 +16,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Adding nf-core HAPPY_REPORT module to generate a standalone interactive HTML report from the stratified hap.py results (`*.roc.all.csv.gz`) of all test VCFs, for germline small variant benchmarks. [#326](https://github.com/nf-core/variantbenchmarking/pull/326) - `happy_comparison_engine` parameter to choose the hap.py comparison engine (`default`, `xcmp`, `vcfeval`). The `scmp-somatic` and `scmp-distance` engines are not supported because of unresolved issues in hap.py ([Illumina/hap.py#181](https://github.com/Illumina/hap.py/issues/181)). The chosen engine is also passed to HAPPY_REPORT as `comparison_method`. [#327](https://github.com/nf-core/variantbenchmarking/pull/327) - hap.py now uses a Seqera container that bundles RTG Tools, so `--happy_comparison_engine vcfeval` works without a custom container. The `test_ga4gh` profile now uses the parameter instead of a process override. [#327](https://github.com/nf-core/variantbenchmarking/pull/327) +- Replace nf-core modules TABIX_TABIX, TABIX_BGZIP and TABIX_BGZIPTABIX with HTSLIB_BGZIPTABIX [#328](https://github.com/nf-core/variantbenchmarking/pull/328). ### `Fixed` -- Depreciated HAPPY_PREPY: new versions of happy uses prepy integration, normalization functions for prepy can be provided through happy args. [#316](https://github.com/nf-core/variantbenchmarking/issues/313). +- Deprecated HAPPY_PREPY: new versions of happy uses prepy integration, normalization functions for prepy can be provided through happy args. [#316](https://github.com/nf-core/variantbenchmarking/issues/313). - Fixing metromap to light to dark background. Adding docs/images/metro_map.md to assist future developers to reproduce the metromap. [#316](https://github.com/nf-core/variantbenchmarking/pull/316). - Update happy module to use both -R and -f arguments.[#319](https://github.com/nf-core/variantbenchmarking/pull/319) - Fixing regions_bed vs high_conf_bed confusion.[#319](https://github.com/nf-core/variantbenchmarking/pull/319) @@ -31,13 +32,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | Dependency | Old version | New version | | ------------------ | ----------- | ----------- | -| pigz | 2.8 | depreciated | +| pigz | 2.8 | deprecated | | nf-core | 3.5.1 | 4.1.0 | | prettier | 3.6.2 | 3.8.3 | -| prepy | 0.3.15 | depreciated | -| r-base | 4.1.0 | depreciated | +| prepy | 0.3.15 | deprecated | +| r-base | 4.1.0 | deprecated | | ga4gh-happy-report | - | 0.1.2 | | rtg-tools (hap.py) | - | 3.13 | +| tabix | 1.21 | deprecated | +| htslib | - | 1.24 | +| xz | - | 5.8.3 | ## 1.5.0 diff --git a/conf/modules.config b/conf/modules.config index 19786f58..ee31dacd 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -26,6 +26,21 @@ process { ] } + withName: HTSLIB_BGZIPTABIX { + ext.prefix = { infile.name.replaceAll(/\.vcf\.gz$|\.vcf$|\.gz$/, "") } + publishDir = [ + enabled: false + ] + } + + withName: 'TABIX_BGZIPTABIX*' { + publishDir = [ + path: {"${params.outdir}/${params.variant_type}/${meta.id}/preprocess"}, + pattern: "*{.vcf.gz,vcf.gz.tbi}", + mode: params.publish_dir_mode + ] + } + // subsample_vcf test withName: BCFTOOLS_SORT { @@ -239,12 +254,6 @@ process { ] } - withName: TABIX_TABIX { - publishDir = [ - enabled: false - ] - } - withName: SURVIVOR_FILTER { ext.prefix = { vcf_file.baseName - ".vcf" + ".filter"} publishDir = [ @@ -320,14 +329,6 @@ process { ] } - withName: 'TABIX_BGZIPTABIX*' { - publishDir = [ - path: {"${params.outdir}/${params.variant_type}/${meta.id}/preprocess"}, - pattern: "*{.vcf.gz,vcf.gz.tbi}", - mode: params.publish_dir_mode - ] - } - withName: BCFTOOLS_SORT_SV { ext.prefix = { vcf.baseName - ".vcf" + ".sort"} ext.args = {"--output-type z --write-index=tbi" } @@ -565,19 +566,6 @@ process { ] } - withName: "TABIX_BGZIP*"{ - ext.prefix = {input.toString() - ".vcf.gz"} - publishDir = [ - enabled: false - ] - } - withName: "TABIX_BGZIPTABIX*"{ - ext.prefix = { input.baseName } - publishDir = [ - enabled: false - ] - } - withName: BCFTOOLS_VIEW_TRUTH { ext.prefix = { vcf.baseName - ".vcf" + ".truth" } ext.args = {"--output-type z --write-index=tbi -s TRUTH" } @@ -684,13 +672,6 @@ process { // compare_benchmark_results - withName: TABIX_BGZIP_UNZIP{ - ext.prefix = {input.toString() - ".vcf.gz"} - publishDir = [ - enabled: false - ] - } - withName: PLOTS_SVLEN_DIST { ext.prefix = {"${meta.id}.${meta.tag}"} publishDir = [ diff --git a/main.nf b/main.nf index 0c71d342..187e9281 100644 --- a/main.nf +++ b/main.nf @@ -16,8 +16,8 @@ */ include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_variantbenchmarking_pipeline' -params.fasta = getGenomeAttribute('fasta') -params.fai = getGenomeAttribute('fai') +params.fasta = getGenomeAttribute('fasta') +params.fai = getGenomeAttribute('fai') params.dictionary = getGenomeAttribute('dict') /* @@ -38,7 +38,6 @@ include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_vari // WORKFLOW: Run main nf-core/variantbenchmarking analysis pipeline workflow NFCORE_VARIANTBENCHMARKING { - take: samplesheet @@ -47,13 +46,14 @@ workflow NFCORE_VARIANTBENCHMARKING { // // WORKFLOW: Run pipeline // - VARIANTBENCHMARKING ( + VARIANTBENCHMARKING( samplesheet, params.multiqc_config, params.multiqc_logo, params.multiqc_methods_description, params.outdir, ) + emit: multiqc_report = VARIANTBENCHMARKING.out.multiqc_report // channel: /path/to/multiqc_report.html } @@ -65,12 +65,10 @@ workflow NFCORE_VARIANTBENCHMARKING { */ workflow { - - main: // // SUBWORKFLOW: Run initialisation tasks // - PIPELINE_INITIALISATION ( + PIPELINE_INITIALISATION( params.version, params.validate_params, params.monochrome_logs, @@ -79,30 +77,24 @@ workflow { params.input, params.help, params.help_full, - params.show_hidden + params.show_hidden, ) // // WORKFLOW: Run main workflow // - NFCORE_VARIANTBENCHMARKING ( + NFCORE_VARIANTBENCHMARKING( PIPELINE_INITIALISATION.out.samplesheet ) // // SUBWORKFLOW: Run completion tasks // - PIPELINE_COMPLETION ( + PIPELINE_COMPLETION( params.email, params.email_on_fail, params.plaintext_email, params.outdir, params.monochrome_logs, - NFCORE_VARIANTBENCHMARKING.out.multiqc_report + NFCORE_VARIANTBENCHMARKING.out.multiqc_report, ) } - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - THE END -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ diff --git a/modules.json b/modules.json index e90975c3..a8b6d845 100644 --- a/modules.json +++ b/modules.json @@ -101,6 +101,11 @@ "git_sha": "4020dbe4bb4a7d71be85bf8f77dbdf6c06fa401f", "installed_by": ["modules"] }, + "htslib/bgziptabix": { + "branch": "master", + "git_sha": "37f69c8ca3eb3d038a5d44f33a329e49f44bd4f2", + "installed_by": ["modules"] + }, "multiqc": { "branch": "master", "git_sha": "98403d15b0e50edae1f3fec5eae5e24982f1fade", @@ -176,21 +181,6 @@ "git_sha": "fdcc3976e728b5d6ffc3f15979905829531e6072", "installed_by": ["modules"] }, - "tabix/bgzip": { - "branch": "master", - "git_sha": "91a902fb32d6717da38a9694eb4ad3fade53a8db", - "installed_by": ["modules"] - }, - "tabix/bgziptabix": { - "branch": "master", - "git_sha": "91a902fb32d6717da38a9694eb4ad3fade53a8db", - "installed_by": ["modules"] - }, - "tabix/tabix": { - "branch": "master", - "git_sha": "524a7d5ef99a0cbfb4feec8bf7062eb6a531931a", - "installed_by": ["modules"] - }, "truvari/bench": { "branch": "master", "git_sha": "fb32a7ee01805151ef9355fdee4bf035c727de24", diff --git a/modules/nf-core/tabix/bgzip/environment.yml b/modules/nf-core/htslib/bgziptabix/environment.yml similarity index 77% rename from modules/nf-core/tabix/bgzip/environment.yml rename to modules/nf-core/htslib/bgziptabix/environment.yml index 771b1387..ec62c057 100644 --- a/modules/nf-core/tabix/bgzip/environment.yml +++ b/modules/nf-core/htslib/bgziptabix/environment.yml @@ -3,6 +3,6 @@ channels: - conda-forge - bioconda - dependencies: - - bioconda::htslib=1.21 + - bioconda::htslib=1.24 + - conda-forge::xz=5.8.3 diff --git a/modules/nf-core/htslib/bgziptabix/main.nf b/modules/nf-core/htslib/bgziptabix/main.nf new file mode 100644 index 00000000..573c05fc --- /dev/null +++ b/modules/nf-core/htslib/bgziptabix/main.nf @@ -0,0 +1,88 @@ +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/86/863ca0dbbba30c8367fa4fbd3fa3a84393532fb7b300a5c5c2e70f0dfc475bbf/data' + : 'community.wave.seqera.io/library/htslib_xz:32f2772a564b3cd2'}" + + input: + tuple val(meta), path(infile), path(infile_tbi), path(regions) + 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 + 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 + + 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 ${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 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} ;; + *gzip-compressed*) + [ "\$(basename ${infile})" == "\$(basename ${outfile})" ] && echo "Input and output names cannot be the same" && exit 1 + bgzip -d -c -@ ${task.cpus} ${infile} | ${compress_cmd} > ${outfile} ;; + *bzip2-compressed*) + bzcat ${infile} | ${compress_cmd} > ${outfile} ;; + *XZ-compressed*) + xzcat ${infile} | ${compress_cmd} > ${outfile} ;; + *) + ${uncompressed_cmd} ;; + 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 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/meta.yml b/modules/nf-core/htslib/bgziptabix/meta.yml new file mode 100644 index 00000000..4cdefd0e --- /dev/null +++ b/modules/nf-core/htslib/bgziptabix/meta.yml @@ -0,0 +1,125 @@ +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' ] + - infile: + type: file + description: Input file to compress or decompress + pattern: "*" + ontologies: [] + - infile_tbi: + type: file + description: Optional tabix index for the input 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` + - 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' ] + - ${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 + 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 + 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}: + 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 + - - ${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: + - "@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 00000000..a7346506 --- /dev/null +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test @@ -0,0 +1,435 @@ +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(sanitizeOutput(process.out)).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(sanitizeOutput(process.out)).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 - 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( + sanitizeOutput(process.out), + path(process.out.output[0][1]).vcf.getVariantsMD5(), + ).match() } + ) + } + } + + 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(sanitizeOutput(process.out)).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(sanitizeOutput(process.out)).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(sanitizeOutput(process.out)).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(sanitizeOutput(process.out)).match() }, + { assert process.out.output.get(0).get(1).endsWith('.fastq.gz') }, + { assert process.out.index.size() == 0 } + ) + } + } + + 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 { + 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(sanitizeOutput(process.out)).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(sanitizeOutput(process.out)).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(sanitizeOutput(process.out)).match() }, + { assert process.out.output.get(0).get(1).endsWith('.gz') }, + { assert process.out.index.size() == 0 } + ) + } + } + + test("sarscov2 - vcf - compress - 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] = true // make_index + input[3] = 'vcf' // out_ext + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot(sanitizeOutput(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(sanitizeOutput(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 00000000..4d8b3d25 --- /dev/null +++ b/modules/nf-core/htslib/bgziptabix/tests/main.nf.test.snap @@ -0,0 +1,527 @@ +{ + "sarscov2 - gzip - (re)compress - no index": { + "content": [ + { + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.fastq.gz:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:07:32.981182", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "metagenome - xz - (re)compress - no index": { + "content": [ + { + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.gz:md5,b8d852a2b1ee52ed64d83046dcdb9de2" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:08:57.748138", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "metagenome - bz2 - decompress": { + "content": [ + { + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.tar:md5,39e9e71fd16cfd09ceca12cd46e6abce" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:07:44.215383", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "sarscov2 - vcf - decompress - stub": { + "content": [ + { + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:10:11.941036", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "sarscov2 - gzip - decompress": { + "content": [ + { + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.fastq:md5,4161df271f9bfcd25d5845a1e220dbec" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:07:28.301585", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "sarscov2 - vcf - compress - index - stub": { + "content": [ + { + "index": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:09:24.961486", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "sarscov2 - vcf - decompress": { + "content": [ + { + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:07:05.41219", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "metagenome - bz2 - (re)compress - no index": { + "content": [ + { + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.tar.gz:md5,39e9e71fd16cfd09ceca12cd46e6abce" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:07:51.772557", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "sarscov2 - vcf - compress - index": { + "content": [ + { + "index": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,7f005943c935f2b55ba3f9d4802aa09f" + ] + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:07:09.68169", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "metagenome - xz - decompress": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test:md5,b8d852a2b1ee52ed64d83046dcdb9de2" + ] + ], + "1": [ + + ], + "2": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "3": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ], + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test:md5,b8d852a2b1ee52ed64d83046dcdb9de2" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + }, + { + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:08:19.920765", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "sarscov2 - bgzip - compress - no index": { + "content": [ + { + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:07:23.405306", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "sarscov2 - vcf + regions - compress - index": { + "content": [ + { + "index": [ + [ + { + "id": "example" + }, + "example.vcf.gz.tbi:md5,d22e5b84e4fcd18792179f72e6da702e" + ] + ], + "output": [ + [ + { + "id": "example" + }, + "example.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + }, + "bc7bf3ee9e8430e064c539eb81e59bf9" + ], + "timestamp": "2026-07-10T08:07:15.187648", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + }, + "sarscov2 - bgzip - decompress": { + "content": [ + { + "index": [ + + ], + "output": [ + [ + { + "id": "test" + }, + "test.vcf:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions_htslib": [ + [ + "HTSLIB_BGZIPTABIX", + "htslib", + "1.24" + ] + ], + "versions_xz": [ + [ + "HTSLIB_BGZIPTABIX", + "xz", + "5.8.3" + ] + ] + } + ], + "timestamp": "2026-07-10T08:07:19.313945", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.6" + } + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/bgzip/main.nf b/modules/nf-core/tabix/bgzip/main.nf deleted file mode 100644 index e80919bf..00000000 --- a/modules/nf-core/tabix/bgzip/main.nf +++ /dev/null @@ -1,48 +0,0 @@ -process TABIX_BGZIP { - tag "$meta.id" - label 'process_single' - - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/92/92859404d861ae01afb87e2b789aebc71c0ab546397af890c7df74e4ee22c8dd/data' : - 'community.wave.seqera.io/library/htslib:1.21--ff8e28a189fbecaa' }" - - input: - tuple val(meta), path(input) - - output: - tuple val(meta), path("${output}"), 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 - - when: - 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} - - """ - - stub: - prefix = task.ext.prefix ?: "${meta.id}" - in_bgzip = ["gz", "bgz", "bgzf"].contains(input.getExtension()) - output = in_bgzip ? input.getBaseName() : "${prefix}.${input.getExtension()}.gz" - - """ - echo "" | gzip > ${output} - touch ${output}.gzi - - """ -} diff --git a/modules/nf-core/tabix/bgzip/meta.yml b/modules/nf-core/tabix/bgzip/meta.yml deleted file mode 100644 index 7b56e897..00000000 --- a/modules/nf-core/tabix/bgzip/meta.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: tabix_bgzip -description: Compresses/decompresses files -keywords: - - compress - - decompress - - bgzip - - tabix -tools: - - bgzip: - description: | - Bgzip compresses or decompresses files in a similar manner to, and compatible with, gzip. - homepage: https://www.htslib.org/doc/tabix.html - documentation: http://www.htslib.org/doc/bgzip.html - doi: 10.1093/bioinformatics/btp352 - licence: ["MIT"] - identifier: biotools:tabix -input: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: file to compress or to decompress - ontologies: [] -output: - output: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - ${output}: - type: file - description: Output compressed/decompressed file - pattern: "*." - ontologies: [] - gzi: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.gzi": - type: file - description: Optional gzip index file for compressed inputs - pattern: "*.gzi" - ontologies: [] - versions_tabix: - - - ${task.process}: - type: string - description: The process the versions were collected from - - tabix: - type: string - description: The tool name - - tabix -h 2>&1 | grep -oP 'Version:\s*\K[^\s]+': - type: eval - description: The expression to obtain the version of the tool - -topics: - versions: - - - ${task.process}: - type: string - description: The process the versions were collected from - - tabix: - type: string - description: The tool name - - tabix -h 2>&1 | grep -oP 'Version:\s*\K[^\s]+': - type: eval - description: The expression to obtain the version of the tool - -authors: - - "@joseespinosa" - - "@drpatelh" - - "@maxulysse" - - "@nvnieuwk" -maintainers: - - "@joseespinosa" - - "@drpatelh" - - "@maxulysse" - - "@nvnieuwk" diff --git a/modules/nf-core/tabix/bgzip/tests/bgzip_compress.config b/modules/nf-core/tabix/bgzip/tests/bgzip_compress.config deleted file mode 100644 index 6b6ff55f..00000000 --- a/modules/nf-core/tabix/bgzip/tests/bgzip_compress.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - withName: TABIX_BGZIP { - ext.args = ' -i' - } -} diff --git a/modules/nf-core/tabix/bgzip/tests/main.nf.test b/modules/nf-core/tabix/bgzip/tests/main.nf.test deleted file mode 100644 index 00e7c098..00000000 --- a/modules/nf-core/tabix/bgzip/tests/main.nf.test +++ /dev/null @@ -1,111 +0,0 @@ -nextflow_process { - - name "Test Process TABIX_BGZIP" - script "../main.nf" - process "TABIX_BGZIP" - - tag "modules" - tag "modules_nfcore" - tag "tabix" - tag "tabix/bgzip" - - test("sarscov2_vcf_bgzip_compress") { - when { - process { - """ - input[0] = [ - [ id:'bgzip_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.output[0][1]).name - ).match("bgzip_test") - } - ) - } - } - - 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") { - options '-stub' - config "./bgzip_compress.config" - - when { - process { - """ - input[0] = [ - [ id:"test_stub" ], - [ 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.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") - } - ) - } - } -} diff --git a/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap b/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap deleted file mode 100644 index 28388109..00000000 --- a/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap +++ /dev/null @@ -1,250 +0,0 @@ -{ - "gzi_compress_test": { - "content": [ - "gzi_compress_test.vcf.gz.gzi" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" - }, - "timestamp": "2024-02-19T14:52:29.328146" - }, - "homo_genome_bedgz_compress": { - "content": [ - { - "0": [ - [ - { - "id": "bedgz_test" - }, - "bedgz_test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" - ] - ], - "1": [ - - ], - "2": [ - [ - "TABIX_BGZIP", - "tabix", - "1.21" - ] - ], - "gzi": [ - - ], - "output": [ - [ - { - "id": "bedgz_test" - }, - "bedgz_test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" - ] - ], - "versions_tabix": [ - [ - "TABIX_BGZIP", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-01-27T15:05:31.678626" - }, - "test_stub": { - "content": [ - "test_stub.vcf.gz" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" - }, - "timestamp": "2024-02-19T14:52:20.811489" - }, - "sarscov2_vcf_bgzip_compress": { - "content": [ - { - "0": [ - [ - { - "id": "bgzip_test" - }, - "bgzip_test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" - ] - ], - "1": [ - - ], - "2": [ - [ - "TABIX_BGZIP", - "tabix", - "1.21" - ] - ], - "gzi": [ - - ], - "output": [ - [ - { - "id": "bgzip_test" - }, - "bgzip_test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" - ] - ], - "versions_tabix": [ - [ - "TABIX_BGZIP", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-01-27T15:05:27.928712" - }, - "sarscov2_vcf_bgzip_compress_gzi": { - "content": [ - { - "0": [ - [ - { - "id": "gzi_compress_test" - }, - "gzi_compress_test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" - ] - ], - "1": [ - [ - { - "id": "gzi_compress_test" - }, - "gzi_compress_test.vcf.gz.gzi:md5,26fd00d4e26141cd11561f6e7d4a2ad0" - ] - ], - "2": [ - [ - "TABIX_BGZIP", - "tabix", - "1.21" - ] - ], - "gzi": [ - [ - { - "id": "gzi_compress_test" - }, - "gzi_compress_test.vcf.gz.gzi:md5,26fd00d4e26141cd11561f6e7d4a2ad0" - ] - ], - "output": [ - [ - { - "id": "gzi_compress_test" - }, - "gzi_compress_test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" - ] - ], - "versions_tabix": [ - [ - "TABIX_BGZIP", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-01-27T15:05:39.49628" - }, - "bgzip_test": { - "content": [ - "bgzip_test.vcf.gz" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" - }, - "timestamp": "2024-02-19T14:52:03.768295" - }, - "bedgz_test": { - "content": [ - "bedgz_test.bed" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" - }, - "timestamp": "2024-02-19T14:52:12.453855" - }, - "sarscov2_vcf_bgzip_compress_stub": { - "content": [ - { - "0": [ - [ - { - "id": "test_stub" - }, - "test_stub.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ], - "1": [ - [ - { - "id": "test_stub" - }, - "test_stub.vcf.gz.gzi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "2": [ - [ - "TABIX_BGZIP", - "tabix", - "1.21" - ] - ], - "gzi": [ - [ - { - "id": "test_stub" - }, - "test_stub.vcf.gz.gzi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "output": [ - [ - { - "id": "test_stub" - }, - "test_stub.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ], - "versions_tabix": [ - [ - "TABIX_BGZIP", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-01-27T15:05:35.726067" - } -} \ No newline at end of file diff --git a/modules/nf-core/tabix/bgzip/tests/vcf_none.config b/modules/nf-core/tabix/bgzip/tests/vcf_none.config deleted file mode 100644 index f3a3c467..00000000 --- a/modules/nf-core/tabix/bgzip/tests/vcf_none.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - withName: TABIX_BGZIP { - ext.args = '' - } -} diff --git a/modules/nf-core/tabix/bgziptabix/environment.yml b/modules/nf-core/tabix/bgziptabix/environment.yml deleted file mode 100644 index 771b1387..00000000 --- a/modules/nf-core/tabix/bgziptabix/environment.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json -channels: - - conda-forge - - bioconda - -dependencies: - - bioconda::htslib=1.21 diff --git a/modules/nf-core/tabix/bgziptabix/main.nf b/modules/nf-core/tabix/bgziptabix/main.nf deleted file mode 100644 index 30eae745..00000000 --- a/modules/nf-core/tabix/bgziptabix/main.nf +++ /dev/null @@ -1,40 +0,0 @@ -process TABIX_BGZIPTABIX { - tag "$meta.id" - label 'process_single' - - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/92/92859404d861ae01afb87e2b789aebc71c0ab546397af890c7df74e4ee22c8dd/data' : - 'community.wave.seqera.io/library/htslib:1.21--ff8e28a189fbecaa' }" - - input: - tuple val(meta), path(input) - - output: - tuple val(meta), path("*.gz"), path("*.{tbi,csi}"), emit: gz_index - tuple val("${task.process}"), val('tabix'), eval("tabix -h 2>&1 | grep -oP 'Version:\\s*\\K[^\\s]+'") , topic: versions , emit: versions_tabix - tuple val("${task.process}"), val('bgzip'), eval("bgzip --version | sed '1!d;s/.* //'"), topic: versions, emit: versions_bgzip - - when: - 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 - - """ - - 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} - - """ -} diff --git a/modules/nf-core/tabix/bgziptabix/meta.yml b/modules/nf-core/tabix/bgziptabix/meta.yml deleted file mode 100644 index 2a3078c5..00000000 --- a/modules/nf-core/tabix/bgziptabix/meta.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: tabix_bgziptabix -description: bgzip a sorted tab-delimited genome file and then create tabix - index -keywords: - - bgzip - - compress - - index - - tabix - - vcf -tools: - - tabix: - description: Generic indexer for TAB-delimited genome position files. - homepage: https://www.htslib.org/doc/tabix.html - documentation: https://www.htslib.org/doc/tabix.1.html - doi: 10.1093/bioinformatics/btq671 - licence: ["MIT"] - identifier: biotools:tabix -input: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: Sorted tab-delimited genome file - ontologies: [] -output: - gz_index: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.gz": - type: file - description: bgzipped tab-delimited genome file - pattern: "*.gz" - ontologies: - - edam: http://edamontology.org/format_3989 # GZIP format - - "*.{tbi,csi}": - type: file - description: Tabix index file (either tbi or csi) - pattern: "*.{tbi,csi}" - ontologies: [] - versions_tabix: - - - ${task.process}: - type: string - description: The process the versions were collected from - - tabix: - type: string - description: The tool name - - tabix -h 2>&1 | grep -oP 'Version:\s*\K[^\s]+': - type: eval - description: The expression to obtain the version of the tool - versions_bgzip: - - - ${task.process}: - type: string - description: The process the versions were collected from - - bgzip: - type: string - description: The tool name - - bgzip --version | sed '1!d;s/.* //': - type: eval - description: The expression to obtain the version of the tool - -topics: - versions: - - - ${task.process}: - type: string - description: The process the versions were collected from - - tabix: - type: string - description: The tool name - - tabix -h 2>&1 | grep -oP 'Version:\s*\K[^\s]+': - type: eval - description: The expression to obtain the version of the tool - - - ${task.process}: - type: string - description: The process the versions were collected from - - bgzip: - type: string - description: The tool name - - bgzip --version | sed '1!d;s/.* //': - type: eval - description: The expression to obtain the version of the tool - -authors: - - "@maxulysse" - - "@DLBPointon" -maintainers: - - "@maxulysse" - - "@DLBPointon" diff --git a/modules/nf-core/tabix/bgziptabix/tests/main.nf.test b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test deleted file mode 100644 index 1955b143..00000000 --- a/modules/nf-core/tabix/bgziptabix/tests/main.nf.test +++ /dev/null @@ -1,113 +0,0 @@ -nextflow_process { - - name "Test Process TABIX_BGZIPTABIX" - script "../main.nf" - process "TABIX_BGZIPTABIX" - - tag "modules" - tag "modules_nfcore" - tag "tabix" - tag "tabix/bgziptabix" - - config "./nextflow.config" - - test("sarscov2_bed_tbi") { - when { - params { - module_args = '-p vcf' - } - process { - """ - input[0] = [ - [ id:'tbi_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") { - 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") { - options "-stub" - - when { - params { - module_args = '-p vcf' - } - 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() } - ) - } - - } - -} diff --git a/modules/nf-core/tabix/bgziptabix/tests/main.nf.test.snap b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test.snap deleted file mode 100644 index cf3ce8aa..00000000 --- a/modules/nf-core/tabix/bgziptabix/tests/main.nf.test.snap +++ /dev/null @@ -1,230 +0,0 @@ -{ - "sarscov2_bed_tbi": { - "content": [ - { - "0": [ - [ - { - "id": "tbi_test" - }, - "tbi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", - "tbi_test.bed.gz.tbi:md5,ca06caf88b1e3c67d5fcba0a1460b52c" - ] - ], - "1": [ - [ - "TABIX_BGZIPTABIX", - "tabix", - "1.21" - ] - ], - "2": [ - [ - "TABIX_BGZIPTABIX", - "bgzip", - "1.21" - ] - ], - "gz_index": [ - [ - { - "id": "tbi_test" - }, - "tbi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", - "tbi_test.bed.gz.tbi:md5,ca06caf88b1e3c67d5fcba0a1460b52c" - ] - ], - "versions_bgzip": [ - [ - "TABIX_BGZIPTABIX", - "bgzip", - "1.21" - ] - ], - "versions_tabix": [ - [ - "TABIX_BGZIPTABIX", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-01-29T23:36:32.823417" - }, - "sarscov2_bed_csi": { - "content": [ - { - "0": [ - [ - { - "id": "csi_test" - }, - "csi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", - "csi_test.bed.gz.csi:md5,c9c0377de58fdc89672bb3005a0d69f5" - ] - ], - "1": [ - [ - "TABIX_BGZIPTABIX", - "tabix", - "1.21" - ] - ], - "2": [ - [ - "TABIX_BGZIPTABIX", - "bgzip", - "1.21" - ] - ], - "gz_index": [ - [ - { - "id": "csi_test" - }, - "csi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", - "csi_test.bed.gz.csi:md5,c9c0377de58fdc89672bb3005a0d69f5" - ] - ], - "versions_bgzip": [ - [ - "TABIX_BGZIPTABIX", - "bgzip", - "1.21" - ] - ], - "versions_tabix": [ - [ - "TABIX_BGZIPTABIX", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-01-29T23:36:36.715208" - }, - "sarscov2_bed_tbi_stub": { - "content": [ - { - "0": [ - [ - { - "id": "test" - }, - "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - [ - "TABIX_BGZIPTABIX", - "tabix", - "1.21" - ] - ], - "2": [ - [ - "TABIX_BGZIPTABIX", - "bgzip", - "1.21" - ] - ], - "gz_index": [ - [ - { - "id": "test" - }, - "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions_bgzip": [ - [ - "TABIX_BGZIPTABIX", - "bgzip", - "1.21" - ] - ], - "versions_tabix": [ - [ - "TABIX_BGZIPTABIX", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-01-29T23:36:45.016007" - }, - "sarscov2_bed_csi_stub": { - "content": [ - { - "0": [ - [ - { - "id": "test" - }, - "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - [ - "TABIX_BGZIPTABIX", - "tabix", - "1.21" - ] - ], - "2": [ - [ - "TABIX_BGZIPTABIX", - "bgzip", - "1.21" - ] - ], - "gz_index": [ - [ - { - "id": "test" - }, - "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions_bgzip": [ - [ - "TABIX_BGZIPTABIX", - "bgzip", - "1.21" - ] - ], - "versions_tabix": [ - [ - "TABIX_BGZIPTABIX", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.3" - }, - "timestamp": "2026-01-29T23:36:40.5401" - } -} \ No newline at end of file diff --git a/modules/nf-core/tabix/bgziptabix/tests/nextflow.config b/modules/nf-core/tabix/bgziptabix/tests/nextflow.config deleted file mode 100644 index 5b2316c8..00000000 --- a/modules/nf-core/tabix/bgziptabix/tests/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - withName: TABIX_BGZIPTABIX { - ext.args2 = params.module_args - } -} diff --git a/modules/nf-core/tabix/tabix/environment.yml b/modules/nf-core/tabix/tabix/environment.yml deleted file mode 100644 index 771b1387..00000000 --- a/modules/nf-core/tabix/tabix/environment.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json -channels: - - conda-forge - - bioconda - -dependencies: - - bioconda::htslib=1.21 diff --git a/modules/nf-core/tabix/tabix/main.nf b/modules/nf-core/tabix/tabix/main.nf deleted file mode 100644 index c8bcef64..00000000 --- a/modules/nf-core/tabix/tabix/main.nf +++ /dev/null @@ -1,35 +0,0 @@ -process TABIX_TABIX { - tag "$meta.id" - label 'process_single' - - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/92/92859404d861ae01afb87e2b789aebc71c0ab546397af890c7df74e4ee22c8dd/data' : - 'community.wave.seqera.io/library/htslib:1.21--ff8e28a189fbecaa' }" - - input: - tuple val(meta), path(tab) - - output: - tuple val(meta), path("*.{tbi,csi}"), emit: index - 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 ?: '' - """ - tabix \\ - --threads $task.cpus \\ - $args \\ - $tab - - """ - stub: - def args = task.ext.args ?: '' - def index = args.contains("-C ") || args.contains("--csi") ? "csi" : "tbi" - """ - touch ${tab}.${index} - """ -} diff --git a/modules/nf-core/tabix/tabix/meta.yml b/modules/nf-core/tabix/tabix/meta.yml deleted file mode 100644 index f5b6b3c1..00000000 --- a/modules/nf-core/tabix/tabix/meta.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: tabix_tabix -description: create tabix index from a sorted bgzip tab-delimited genome file -keywords: - - index - - tabix - - vcf -tools: - - tabix: - description: Generic indexer for TAB-delimited genome position files. - homepage: https://www.htslib.org/doc/tabix.html - documentation: https://www.htslib.org/doc/tabix.1.html - doi: 10.1093/bioinformatics/btq671 - licence: ["MIT"] - identifier: biotools:tabix -input: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - tab: - type: file - description: TAB-delimited genome position file compressed with bgzip - pattern: "*.{bed.gz,gff.gz,sam.gz,vcf.gz}" - ontologies: [] -output: - index: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.{tbi,csi}": - type: file - description: Tabix index file (either tbi or csi) - pattern: "*.{tbi,csi}" - ontologies: [] - versions_tabix: - - - ${task.process}: - type: string - description: The process the versions were collected from - - tabix: - type: string - description: The tool name - - tabix -h 2>&1 | grep -oP 'Version:\s*\K[^\s]+': - type: eval - description: The expression to obtain the version of the tool - -topics: - versions: - - - ${task.process}: - type: string - description: The process the versions were collected from - - tabix: - type: string - description: The tool name - - tabix -h 2>&1 | grep -oP 'Version:\s*\K[^\s]+': - type: eval - description: The expression to obtain the version of the tool - -authors: - - "@joseespinosa" - - "@drpatelh" - - "@maxulysse" -maintainers: - - "@joseespinosa" - - "@drpatelh" - - "@maxulysse" diff --git a/modules/nf-core/tabix/tabix/tests/main.nf.test b/modules/nf-core/tabix/tabix/tests/main.nf.test deleted file mode 100644 index 19eefab8..00000000 --- a/modules/nf-core/tabix/tabix/tests/main.nf.test +++ /dev/null @@ -1,133 +0,0 @@ -nextflow_process { - - name "Test Process TABIX_TABIX" - script "../main.nf" - process "TABIX_TABIX" - - tag "modules" - tag "modules_nfcore" - tag "tabix" - tag "tabix/tabix" - - config "./nextflow.config" - - test("sarscov2_bedgz_tbi") { - when { - params { - module_args = '-p bed' - } - process { - """ - input[0] = [ - [ id:'tbi_bed' ], - [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed.gz', checkIfExists: true) ] - ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - - 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_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) ] - ] - """ - } - } - - then { - assertAll ( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - } - -} diff --git a/modules/nf-core/tabix/tabix/tests/main.nf.test.snap b/modules/nf-core/tabix/tabix/tests/main.nf.test.snap deleted file mode 100644 index 91a3a66d..00000000 --- a/modules/nf-core/tabix/tabix/tests/main.nf.test.snap +++ /dev/null @@ -1,207 +0,0 @@ -{ - "sarscov2_gff_tbi": { - "content": [ - { - "0": [ - [ - { - "id": "tbi_gff" - }, - "genome.gff3.gz.tbi:md5,f79a67d95a98076e04fbe0455d825926" - ] - ], - "1": [ - [ - "TABIX_TABIX", - "tabix", - "1.21" - ] - ], - "index": [ - [ - { - "id": "tbi_gff" - }, - "genome.gff3.gz.tbi:md5,f79a67d95a98076e04fbe0455d825926" - ] - ], - "versions_tabix": [ - [ - "TABIX_TABIX", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.04.7" - }, - "timestamp": "2025-11-20T13:47:34.055936" - }, - "sarscov2_bedgz_tbi": { - "content": [ - { - "0": [ - [ - { - "id": "tbi_bed" - }, - "test.bed.gz.tbi:md5,9a761d51cc81835fd1199201fdbcdd5d" - ] - ], - "1": [ - [ - "TABIX_TABIX", - "tabix", - "1.21" - ] - ], - "index": [ - [ - { - "id": "tbi_bed" - }, - "test.bed.gz.tbi:md5,9a761d51cc81835fd1199201fdbcdd5d" - ] - ], - "versions_tabix": [ - [ - "TABIX_TABIX", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.04.7" - }, - "timestamp": "2025-11-20T13:47:29.90469" - }, - "sarscov2_vcf_tbi": { - "content": [ - { - "0": [ - [ - { - "id": "tbi_vcf" - }, - "test.vcf.gz.tbi:md5,d22e5b84e4fcd18792179f72e6da702e" - ] - ], - "1": [ - [ - "TABIX_TABIX", - "tabix", - "1.21" - ] - ], - "index": [ - [ - { - "id": "tbi_vcf" - }, - "test.vcf.gz.tbi:md5,d22e5b84e4fcd18792179f72e6da702e" - ] - ], - "versions_tabix": [ - [ - "TABIX_TABIX", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.04.7" - }, - "timestamp": "2025-11-20T13:47:38.044307" - }, - "sarscov2_vcf_csi_stub": { - "content": [ - { - "0": [ - [ - { - "id": "vcf_csi_stub" - }, - "test.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - [ - "TABIX_TABIX", - "tabix", - "1.21" - ] - ], - "index": [ - [ - { - "id": "vcf_csi_stub" - }, - "test.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions_tabix": [ - [ - "TABIX_TABIX", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "25.10.2" - }, - "timestamp": "2025-12-10T14:31:29.90297082" - }, - "sarscov2_vcf_csi": { - "content": [ - { - "0": [ - [ - { - "id": "vcf_csi" - }, - "test.vcf.gz.csi:md5,04b41c1efd9ab3c6b1e008a286e27d2b" - ] - ], - "1": [ - [ - "TABIX_TABIX", - "tabix", - "1.21" - ] - ], - "index": [ - [ - { - "id": "vcf_csi" - }, - "test.vcf.gz.csi:md5,04b41c1efd9ab3c6b1e008a286e27d2b" - ] - ], - "versions_tabix": [ - [ - "TABIX_TABIX", - "tabix", - "1.21" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.04.7" - }, - "timestamp": "2025-11-20T13:47:42.013054" - } -} \ No newline at end of file diff --git a/modules/nf-core/tabix/tabix/tests/nextflow.config b/modules/nf-core/tabix/tabix/tests/nextflow.config deleted file mode 100644 index 96685ef2..00000000 --- a/modules/nf-core/tabix/tabix/tests/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - withName: TABIX_TABIX { - ext.args = params.module_args - } -} diff --git a/subworkflows/local/aardvark_benchmark/main.nf b/subworkflows/local/aardvark_benchmark/main.nf index 5eff498f..317a3406 100644 --- a/subworkflows/local/aardvark_benchmark/main.nf +++ b/subworkflows/local/aardvark_benchmark/main.nf @@ -2,9 +2,9 @@ // AARDVARK_BENCHMARK: SUBWORKFLOW FOR BENCHMARKING WITH AARDVARK // -include { AARDVARK_COMPARE } from '../../../modules/nf-core/aardvark/compare' -include { BCFTOOLS_REHEADER } from '../../../modules/nf-core/bcftools/reheader' -include { TABIX_TABIX } from '../../../modules/nf-core/tabix/tabix' +include { AARDVARK_COMPARE } from '../../../modules/nf-core/aardvark/compare' +include { BCFTOOLS_REHEADER } from '../../../modules/nf-core/bcftools/reheader' +include { HTSLIB_BGZIPTABIX } from '../../../modules/nf-core/htslib/bgziptabix' include { BCFTOOLS_FILTER as BCFTOOLS_FILTER_TRUTH_TP } from '../../../modules/nf-core/bcftools/filter' include { BCFTOOLS_FILTER as BCFTOOLS_FILTER_TRUTH_FN } from '../../../modules/nf-core/bcftools/filter' include { BCFTOOLS_FILTER as BCFTOOLS_FILTER_QUERY_TP } from '../../../modules/nf-core/bcftools/filter' @@ -13,9 +13,9 @@ include { BCFTOOLS_FILTER as BCFTOOLS_FILTER_QUERY_FP } from '../../../modules/n workflow AARDVARK_BENCHMARK { take: - input_ch // channel: [val(meta), test_vcf, test_index, truth_vcf, truth_index, regionsbed, targetsbed ] - fasta // reference channel [val(meta), ref.fa] - fai // reference channel [val(meta), ref.fa.fai] + input_ch // channel: [val(meta), test_vcf, test_index, truth_vcf, truth_index, regionsbed, targetsbed ] + fasta // reference channel [val(meta), ref.fa] + fai // reference channel [val(meta), ref.fa.fai] stratification_bed // reference channel [val(meta), bed files] stratification_tsv // reference channel [val(meta), tsv] @@ -27,22 +27,22 @@ workflow AARDVARK_BENCHMARK { input_ch, fasta, stratification_bed, - stratification_tsv + stratification_tsv, ) AARDVARK_COMPARE.out.summary - .map { _meta, summary -> tuple([vartype: params.variant_type] + [benchmark_tool: "aardvark"], summary) } - .groupTuple() - .map { meta, files -> tuple(meta, files.flatten()) } - .set { summary_reports } + .map { _meta, summary -> tuple([vartype: params.variant_type] + [benchmark_tool: "aardvark"], summary) } + .groupTuple() + .map { meta, files -> tuple(meta, files.flatten()) } + .set { summary_reports } // Filter TP/FN from labelled_truth // reheader truth vcf with query names to enable comparisons better for plotting BCFTOOLS_REHEADER( - AARDVARK_COMPARE.out.labelled_truth.map{ meta, vcf -> - [ meta, vcf, [], [] ] + AARDVARK_COMPARE.out.labelled_truth.map { meta, vcf -> + [meta, vcf, [], []] }, - fai + fai, ) BCFTOOLS_FILTER_TRUTH_TP( @@ -64,12 +64,19 @@ workflow AARDVARK_BENCHMARK { .set { vcf_fn } // Filter TP/FP from labelled_query - TABIX_TABIX( - AARDVARK_COMPARE.out.labelled_query + HTSLIB_BGZIPTABIX( + AARDVARK_COMPARE.out.labelled_query.map { meta, vcf -> [meta, vcf, [], []] }, + 'compress', + true, + 'bgzip.vcf', ) + HTSLIB_BGZIPTABIX.out.output + .join(HTSLIB_BGZIPTABIX.out.index, failOnDuplicate: true, failOnMismatch: true) + .set { labelled_query_indexed } + BCFTOOLS_FILTER_QUERY_TP( - AARDVARK_COMPARE.out.labelled_query.join(TABIX_TABIX.out.index) + labelled_query_indexed ) BCFTOOLS_FILTER_QUERY_TP.out.vcf @@ -78,7 +85,7 @@ workflow AARDVARK_BENCHMARK { .set { vcf_tp_base } BCFTOOLS_FILTER_QUERY_FP( - AARDVARK_COMPARE.out.labelled_query.join(TABIX_TABIX.out.index) + labelled_query_indexed ) BCFTOOLS_FILTER_QUERY_FP.out.vcf @@ -90,11 +97,10 @@ workflow AARDVARK_BENCHMARK { vcf_fn, vcf_fp, vcf_tp_base, - vcf_tp_comp + vcf_tp_comp, ) emit: summary_reports // channel: [val(meta), reports] tagged_variants // channel: [val(meta), vcfs] - } diff --git a/subworkflows/local/aardvark_benchmark/tests/main.nf.test b/subworkflows/local/aardvark_benchmark/tests/main.nf.test index a1a3fc13..bf8d94f1 100644 --- a/subworkflows/local/aardvark_benchmark/tests/main.nf.test +++ b/subworkflows/local/aardvark_benchmark/tests/main.nf.test @@ -12,6 +12,8 @@ nextflow_workflow { tag "bcftools" tag "bcftools/reheader" tag "bcftools/filter" + tag "htslib" + tag "htslib/bgziptabix" test("homo_sapiens - illumina - aardvark benchmark") { @@ -30,8 +32,7 @@ nextflow_workflow { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true), - [] // targets bed + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) // regions bed ]) input[1] = Channel.of([ [ id:'test_ref' ], @@ -86,8 +87,7 @@ nextflow_workflow { file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz.tbi', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true), - [] // targets bed + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) // regions bed ]) input[1] = Channel.of([ [ id:'test_ref' ], diff --git a/subworkflows/local/aardvark_benchmark/tests/main.nf.test.snap b/subworkflows/local/aardvark_benchmark/tests/main.nf.test.snap index db1b0b9b..a0268cbc 100644 --- a/subworkflows/local/aardvark_benchmark/tests/main.nf.test.snap +++ b/subworkflows/local/aardvark_benchmark/tests/main.nf.test.snap @@ -18,7 +18,7 @@ "tag": "FP", "id": "aardvark" }, - "test.HG002.gatk.query.filter.vcf.gz", + "test.HG002.gatk.query.bgzip.filter.vcf.gz", "VcfFile [chromosomes=[], sampleCount=1, variantCount=0, phased=true, phasedAutodetect=true]", "d41d8cd98f00b204e9800998ecf8427e" ], @@ -28,7 +28,7 @@ "tag": "TP_base", "id": "aardvark" }, - "test.HG002.gatk.query.filter.vcf.gz", + "test.HG002.gatk.query.bgzip.filter.vcf.gz", "VcfFile [chromosomes=[chr21], sampleCount=1, variantCount=737, phased=false, phasedAutodetect=false]", "f0673c99f58b46ff264ff39bc3bdada2" ], @@ -56,10 +56,10 @@ } ], - "timestamp": "2026-07-15T10:58:30.357693637", + "timestamp": "2026-10-02T11:09:16.053963553", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } }, "homo_sapiens - illumina - aardvark benchmark - stub": { @@ -92,8 +92,8 @@ "tag": "FP", "id": "aardvark" }, - "test.HG002.gatk.query.filter.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test.HG002.gatk.query.filter.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.HG002.gatk.query.bgzip.filter.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.HG002.gatk.query.bgzip.filter.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ], [ { @@ -101,8 +101,8 @@ "tag": "TP_base", "id": "aardvark" }, - "test.HG002.gatk.query.filter.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test.HG002.gatk.query.filter.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.HG002.gatk.query.bgzip.filter.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.HG002.gatk.query.bgzip.filter.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ], [ { @@ -141,8 +141,8 @@ "tag": "FP", "id": "aardvark" }, - "test.HG002.gatk.query.filter.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test.HG002.gatk.query.filter.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.HG002.gatk.query.bgzip.filter.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.HG002.gatk.query.bgzip.filter.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ], [ { @@ -150,8 +150,8 @@ "tag": "TP_base", "id": "aardvark" }, - "test.HG002.gatk.query.filter.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test.HG002.gatk.query.filter.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.HG002.gatk.query.bgzip.filter.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.HG002.gatk.query.bgzip.filter.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ], [ { @@ -165,10 +165,10 @@ ] } ], - "timestamp": "2026-07-15T11:00:43.877483911", + "timestamp": "2026-10-02T11:09:36.651408441", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } } } \ No newline at end of file diff --git a/subworkflows/local/compare_benchmark_results/main.nf b/subworkflows/local/compare_benchmark_results/main.nf index 3a918a4f..9f00429c 100644 --- a/subworkflows/local/compare_benchmark_results/main.nf +++ b/subworkflows/local/compare_benchmark_results/main.nf @@ -1,16 +1,15 @@ - // // COMPARE_BENCHMARK_RESULTS: SUBWORKFLOW to merge TP/FP/FN results from different tools. // -include { GAWK as REFORMAT_HEADER } from '../../../modules/nf-core/gawk' -include { TABIX_BGZIP as TABIX_BGZIP_UNZIP } from '../../../modules/nf-core/tabix/bgzip' -include { TABIX_BGZIPTABIX } from '../../../modules/nf-core/tabix/bgziptabix' -include { BCFTOOLS_MERGE } from '../../../modules/nf-core/bcftools/merge' -include { SURVIVOR_MERGE } from '../../../modules/nf-core/survivor/merge' -include { VCF_TO_CSV } from '../../../modules/local/custom/vcf_to_csv' -include { SOMPY_FEATURES_MERGE } from '../../../modules/local/sompy_features/merge' -include { PLOTS_UPSET } from '../../../modules/local/plots/upset' +include { GAWK as REFORMAT_HEADER } from '../../../modules/nf-core/gawk' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIP_UNZIP } from '../../../modules/nf-core/htslib/bgziptabix' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIPTABIX } from '../../../modules/nf-core/htslib/bgziptabix' +include { BCFTOOLS_MERGE } from '../../../modules/nf-core/bcftools/merge' +include { SURVIVOR_MERGE } from '../../../modules/nf-core/survivor/merge' +include { VCF_TO_CSV } from '../../../modules/local/custom/vcf_to_csv' +include { SOMPY_FEATURES_MERGE } from '../../../modules/local/sompy_features/merge' +include { PLOTS_UPSET } from '../../../modules/local/plots/upset' workflow COMPARE_BENCHMARK_RESULTS { @@ -22,40 +21,49 @@ workflow COMPARE_BENCHMARK_RESULTS { main: merged_vcfs = channel.empty() - ch_plots = channel.empty() + ch_plots = channel.empty() - if (params.variant_type == "small" || params.variant_type == "snv" || params.variant_type == "indel"){ + if (params.variant_type == "small" || params.variant_type == "snv" || params.variant_type == "indel") { // Small Variants REFORMAT_HEADER( evaluations.map { meta, vcf, _tbi -> [meta, vcf] }, [], - false + false, ) + // meta is shared by all test vcfs of a tool and tag, add the file name so each vcf joins with its own index TABIX_BGZIPTABIX( - REFORMAT_HEADER.out.output + REFORMAT_HEADER.out.output.map { meta, vcf -> [meta, vcf, [], []] }, + 'compress', + true, + 'vcf' ) // merge small variants BCFTOOLS_MERGE( - TABIX_BGZIPTABIX.out.gz_index.groupTuple(), + TABIX_BGZIPTABIX.out.output + .join(TABIX_BGZIPTABIX.out.index, failOnMismatch: true) + .groupTuple(), fasta, fai, - [[],[]] + [[], []], ) merged_vcfs = merged_vcfs.mix(BCFTOOLS_MERGE.out.vcf) } - else{ + else { // SV part // unzip vcfs TABIX_BGZIP_UNZIP( - evaluations.map { item -> tuple(item[0], item[1]) } + evaluations.map { meta, vcf -> [meta, vcf, [], []] }, + 'decompress', + false, + 'vcf', ) TABIX_BGZIP_UNZIP.out.output .groupTuple() - .set{vcf_ch} + .set { vcf_ch } // Merge Benchmark SVs from different tools SURVIVOR_MERGE( @@ -65,10 +73,9 @@ workflow COMPARE_BENCHMARK_RESULTS { 1, 0, 0, - 30 + 30, ) merged_vcfs = merged_vcfs.mix(SURVIVOR_MERGE.out.vcf) - } // convert vcf files to csv @@ -80,13 +87,15 @@ workflow COMPARE_BENCHMARK_RESULTS { evaluations_csv.groupTuple() ) - if (!params.skip_plots.contains("upset")){ - VCF_TO_CSV.out.output.mix(SOMPY_FEATURES_MERGE.out.output).map{ - meta, csv -> + if (!params.skip_plots.contains("upset")) { + VCF_TO_CSV.out.output + .mix(SOMPY_FEATURES_MERGE.out.output) + .map { meta, csv -> def newMeta = meta.clone() newMeta.remove('tag') - tuple(newMeta,csv) - }.set{upset_input} + tuple(newMeta, csv) + } + .set { upset_input } PLOTS_UPSET( upset_input.groupTuple() @@ -95,7 +104,6 @@ workflow COMPARE_BENCHMARK_RESULTS { } emit: - merged_vcfs // channel: [val(meta), vcf] - ch_plots // channel: [val(meta), .html] - + merged_vcfs // channel: [val(meta), vcf] + ch_plots // channel: [val(meta), .html] } diff --git a/subworkflows/local/compare_benchmark_results/tests/main.nf.test b/subworkflows/local/compare_benchmark_results/tests/main.nf.test index bb1ef102..51910274 100644 --- a/subworkflows/local/compare_benchmark_results/tests/main.nf.test +++ b/subworkflows/local/compare_benchmark_results/tests/main.nf.test @@ -8,8 +8,7 @@ nextflow_workflow { tag "subworkflows_compare_benchmark_results" tag "subworkflows/compare_benchmark_results" tag "gawk" - tag "tabix/bgzip" - tag "tabix/bgziptabix" + tag "htslib/bgziptabix" tag "bcftools/merge" tag "survivor/merge" tag "vcf_to_csv" diff --git a/subworkflows/local/ensemble_test_vcfs/main.nf b/subworkflows/local/ensemble_test_vcfs/main.nf index fe506ea5..5ee3b292 100644 --- a/subworkflows/local/ensemble_test_vcfs/main.nf +++ b/subworkflows/local/ensemble_test_vcfs/main.nf @@ -1,64 +1,70 @@ - // // ENSEMBLE_TEST_VCFS: SUBWORKFLOW to ENSEMBLE TEST VCFS and PREPARE TRUTH VCF. // -include { TABIX_BGZIPTABIX as TABIX_BGZIPTABIX_SMALL } from '../../../modules/nf-core/tabix/bgziptabix' -include { TABIX_BGZIPTABIX as TABIX_BGZIPTABIX_GT } from '../../../modules/nf-core/tabix/bgziptabix' -include { BCFTOOLS_MERGE as BCFTOOLS_ENSEMBLE } from '../../../modules/nf-core/bcftools/merge' -include { SURVIVOR_MERGE as SURVIVOR_ENSEMBLE } from '../../../modules/nf-core/survivor/merge' -include { BCFTOOLS_VIEW as FILTER_MAJORITY } from '../../../modules/nf-core/bcftools/view' -include { GAWK as REFORMAT_TRUTH } from '../../../modules/nf-core/gawk' -include { GAWK as REFORMAT_TRUTH_SV } from '../../../modules/nf-core/gawk' -include { GAWK as INJECT_MISSING_GT } from '../../../modules/nf-core/gawk' -include { BCFTOOLS_SORT as BCFTOOLS_SORT_SV } from '../../../modules/nf-core/bcftools/sort' -include { TABIX_BGZIP as TABIX_BGZIP_UNZIP } from '../../../modules/nf-core/tabix/bgzip' -include { BCFTOOLS_ANNOTATE as BCFTOOLS_UNIFY_HEADER } from '../../../modules/nf-core/bcftools/annotate' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIPTABIX_SMALL } from '../../../modules/nf-core/htslib/bgziptabix' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIPTABIX_GT } from '../../../modules/nf-core/htslib/bgziptabix' +include { BCFTOOLS_MERGE as BCFTOOLS_ENSEMBLE } from '../../../modules/nf-core/bcftools/merge' +include { SURVIVOR_MERGE as SURVIVOR_ENSEMBLE } from '../../../modules/nf-core/survivor/merge' +include { BCFTOOLS_VIEW as FILTER_MAJORITY } from '../../../modules/nf-core/bcftools/view' +include { GAWK as REFORMAT_TRUTH } from '../../../modules/nf-core/gawk' +include { GAWK as REFORMAT_TRUTH_SV } from '../../../modules/nf-core/gawk' +include { GAWK as INJECT_MISSING_GT } from '../../../modules/nf-core/gawk' +include { BCFTOOLS_SORT as BCFTOOLS_SORT_SV } from '../../../modules/nf-core/bcftools/sort' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIP_UNZIP } from '../../../modules/nf-core/htslib/bgziptabix' +include { BCFTOOLS_ANNOTATE as BCFTOOLS_UNIFY_HEADER } from '../../../modules/nf-core/bcftools/annotate' workflow ENSEMBLE_TEST_VCFS { take: - test_vcfs // channel: [val(meta), vcf.gz, index] - fasta // reference channel [val(meta), ref.fa] - fai // reference channel [val(meta), ref.fa.fai] + test_vcfs // channel: [val(meta), vcf.gz, index] + fasta // reference channel [val(meta), ref.fa] + fai // reference channel [val(meta), ref.fa.fai] main: // unify header for callers BCFTOOLS_UNIFY_HEADER( - test_vcfs.map{meta, vcf, index -> [meta, vcf, index, [], []]}, - [],[],[] + test_vcfs.map { meta, vcf, index -> [meta, vcf, index, [], []] }, + [], + [], + [], ) // if the benchmarking method is rtgtools, missing GT field is already filled in VCF preperation step, so no need to inject missing GT field - BCFTOOLS_UNIFY_HEADER.out.vcf.join(BCFTOOLS_UNIFY_HEADER.out.tbi).branch { meta, _vcf, _index -> - def is_rtg = params.method?.contains("rtgtools") - def is_strelka_manta = ['strelka', 'manta'].contains(meta.caller.toLowerCase()) - def is_somatic = params.analysis == "somatic" - - missing_gt: is_strelka_manta && is_somatic && !is_rtg - other: true - }.set { branched_vcfs } + BCFTOOLS_UNIFY_HEADER.out.vcf + .join(BCFTOOLS_UNIFY_HEADER.out.tbi) + .branch { meta, _vcf, _index -> + def is_rtg = params.method?.contains("rtgtools") + def is_strelka_manta = ['strelka', 'manta'].contains(meta.caller.toLowerCase()) + def is_somatic = params.analysis == "somatic" + missing_gt: is_strelka_manta && is_somatic && !is_rtg + other: true + } + .set { branched_vcfs } // Run the injection process ONLY on strelka INJECT_MISSING_GT( branched_vcfs.missing_gt.map { meta, vcf, _index -> tuple(meta, vcf) }, [], - false + false, ) - if (params.variant_type == "small" || params.variant_type == "snv" || params.variant_type == "indel"){ + if (params.variant_type == "small" || params.variant_type == "snv" || params.variant_type == "indel") { TABIX_BGZIPTABIX_GT( - INJECT_MISSING_GT.out.output + INJECT_MISSING_GT.out.output.map { meta, vcf -> [meta, vcf, [], []] }, + 'compress', + true, + 'vcf', ) ch_ready_for_merge = branched_vcfs.other.mix( - TABIX_BGZIPTABIX_GT.out.gz_index + TABIX_BGZIPTABIX_GT.out.output.join(TABIX_BGZIPTABIX_GT.out.index, failOnDuplicate: true, failOnMismatch: true) ) // drop meta information from vcf test samples ch_test_vcfs = ch_ready_for_merge.map { _meta, vcf, index -> - [ [id: 'truth'], vcf, index ] + [[id: 'truth'], vcf, index] } // merge small variants @@ -66,12 +72,12 @@ workflow ENSEMBLE_TEST_VCFS { ch_test_vcfs.groupTuple(), fasta, fai, - [[],[]] + [[], []], ) FILTER_MAJORITY( BCFTOOLS_ENSEMBLE.out.vcf.join(BCFTOOLS_ENSEMBLE.out.index), - [], //regions + [], [], [], ) @@ -79,29 +85,35 @@ workflow ENSEMBLE_TEST_VCFS { REFORMAT_TRUTH( FILTER_MAJORITY.out.vcf, [], - false + false, ) TABIX_BGZIPTABIX_SMALL( - REFORMAT_TRUTH.out.output + REFORMAT_TRUTH.out.output.map { meta, vcf -> [meta, vcf, [], []] }, + 'compress', + true, + 'vcf', ) - truth_vcf = TABIX_BGZIPTABIX_SMALL.out.gz_index - + truth_vcf = TABIX_BGZIPTABIX_SMALL.out.output.join(TABIX_BGZIPTABIX_SMALL.out.index, failOnDuplicate: true, failOnMismatch: true) } - else{ + else { // Merge SV variants TABIX_BGZIP_UNZIP( - branched_vcfs.other.map { meta, vcf, _index -> tuple(meta, vcf) } + branched_vcfs.other.map { meta, vcf, _index -> [meta, vcf, [], []] }, + 'decompress', + false, + 'vcf', ) - TABIX_BGZIP_UNZIP.out.output.mix(INJECT_MISSING_GT.out.output) - .set{vcf_ch} + TABIX_BGZIP_UNZIP.out.output + .mix(INJECT_MISSING_GT.out.output) + .set { vcf_ch } // drop meta information from vcf test samples ch_test_vcfs = vcf_ch.map { _meta, vcf -> - [ [id: 'truth'], vcf ] + [[id: 'truth'], vcf] } // Dynamically calculate the minimum callers based on the number of files @@ -110,25 +122,24 @@ workflow ENSEMBLE_TEST_VCFS { ch_test_vcfs.groupTuple(), 10000, 1, - params.ensemble_truth , + params.ensemble_truth, 0, 0, - params.min_sv_size + params.min_sv_size, ) REFORMAT_TRUTH_SV( SURVIVOR_ENSEMBLE.out.vcf, [], - false + false, ) BCFTOOLS_SORT_SV( REFORMAT_TRUTH_SV.out.output ) truth_vcf = BCFTOOLS_SORT_SV.out.vcf.join(BCFTOOLS_SORT_SV.out.tbi) - } - emit: - truth_vcf // channel: [val(meta), vcf.gz, index] + emit: + truth_vcf // channel: [val(meta), vcf.gz, index] } diff --git a/subworkflows/local/ensemble_test_vcfs/tests/main.nf.test b/subworkflows/local/ensemble_test_vcfs/tests/main.nf.test index b60eb930..beaa88a1 100644 --- a/subworkflows/local/ensemble_test_vcfs/tests/main.nf.test +++ b/subworkflows/local/ensemble_test_vcfs/tests/main.nf.test @@ -14,9 +14,8 @@ nextflow_workflow { tag "survivor" tag "survivor/merge" tag "gawk" - tag "tabix" - tag "tabix/bgzip" - tag "tabix/bgziptabix" + tag "htslib" + tag "htslib/bgziptabix" test("ensemble small variants") { diff --git a/subworkflows/local/ensemble_test_vcfs/tests/main.nf.test.snap b/subworkflows/local/ensemble_test_vcfs/tests/main.nf.test.snap index c65f2018..9067c49f 100644 --- a/subworkflows/local/ensemble_test_vcfs/tests/main.nf.test.snap +++ b/subworkflows/local/ensemble_test_vcfs/tests/main.nf.test.snap @@ -16,10 +16,10 @@ } ], - "timestamp": "2026-03-25T10:09:43.423481154", + "timestamp": "2026-10-01T13:29:11.197619509", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } }, "ensemble structural variants": { @@ -68,10 +68,10 @@ ] } ], - "timestamp": "2026-03-19T12:33:07.154776978", + "timestamp": "2026-10-01T13:29:42.532863474", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } } } \ No newline at end of file diff --git a/subworkflows/local/intersect_statistics/main.nf b/subworkflows/local/intersect_statistics/main.nf index bfbb0317..c5fbabd5 100644 --- a/subworkflows/local/intersect_statistics/main.nf +++ b/subworkflows/local/intersect_statistics/main.nf @@ -2,35 +2,35 @@ // INTERSECTION ANALYSIS OF BED FILES // -include { BEDTOOLS_INTERSECT_BENCH } from '../../../modules/local/custom/bedtools_intersect_bench' -include { SVTK_VCF2BED } from '../../../modules/nf-core/svtk/vcf2bed' -include { BEDOPS_CONVERT2BED } from '../../../modules/nf-core/bedops/convert2bed' -include { TABIX_BGZIP } from '../../../modules/nf-core/tabix/bgzip' +include { BEDTOOLS_INTERSECT_BENCH } from '../../../modules/local/custom/bedtools_intersect_bench' +include { SVTK_VCF2BED } from '../../../modules/nf-core/svtk/vcf2bed' +include { BEDOPS_CONVERT2BED } from '../../../modules/nf-core/bedops/convert2bed' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIP } from '../../../modules/nf-core/htslib/bgziptabix' workflow INTERSECT_STATISTICS { take: - test // channel: [val(meta), vcf, regions] - truth_regions // channel: [truth bed] + test // channel: [val(meta), vcf, regions] + truth_regions // channel: [truth bed] main: - test.branch { input -> - def meta = input[0] - def vcf_file = input[1] - def regions_file = input[2] - - regions: regions_file.extension != "tbi" - vcf: vcf_file - other: false - } - .set { test_samples } + test + .branch { input -> + def meta = input[0] + def vcf_file = input[1] + def regions_file = input[2] + regions: regions_file.extension != "tbi" + vcf: vcf_file + other: false + } + .set { test_samples } test_samples.regions - .map{meta, _vcf, bed -> [meta, bed]} - .set{test_beds_ch} + .map { meta, _vcf, bed -> [meta, bed] } + .set { test_beds_ch } // convert VCF files to BED format - if (params.variant_type == "structural" || params.variant_type == "copynumber"){ + if (params.variant_type == "structural" || params.variant_type == "copynumber") { SVTK_VCF2BED( test_samples.vcf ) @@ -38,16 +38,18 @@ workflow INTERSECT_STATISTICS { // collect summary reports SVTK_VCF2BED.out.bed .map { meta, bed -> tuple(meta + [converted: true], bed) } - .set{ converted_beds } + .set { converted_beds } test_beds_ch = test_beds_ch.mix(converted_beds) - } - if (params.variant_type == "small" || params.variant_type == "snv" || params.variant_type == "indel"){ + if (params.variant_type == "small" || params.variant_type == "snv" || params.variant_type == "indel") { // unzip vcf.gz file TABIX_BGZIP( - test_samples.vcf.map { meta, vcf, _tbi->[ meta, vcf ]} + test_samples.vcf.map { meta, vcf, _tbi -> [meta, vcf, [], []] }, + 'decompress', + false, + 'vcf', ) BEDOPS_CONVERT2BED( @@ -56,14 +58,14 @@ workflow INTERSECT_STATISTICS { // collect summary reports BEDOPS_CONVERT2BED.out.bed .map { meta, bed -> tuple(meta + [converted: true], bed) } - .set{ converted_beds } + .set { converted_beds } test_beds_ch = test_beds_ch.mix(converted_beds) } test_beds_ch - .combine(truth_regions) - .map{test_meta, testbed, truthbed -> [test_meta, truthbed, testbed]} - .set{intersect_ch} + .combine(truth_regions) + .map { test_meta, testbed, truthbed -> [test_meta, truthbed, testbed] } + .set { intersect_ch } // Intersect bed files and gather statistics BEDTOOLS_INTERSECT_BENCH( @@ -74,8 +76,8 @@ workflow INTERSECT_STATISTICS { BEDTOOLS_INTERSECT_BENCH.out.summary .map { _meta, summary -> tuple([vartype: params.variant_type] + [benchmark_tool: "intersect"], summary) } .groupTuple() - .set{ summary_reports } + .set { summary_reports } emit: - summary_reports // channel: [meta, summary_report.csv] + summary_reports // channel: [meta, summary_report.csv] } diff --git a/subworkflows/local/intersect_statistics/tests/main.nf.test b/subworkflows/local/intersect_statistics/tests/main.nf.test index 699dbb0d..aa139201 100644 --- a/subworkflows/local/intersect_statistics/tests/main.nf.test +++ b/subworkflows/local/intersect_statistics/tests/main.nf.test @@ -12,8 +12,8 @@ nextflow_workflow { tag "svtk/vcf2bed" tag "bedops" tag "bedops/convert2bed" - tag "tabix" - tag "tabix/bgzip" + tag "htslib" + tag "htslib/bgziptabix" test("intersect small variants -VCF to BEDOPS") { diff --git a/subworkflows/local/liftover_vcfs/main.nf b/subworkflows/local/liftover_vcfs/main.nf index 23ec1e09..faf3192b 100644 --- a/subworkflows/local/liftover_vcfs/main.nf +++ b/subworkflows/local/liftover_vcfs/main.nf @@ -2,24 +2,24 @@ // LIFTOVER_VCFS: SUBWORKFLOW TO LIFTOVER VCFS HG37 TO HG38 OR HG38 TO HG37 // -include { PICARD_LIFTOVERVCF } from '../../../modules/nf-core/picard/liftovervcf' -include { GAWK as REFORMAT_HEADER } from '../../../modules/nf-core/gawk' -include { BCFTOOLS_ANNOTATE } from '../../../modules/nf-core/bcftools/annotate' -include { UCSC_LIFTOVER } from '../../../modules/nf-core/ucsc/liftover' -include { GNU_SORT } from '../../../modules/nf-core/gnu/sort' -include { BEDTOOLS_MERGE } from '../../../modules/nf-core/bedtools/merge' -include { TABIX_BGZIPTABIX } from '../../../modules/nf-core/tabix/bgziptabix' +include { PICARD_LIFTOVERVCF } from '../../../modules/nf-core/picard/liftovervcf' +include { GAWK as REFORMAT_HEADER } from '../../../modules/nf-core/gawk' +include { BCFTOOLS_ANNOTATE } from '../../../modules/nf-core/bcftools/annotate' +include { UCSC_LIFTOVER } from '../../../modules/nf-core/ucsc/liftover' +include { GNU_SORT } from '../../../modules/nf-core/gnu/sort' +include { BEDTOOLS_MERGE } from '../../../modules/nf-core/bedtools/merge' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIPTABIX } from '../../../modules/nf-core/htslib/bgziptabix' workflow LIFTOVER_VCFS { take: - ch_vcf // channel: [val(meta), vcf] - ch_bed // channel: [bed] - ch_targets_bed // channel: [bed] - fasta // reference channel [val(meta), ref.fa] - chain // chain channel [val(meta), chain.gz] - rename_chr // reference channel [val(meta), chrlist.txt] - dictionary // reference channel [val(meta), genome.dict] + ch_vcf // channel: [val(meta), vcf] + ch_bed // channel: [bed] + ch_targets_bed // channel: [bed] + fasta // reference channel [val(meta), ref.fa] + chain // chain channel [val(meta), chain.gz] + rename_chr // reference channel [val(meta), chrlist.txt] + dictionary // reference channel [val(meta), genome.dict] main: @@ -28,37 +28,41 @@ workflow LIFTOVER_VCFS { ch_vcf, dictionary, fasta, - chain + chain, ) // reformat header, convert PS TYPE integer to string after liftover REFORMAT_HEADER( PICARD_LIFTOVERVCF.out.vcf_lifted, [], - false + false, ) TABIX_BGZIPTABIX( - REFORMAT_HEADER.out.output + REFORMAT_HEADER.out.output.map { meta, vcf -> [meta, vcf, [], []] }, + 'compress', + true, + 'vcf', ) // rename chr after liftover BCFTOOLS_ANNOTATE( - TABIX_BGZIPTABIX.out.gz_index.map{meta, vcf, tbi -> tuple(meta, vcf, tbi, [], [])}, + TABIX_BGZIPTABIX.out.output.join(TABIX_BGZIPTABIX.out.index, failOnDuplicate: true, failOnMismatch: true).map { meta, vcf, tbi -> tuple(meta, vcf, tbi, [], []) }, [], [], - rename_chr.map{_meta, vcf -> vcf} + rename_chr.map { _meta, vcf -> vcf }, ) vcf_ch = BCFTOOLS_ANNOTATE.out.vcf // liftover bed files if given - ch_targets_bed.map{bed -> tuple([id: "targets"], bed)} - .mix(ch_bed.map{bed -> tuple([id: "regions"], bed)}) - .set{bed_ch} + ch_targets_bed + .map { bed -> tuple([id: "targets"], bed) } + .mix(ch_bed.map { bed -> tuple([id: "regions"], bed) }) + .set { bed_ch } UCSC_LIFTOVER( bed_ch, - chain.map{_meta, bed -> bed} + chain.map { _meta, bed -> bed }, ) // sort bed file @@ -72,16 +76,15 @@ workflow LIFTOVER_VCFS { ) BEDTOOLS_MERGE.out.bed - .filter{ meta, _bed -> meta.id == "targets" } - .set{targets_ch} + .filter { meta, _bed -> meta.id == "targets" } + .set { targets_ch } BEDTOOLS_MERGE.out.bed - .filter{ meta, _bed -> meta.id == "regions" } - .set{bed_ch} - + .filter { meta, _bed -> meta.id == "regions" } + .set { bed_ch } emit: - vcf_ch // channel: [val(meta), vcf.gz] - bed_ch // channel: [val(meta), bed] - targets_ch // channel: [val(meta), bed] + vcf_ch // channel: [val(meta), vcf.gz] + bed_ch // channel: [val(meta), bed] + targets_ch // channel: [val(meta), bed] } diff --git a/subworkflows/local/liftover_vcfs/tests/main.nf.test b/subworkflows/local/liftover_vcfs/tests/main.nf.test index ce3a8399..81d1f1a3 100644 --- a/subworkflows/local/liftover_vcfs/tests/main.nf.test +++ b/subworkflows/local/liftover_vcfs/tests/main.nf.test @@ -18,8 +18,8 @@ nextflow_workflow { tag "gnu/sort" tag "bedtools" tag "bedtools/merge" - tag "tabix" - tag "tabix/bgziptabix" + tag "htslib" + tag "htslib/bgziptabix" test("liftover vcfs and bed") { diff --git a/subworkflows/local/liftover_vcfs/tests/main.nf.test.snap b/subworkflows/local/liftover_vcfs/tests/main.nf.test.snap index 2a91a3cc..9ba280c3 100644 --- a/subworkflows/local/liftover_vcfs/tests/main.nf.test.snap +++ b/subworkflows/local/liftover_vcfs/tests/main.nf.test.snap @@ -27,10 +27,10 @@ } ], - "timestamp": "2026-08-17T15:21:22.12092656", + "timestamp": "2026-10-01T13:30:07.333762789", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } }, "liftover vcfs and bed stub": { @@ -86,10 +86,10 @@ ] } ], - "timestamp": "2026-08-17T15:21:37.191524864", + "timestamp": "2026-10-01T13:30:28.352851058", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } } } \ No newline at end of file diff --git a/subworkflows/local/prepare_vcfs_test/main.nf b/subworkflows/local/prepare_vcfs_test/main.nf index 5f9bf3f6..ed3d26b7 100644 --- a/subworkflows/local/prepare_vcfs_test/main.nf +++ b/subworkflows/local/prepare_vcfs_test/main.nf @@ -2,42 +2,44 @@ // PREPARE_VCFS: SUBWORKFLOW TO PREPARE INPUT VCFS // -include { VCF_VARIANT_DEDUPLICATION } from '../../local/vcf_variant_deduplication' -include { VCF_VARIANT_FILTERING } from '../../local/vcf_variant_filtering' -include { SPLIT_SMALL_VARIANTS_TEST } from '../../local/split_small_variants_test' -include { LIFTOVER_VCFS } from '../../local/liftover_vcfs' -include { BCFTOOLS_NORM } from '../../../modules/nf-core/bcftools/norm' -include { RTGTOOLS_SVDECOMPOSE } from '../../../modules/nf-core/rtgtools/svdecompose' +include { VCF_VARIANT_DEDUPLICATION } from '../../local/vcf_variant_deduplication' +include { VCF_VARIANT_FILTERING } from '../../local/vcf_variant_filtering' +include { SPLIT_SMALL_VARIANTS_TEST } from '../../local/split_small_variants_test' +include { LIFTOVER_VCFS } from '../../local/liftover_vcfs' +include { BCFTOOLS_NORM } from '../../../modules/nf-core/bcftools/norm' +include { RTGTOOLS_SVDECOMPOSE } from '../../../modules/nf-core/rtgtools/svdecompose' include { BCFTOOLS_VIEW as BCFTOOLS_VIEW_CONTIGS } from '../../../modules/nf-core/bcftools/view' include { BCFTOOLS_NORM as BCFTOOLS_SPLIT_MULTI } from '../../../modules/nf-core/bcftools/norm' include { BCFTOOLS_REHEADER as BCFTOOLS_REHEADER_QUERY } from '../../../modules/nf-core/bcftools/reheader' include { BCFTOOLS_VIEW as BCFTOOLS_VIEW_FILTERMISSING } from '../../../modules/nf-core/bcftools/view' include { GAWK as ADD_GT_STRELKA } from '../../../modules/nf-core/gawk' -include { TABIX_BGZIPTABIX as TABIX_BGZIPTABIX_GT } from '../../../modules/nf-core/tabix/bgziptabix' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIPTABIX_GT } from '../../../modules/nf-core/htslib/bgziptabix' include { BCFTOOLS_ANNOTATE as BCFTOOLS_RENAME_CHRS } from '../../../modules/nf-core/bcftools/annotate' workflow PREPARE_VCFS_TEST { take: - test_ch // channel: [val(meta), vcf] - fasta // reference channel [val(meta), ref.fa] - fai // reference channel [val(meta), ref.fa.fai] - chain // reference channel [val(meta), chain.gz] - rename_chr // reference channel [val(meta), chrlist.txt] - dictionary // reference channel [val(meta), genome.dict] + test_ch // channel: [val(meta), vcf] + fasta // reference channel [val(meta), ref.fa] + fai // reference channel [val(meta), ref.fa.fai] + chain // reference channel [val(meta), chain.gz] + rename_chr // reference channel [val(meta), chrlist.txt] + dictionary // reference channel [val(meta), genome.dict] main: // branch out test samples with metadata liftover is true - test_ch.branch{input -> - def meta = input[0] - liftover: meta.liftover - other: true} - .set{vcf} + test_ch + .branch { input -> + def meta = input[0] + liftover: meta.liftover + other: true + } + .set { vcf } vcf_ch = channel.empty() - if (params.liftover.contains("test")){ + if (params.liftover.contains("test")) { // apply liftover test vcfs LIFTOVER_VCFS( vcf.liftover, @@ -46,62 +48,67 @@ workflow PREPARE_VCFS_TEST { fasta, chain, rename_chr, - dictionary + dictionary, ) vcf_ch = vcf_ch.mix(LIFTOVER_VCFS.out.vcf_ch) } vcf_ch = vcf_ch.mix(vcf.other) // if prefix of chromosomes needs to be fixed - vcf_ch.branch{ input -> - def meta = input[0] - prefix: meta.fix_prefix - other: true} - .set{fix} + vcf_ch + .branch { input -> + def meta = input[0] + prefix: meta.fix_prefix + other: true + } + .set { fix } vcf_ch = channel.empty() // fix vcf chromosome prefix according to reference genome BCFTOOLS_RENAME_CHRS( - fix.prefix.map{ meta, input -> tuple(meta, input, []) }, + fix.prefix.map { meta, input -> tuple(meta, input, []) }, [], [], - rename_chr + rename_chr, ) - vcf_ch = vcf_ch.mix(BCFTOOLS_RENAME_CHRS.out.vcf,fix.other) + vcf_ch = vcf_ch.mix(BCFTOOLS_RENAME_CHRS.out.vcf, fix.other) // rename sample name BCFTOOLS_REHEADER_QUERY( - vcf_ch.map{ meta, input -> tuple(meta, input, [], []) }, - fai + vcf_ch.map { meta, input -> tuple(meta, input, [], []) }, + fai, ) - BCFTOOLS_REHEADER_QUERY.out.vcf.join(BCFTOOLS_REHEADER_QUERY.out.index) - .set{vcf_ch} + BCFTOOLS_REHEADER_QUERY.out.vcf + .join(BCFTOOLS_REHEADER_QUERY.out.index) + .set { vcf_ch } - if (params.preprocess.contains("filter_contigs")){ + if (params.preprocess.contains("filter_contigs")) { // filter out extra contigs! BCFTOOLS_VIEW_CONTIGS( vcf_ch, [], [], - [] + [], ) - BCFTOOLS_VIEW_CONTIGS.out.vcf.join(BCFTOOLS_VIEW_CONTIGS.out.tbi, by:0) - .set{vcf_ch} + BCFTOOLS_VIEW_CONTIGS.out.vcf + .join(BCFTOOLS_VIEW_CONTIGS.out.tbi, by: 0) + .set { vcf_ch } } - if (params.preprocess.contains("split_multiallelic")){ + if (params.preprocess.contains("split_multiallelic")) { // Split -any- multi-allelic variants BCFTOOLS_SPLIT_MULTI( vcf_ch, - fasta + fasta, ) - BCFTOOLS_SPLIT_MULTI.out.vcf.join(BCFTOOLS_SPLIT_MULTI.out.tbi, by:0) - .set{vcf_ch} + BCFTOOLS_SPLIT_MULTI.out.vcf + .join(BCFTOOLS_SPLIT_MULTI.out.tbi, by: 0) + .set { vcf_ch } } - if (params.include_expression != null || params.exclude_expression != null || params.min_sv_size > 0 || params.max_sv_size != -1 || params.min_allele_freq != -1 || params.min_num_reads != -1 ){ + if (params.include_expression != null || params.exclude_expression != null || params.min_sv_size > 0 || params.max_sv_size != -1 || params.min_allele_freq != -1 || params.min_num_reads != -1) { // Filters variants and SVs with given parameters VCF_VARIANT_FILTERING( vcf_ch @@ -109,31 +116,32 @@ workflow PREPARE_VCFS_TEST { vcf_ch = VCF_VARIANT_FILTERING.out.vcf_ch } - if (params.preprocess.contains("deduplicate")){ + if (params.preprocess.contains("deduplicate")) { // Deduplicate variants at the same position test VCF_VARIANT_DEDUPLICATION( vcf_ch, - fasta + fasta, ) vcf_ch = VCF_VARIANT_DEDUPLICATION.out.ch_vcf } - if (params.preprocess.contains("normalize")){ + if (params.preprocess.contains("normalize")) { // Turn on left alignment and normalization BCFTOOLS_NORM( vcf_ch, - fasta + fasta, ) - BCFTOOLS_NORM.out.vcf.join(BCFTOOLS_NORM.out.tbi, by:0) - .set{vcf_ch} + BCFTOOLS_NORM.out.vcf + .join(BCFTOOLS_NORM.out.tbi, by: 0) + .set { vcf_ch } } - if (params.analysis.contains("somatic")){ + if (params.analysis.contains("somatic")) { // somatic specific preparations - if (params.variant_type == "small"){ + if (params.variant_type == "small") { // splitting small type of variants only required if the method is sompy // This part needs to be retired, as other methods can work for both mixed type of variants! - if (params.variant_type == "sompy"){ + if (params.variant_type == "sompy") { SPLIT_SMALL_VARIANTS_TEST( vcf_ch ) @@ -142,7 +150,7 @@ workflow PREPARE_VCFS_TEST { } } - if (params.sv_standardization.contains("svdecompose")){ + if (params.sv_standardization.contains("svdecompose")) { RTGTOOLS_SVDECOMPOSE( vcf_ch ) @@ -152,14 +160,14 @@ workflow PREPARE_VCFS_TEST { if (!(params.enable_missing_genotypes?.contains("test"))) { // filters out ./. or 0/0 or non-somatic genotypes - genotype_missing = vcf_ch.filter{ meta, _vcf, _tbi -> meta.missing_gt } - genotype_exist = vcf_ch.filter{ meta, _vcf, _tbi -> !meta.missing_gt } + genotype_missing = vcf_ch.filter { meta, _vcf, _tbi -> meta.missing_gt } + genotype_exist = vcf_ch.filter { meta, _vcf, _tbi -> !meta.missing_gt } BCFTOOLS_VIEW_FILTERMISSING( genotype_exist, [], [], - [] + [], ) // Recombine the streams @@ -167,28 +175,34 @@ workflow PREPARE_VCFS_TEST { vcf_ch = processed_vcf.mix(genotype_missing) } - // branch out test samples with missing GT field (e.g. strelka) to add GT field using gawk + // branch out test samples with missing GT field (e.g. strelka) to add GT field using gawk vcf_ch .branch { meta, _vcf, _tbi -> def is_rtg = params.method?.contains("rtgtools") || params.method?.contains("aardvark") def is_strelka_manta = ['strelka', 'strelka2', 'manta'].contains(meta.caller.toLowerCase()) def is_somatic = params.analysis == "somatic" needs_gt: is_strelka_manta && is_somatic && is_rtg - ok: true - }.set{ch_branched_vcf} + ok: true + } + .set { ch_branched_vcf } // Add GT field using ADD_GT_STRELKA( - ch_branched_vcf.needs_gt.map{ meta, vcf_file, _tbi -> tuple(meta, vcf_file) }, + ch_branched_vcf.needs_gt.map { meta, vcf_file, _tbi -> tuple(meta, vcf_file) }, [], - false + false, ) TABIX_BGZIPTABIX_GT( - ADD_GT_STRELKA.out.output + ADD_GT_STRELKA.out.output.map { meta, vcf_file -> [meta, vcf_file, [], []] }, + 'compress', + true, + 'vcf', ) - vcf_ch = TABIX_BGZIPTABIX_GT.out.gz_index.mix(ch_branched_vcf.ok) + vcf_ch = TABIX_BGZIPTABIX_GT.out.output + .join(TABIX_BGZIPTABIX_GT.out.index, failOnDuplicate: true, failOnMismatch: true) + .mix(ch_branched_vcf.ok) emit: - vcf_ch // channel: [val(meta), vcf.gz, tbi] + vcf_ch // channel: [val(meta), vcf.gz, tbi] } diff --git a/subworkflows/local/prepare_vcfs_test/tests/main.nf.test b/subworkflows/local/prepare_vcfs_test/tests/main.nf.test index 75626be3..9933014e 100644 --- a/subworkflows/local/prepare_vcfs_test/tests/main.nf.test +++ b/subworkflows/local/prepare_vcfs_test/tests/main.nf.test @@ -14,7 +14,7 @@ nextflow_workflow { tag "bcftools/annotate" tag "rtgtools/svdecompose" tag "gawk" - tag "tabix/bgziptabix" + tag "htslib/bgziptabix" test("prepare small variants - full preprocess") { diff --git a/subworkflows/local/prepare_vcfs_test/tests/main.nf.test.snap b/subworkflows/local/prepare_vcfs_test/tests/main.nf.test.snap index 94651543..f6917247 100644 --- a/subworkflows/local/prepare_vcfs_test/tests/main.nf.test.snap +++ b/subworkflows/local/prepare_vcfs_test/tests/main.nf.test.snap @@ -37,10 +37,10 @@ ] ] ], - "timestamp": "2026-04-21T13:20:33.247931319", + "timestamp": "2026-10-01T13:31:08.903622788", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } }, "prepare small variants - full preprocess": { diff --git a/subworkflows/local/small_benchmark/tests/main.nf.test.snap b/subworkflows/local/small_benchmark/tests/main.nf.test.snap index 923671c2..6097a2f0 100644 --- a/subworkflows/local/small_benchmark/tests/main.nf.test.snap +++ b/subworkflows/local/small_benchmark/tests/main.nf.test.snap @@ -366,7 +366,7 @@ "tag": "FP", "id": "aardvark" }, - "test_aardvark.HG002.haplotypecaller.query.filter.vcf.gz", + "test_aardvark.HG002.haplotypecaller.query.bgzip.filter.vcf.gz", "VcfFile [chromosomes=[], sampleCount=1, variantCount=0, phased=true, phasedAutodetect=true]", "d41d8cd98f00b204e9800998ecf8427e" ], @@ -376,7 +376,7 @@ "tag": "TP_base", "id": "aardvark" }, - "test_aardvark.HG002.haplotypecaller.query.filter.vcf.gz", + "test_aardvark.HG002.haplotypecaller.query.bgzip.filter.vcf.gz", "VcfFile [chromosomes=[chr21], sampleCount=1, variantCount=737, phased=false, phasedAutodetect=false]", "f0673c99f58b46ff264ff39bc3bdada2" ], @@ -406,10 +406,10 @@ } ], - "timestamp": "2026-07-15T11:06:07.777636742", + "timestamp": "2026-10-02T11:56:32.593627739", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } }, "somatic small variants rtgtools": { diff --git a/subworkflows/local/split_small_variants_test/main.nf b/subworkflows/local/split_small_variants_test/main.nf index 1913c17f..e09fa1a9 100644 --- a/subworkflows/local/split_small_variants_test/main.nf +++ b/subworkflows/local/split_small_variants_test/main.nf @@ -2,14 +2,14 @@ // SPLIT_SMALL_VARIANTS_TEST: SUBWORKFLOW TO SPLIT SMALL SOMATIC VARIANTS INTO SNV AND INDEL // -include { BCFTOOLS_VIEW as BCFTOOLS_VIEW_SNV } from '../../../modules/nf-core/bcftools/view' -include { BCFTOOLS_VIEW as BCFTOOLS_VIEW_INDEL } from '../../../modules/nf-core/bcftools/view' -include { TABIX_BGZIPTABIX as TABIX_BGZIPTABIX_SNV } from '../../../modules/nf-core/tabix/bgziptabix' -include { TABIX_BGZIPTABIX as TABIX_BGZIPTABIX_INDEL } from '../../../modules/nf-core/tabix/bgziptabix' +include { BCFTOOLS_VIEW as BCFTOOLS_VIEW_SNV } from '../../../modules/nf-core/bcftools/view' +include { BCFTOOLS_VIEW as BCFTOOLS_VIEW_INDEL } from '../../../modules/nf-core/bcftools/view' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIPTABIX_SNV } from '../../../modules/nf-core/htslib/bgziptabix' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIPTABIX_INDEL } from '../../../modules/nf-core/htslib/bgziptabix' workflow SPLIT_SMALL_VARIANTS_TEST { take: - input_ch // channel: [val(meta), vcf, index] + input_ch // channel: [val(meta), vcf, index] main: @@ -19,34 +19,42 @@ workflow SPLIT_SMALL_VARIANTS_TEST { input_ch, [], [], - [] + [], ) TABIX_BGZIPTABIX_SNV( - BCFTOOLS_VIEW_SNV.out.vcf + BCFTOOLS_VIEW_SNV.out.vcf.map { meta, vcf -> [meta, vcf, [], []] }, + 'compress', + true, + 'vcf', ) - TABIX_BGZIPTABIX_SNV.out.gz_index + TABIX_BGZIPTABIX_SNV.out.output + .join(TABIX_BGZIPTABIX_SNV.out.index, failOnDuplicate: true, failOnMismatch: true) .map { meta, vcf, index -> tuple(meta + [vartype: "snv"], vcf, index) } - .set{split_snv_vcf} + .set { split_snv_vcf } out_vcf_ch = out_vcf_ch.mix(split_snv_vcf) BCFTOOLS_VIEW_INDEL( input_ch, [], [], - [] + [], ) TABIX_BGZIPTABIX_INDEL( - BCFTOOLS_VIEW_INDEL.out.vcf + BCFTOOLS_VIEW_INDEL.out.vcf.map { meta, vcf -> [meta, vcf, [], []] }, + 'compress', + true, + 'vcf', ) - TABIX_BGZIPTABIX_INDEL.out.gz_index + TABIX_BGZIPTABIX_INDEL.out.output + .join(TABIX_BGZIPTABIX_INDEL.out.index, failOnDuplicate: true, failOnMismatch: true) .map { meta, vcf, index -> tuple(meta + [vartype: "indel"], vcf, index) } - .set{split_indel_vcf} + .set { split_indel_vcf } out_vcf_ch = out_vcf_ch.mix(split_indel_vcf) emit: - out_vcf_ch // channel: [val(meta), vcf, index] + out_vcf_ch // channel: [val(meta), vcf, index] } diff --git a/subworkflows/local/split_small_variants_test/tests/main.nf.test b/subworkflows/local/split_small_variants_test/tests/main.nf.test index 321913ef..a6bf48cd 100644 --- a/subworkflows/local/split_small_variants_test/tests/main.nf.test +++ b/subworkflows/local/split_small_variants_test/tests/main.nf.test @@ -9,8 +9,8 @@ nextflow_workflow { tag "subworkflows/split_small_variants_test" tag "bcftools" tag "bcftools/view" - tag "tabix" - tag "tabix/bgziptabix" + tag "htslib" + tag "htslib/bgziptabix" test("split small variants") { diff --git a/subworkflows/local/sv_vcf_conversion/main.nf b/subworkflows/local/sv_vcf_conversion/main.nf index efb72dad..63ecbca5 100644 --- a/subworkflows/local/sv_vcf_conversion/main.nf +++ b/subworkflows/local/sv_vcf_conversion/main.nf @@ -2,141 +2,95 @@ // SV_VCF_CONVERSIONS: SUBWORKFLOW to apply tool spesific conversions // -include { SVYNC } from '../../../modules/nf-core/svync' -include { TABIX_BGZIPTABIX } from '../../../modules/nf-core/tabix/bgziptabix' -include { VARIANTEXTRACTOR } from '../../../modules/nf-core/variantextractor' -include { SVTK_STANDARDIZE } from '../../../modules/nf-core/svtk/standardize' -include { RTGTOOLS_SVDECOMPOSE } from '../../../modules/nf-core/rtgtools/svdecompose' +include { SVYNC } from '../../../modules/nf-core/svync' +include { VARIANTEXTRACTOR } from '../../../modules/nf-core/variantextractor' +include { SVTK_STANDARDIZE } from '../../../modules/nf-core/svtk/standardize' +include { RTGTOOLS_SVDECOMPOSE } from '../../../modules/nf-core/rtgtools/svdecompose' include { BCFTOOLS_SORT as BCFTOOLS_SORT1 } from '../../../modules/nf-core/bcftools/sort' include { BCFTOOLS_SORT as BCFTOOLS_SORT2 } from '../../../modules/nf-core/bcftools/sort' -include { TABIX_TABIX as TABIX_TABIX_1 } from '../../../modules/nf-core/tabix/tabix' -include { TABIX_TABIX as TABIX_TABIX_2 } from '../../../modules/nf-core/tabix/tabix' workflow SV_VCF_CONVERSIONS { take: - input_ch // channel: [val(meta), vcf] - fai // reference channel [val(meta), ref.fa.fai] + input_ch // channel: [val(meta), vcf] + fai // reference channel [val(meta), ref.fa.fai] main: - if (params.sv_standardization.contains("variantextractor")){ + vcf_ch = input_ch + + if (params.sv_standardization.contains("variantextractor")) { // uses VariantExtractor to homogenize variants VARIANTEXTRACTOR( - input_ch + vcf_ch ) // sort vcf BCFTOOLS_SORT1( VARIANTEXTRACTOR.out.vcf ) - input_ch = BCFTOOLS_SORT1.out.vcf + vcf_ch = BCFTOOLS_SORT1.out.vcf } - if (params.sv_standardization.contains("svtk")){ - - out_vcf_ch = channel.empty() + if (params.sv_standardization.contains("svtk")) { - supported_callers2 = ["delly", "melt", "manta", "wham", "dragen", "lumpy", "scrable", "smoove"] - input_ch - .branch{ meta, _vcf-> + svtk_callers = ["delly", "melt", "manta", "wham", "dragen", "lumpy", "scrable", "smoove"] + vcf_ch + .branch { meta, _vcf -> def caller = meta.caller - def supported = supported_callers2.contains(caller) - if(!supported) { + def supported = svtk_callers.contains(caller) + if (!supported) { log.warn("Standardization for SV caller '${caller}' is not supported in svtk. Skipping standardization...") } - tool: supported - other: !supported + supported: supported + unsupported: !supported } - .set{input} - - TABIX_TABIX_1( - input.tool - ) + .set { svtk_input } SVTK_STANDARDIZE( - input.tool.join(TABIX_TABIX_1.out.index), - fai + svtk_input.supported, + fai, ) BCFTOOLS_SORT2( SVTK_STANDARDIZE.out.vcf ) - out_vcf_ch.mix( - BCFTOOLS_SORT2.out.vcf, - input.other - ).set{input_ch} - + vcf_ch = BCFTOOLS_SORT2.out.vcf.mix(svtk_input.unsupported) } - if (params.sv_standardization.contains("svdecompose")){ + if (params.sv_standardization.contains("svdecompose")) { RTGTOOLS_SVDECOMPOSE( - input_ch.map{ meta, vcf -> tuple(meta, vcf, [])} + vcf_ch.map { meta, vcf -> tuple(meta, vcf, []) } ) - input_ch = RTGTOOLS_SVDECOMPOSE.out.vcf + vcf_ch = RTGTOOLS_SVDECOMPOSE.out.vcf } - input_ch - .branch { files -> - compressed: files[1].getName().endsWith('.gz') - uncompressed: true - } - .set { ch_inputs } - - TABIX_BGZIPTABIX ( - ch_inputs.uncompressed - ) - - TABIX_TABIX_2 ( - ch_inputs.compressed - ) - - compressed_ch = ch_inputs.compressed.join(TABIX_TABIX_2.out.index) - vcf_ch = TABIX_BGZIPTABIX.out.gz_index.mix(compressed_ch) - // RUN SVYNC tool to reformat SV callers - if(params.sv_standardization.contains("svync")){ - out_vcf_ch = channel.empty() - supported_callers = ["delly", "dragen", "gridss", "manta", "smoove"] + if (params.sv_standardization.contains("svync")) { + svync_callers = ["delly", "dragen", "gridss", "manta", "smoove"] vcf_ch - .branch{ meta, vcf, tbi -> + .branch { meta, _vcf -> def caller = meta.caller - def supported = supported_callers.contains(caller) - if(!supported) { + def supported = svync_callers.contains(caller) + if (!supported) { log.warn("Standardization for SV caller '${caller}' is not supported in svync. Skipping standardization...") } - tool: supported - return [ meta, vcf, tbi] - other: !supported - return [ meta, vcf ] + supported: supported + unsupported: !supported } - .set{input} - - input.tool - .map { meta, vcf, tbi -> - [ meta, vcf, tbi, file("${projectDir}/assets/svync/${meta.caller}.yaml", checkIfExists:true) ] - } - .set {svync_ch} + .set { svync_input } SVYNC( - svync_ch - ) - out_vcf_ch.mix( - SVYNC.out.vcf, - input.other - ) - .map{ file -> - def meta = file[0] - def vcf = file[1] - [ meta, vcf ] + svync_input.supported.map { meta, vcf -> + [meta, vcf, [], file("${projectDir}/assets/svync/${meta.caller}.yaml", checkIfExists: true)] } - .set { vcf_ch } - } - + ) + vcf_ch = SVYNC.out.vcf.mix(svync_input.unsupported) + } emit: - vcf_ch // channel: [val(meta), vcf] + vcf_ch // channel: [val(meta), vcf] } diff --git a/subworkflows/local/sv_vcf_conversion/tests/main.nf.test b/subworkflows/local/sv_vcf_conversion/tests/main.nf.test index 54d69223..e7ba66f4 100644 --- a/subworkflows/local/sv_vcf_conversion/tests/main.nf.test +++ b/subworkflows/local/sv_vcf_conversion/tests/main.nf.test @@ -15,9 +15,6 @@ nextflow_workflow { tag "svync" tag "bcftools" tag "bcftools/sort" - tag "tabix" - tag "tabix/bgziptabix" - tag "tabix/tabix" test("convert sv vcf with variant_extractor") { diff --git a/subworkflows/local/sv_vcf_conversion/tests/main.nf.test.snap b/subworkflows/local/sv_vcf_conversion/tests/main.nf.test.snap index f5d1b37e..4675cb60 100644 --- a/subworkflows/local/sv_vcf_conversion/tests/main.nf.test.snap +++ b/subworkflows/local/sv_vcf_conversion/tests/main.nf.test.snap @@ -8,8 +8,7 @@ "id": "test", "caller": "manta" }, - "simulated_sv.bnd.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "simulated_sv.bnd.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "simulated_sv.bnd.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ], "vcf_ch": [ @@ -18,16 +17,15 @@ "id": "test", "caller": "manta" }, - "simulated_sv.bnd.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "simulated_sv.bnd.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "simulated_sv.bnd.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" ] ] } ], - "timestamp": "2026-03-24T15:42:01.274705513", + "timestamp": "2026-10-01T14:05:25.402006499", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } }, "convert sv vcf with variant_extractor": { @@ -41,17 +39,19 @@ "test_test2_paired_mutect2_calls.variantextract.extracted.sort.vcf.gz", "VcfFile [chromosomes=[chr21], sampleCount=2, variantCount=40, phased=false, phasedAutodetect=false]", "f38d3ef295c500a413df6b746b36a356", - "test_test2_paired_mutect2_calls.variantextract.extracted.sort.vcf.gz.tbi" + [ + + ] ] ], { } ], - "timestamp": "2026-03-24T15:17:16.375225624", + "timestamp": "2026-10-01T14:04:35.750469591", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } }, "convert sv vcf with svtk": { @@ -65,17 +65,19 @@ "simulated_sv.svtk.sort.vcf.gz", "VcfFile [chromosomes=[chr21], sampleCount=1, variantCount=136, phased=false, phasedAutodetect=false]", "13fa9c5c4602821e2b4c37cce28b6978", - "simulated_sv.svtk.sort.vcf.gz.tbi" + [ + + ] ] ], { } ], - "timestamp": "2026-03-24T15:41:07.358091187", + "timestamp": "2026-10-01T14:04:49.061518529", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } }, "convert sv vcf with svync": { @@ -98,10 +100,10 @@ } ], - "timestamp": "2026-03-24T15:41:43.888871138", + "timestamp": "2026-10-01T13:47:14.79330657", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } }, "convert sv vcf with svdecompose": { @@ -115,17 +117,19 @@ "simulated_sv.bnd.vcf.gz", "VcfFile [chromosomes=[chr21], sampleCount=1, variantCount=364, phased=false, phasedAutodetect=false]", "7a5371e54a73f38141af063ab397807d", - "simulated_sv.bnd.vcf.gz.tbi" + [ + + ] ] ], { } ], - "timestamp": "2026-03-24T15:41:28.284230877", + "timestamp": "2026-10-01T14:05:02.812747584", "meta": { - "nf-test": "0.9.4", - "nextflow": "25.10.4" + "nf-test": "0.9.5", + "nextflow": "26.04.6" } } } \ No newline at end of file diff --git a/subworkflows/local/vcf_variant_filtering/main.nf b/subworkflows/local/vcf_variant_filtering/main.nf index bdd8de22..f2b4f13f 100644 --- a/subworkflows/local/vcf_variant_filtering/main.nf +++ b/subworkflows/local/vcf_variant_filtering/main.nf @@ -2,19 +2,19 @@ // VCF_VARIANT_FILTERING: Filter SV using survivor and bcftools // -include { SURVIVOR_FILTER } from '../../../modules/nf-core/survivor/filter' -include { TABIX_BGZIP } from '../../../modules/nf-core/tabix/bgzip' -include { TABIX_BGZIPTABIX } from '../../../modules/nf-core/tabix/bgziptabix' -include { BCFTOOLS_FILTER } from '../../../modules/nf-core/bcftools/filter' +include { SURVIVOR_FILTER } from '../../../modules/nf-core/survivor/filter' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIP } from '../../../modules/nf-core/htslib/bgziptabix' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIPTABIX } from '../../../modules/nf-core/htslib/bgziptabix' +include { BCFTOOLS_FILTER } from '../../../modules/nf-core/bcftools/filter' workflow VCF_VARIANT_FILTERING { take: - vcf_ch // channel: [val(meta), vcf.gz, index] + vcf_ch // channel: [val(meta), vcf.gz, index] main: - if(params.exclude_expression || params.include_expression){ + if (params.exclude_expression || params.include_expression) { // filter vcf files using bcftools expressions BCFTOOLS_FILTER( @@ -22,34 +22,40 @@ workflow VCF_VARIANT_FILTERING { ) vcf_ch = BCFTOOLS_FILTER.out.vcf } - else{ + else { // unzip vcf file, required for survivor filter TABIX_BGZIP( - vcf_ch.map{ meta, vcf, _index -> tuple(meta, vcf)} + vcf_ch.map { meta, vcf, _index -> [meta, vcf, [], []] }, + 'decompress', + false, + 'vcf', ) vcf_ch = TABIX_BGZIP.out.output } - if(params.min_sv_size > 0 || params.max_sv_size != -1 || params.min_allele_freq != -1 || params.min_num_reads != -1){ + if (params.min_sv_size > 0 || params.max_sv_size != -1 || params.min_allele_freq != -1 || params.min_num_reads != -1) { // filters out smaller SVs than min_sv_size, only applicable to SV files - if (params.variant_type == "structural"){ + if (params.variant_type == "structural") { SURVIVOR_FILTER( - vcf_ch.map{meta, vcf -> tuple( meta, vcf, [])}, + vcf_ch.map { meta, vcf -> tuple(meta, vcf, []) }, params.min_sv_size, params.max_sv_size, params.min_allele_freq, - params.min_num_reads + params.min_num_reads, ) vcf_ch = SURVIVOR_FILTER.out.vcf } } // zip and index vcf files TABIX_BGZIPTABIX( - vcf_ch + vcf_ch.map { meta, vcf -> [meta, vcf, [], []] }, + 'compress', + true, + 'vcf', ) - vcf_ch = TABIX_BGZIPTABIX.out.gz_index + vcf_ch = TABIX_BGZIPTABIX.out.output.join(TABIX_BGZIPTABIX.out.index, failOnDuplicate: true, failOnMismatch: true) emit: - vcf_ch // [val(meta), vcf.gz, index] + vcf_ch // [val(meta), vcf.gz, index] } diff --git a/subworkflows/local/vcf_variant_filtering/tests/main.nf.test b/subworkflows/local/vcf_variant_filtering/tests/main.nf.test index 87435ffa..cdc7d5d5 100644 --- a/subworkflows/local/vcf_variant_filtering/tests/main.nf.test +++ b/subworkflows/local/vcf_variant_filtering/tests/main.nf.test @@ -11,9 +11,8 @@ nextflow_workflow { tag "bcftools/filter" tag "survivor" tag "survivor/filter" - tag "tabix" - tag "tabix/bgzip" - tag "tabix/bgziptabix" + tag "htslib" + tag "htslib/bgziptabix" test("filter variants with bcftools") { diff --git a/subworkflows/local/wittyer_benchmark/main.nf b/subworkflows/local/wittyer_benchmark/main.nf index 102a603f..22748ce5 100644 --- a/subworkflows/local/wittyer_benchmark/main.nf +++ b/subworkflows/local/wittyer_benchmark/main.nf @@ -2,30 +2,37 @@ // WITTYER_BENCHMARK: SUBWORKFLOW FOR BENCHMARKING SV VARIANTS WITH WITTYER // -include { WITTYER } from '../../../modules/nf-core/wittyer' -include { TABIX_BGZIP as TABIX_BGZIP_QUERY } from '../../../modules/nf-core/tabix/bgzip' -include { TABIX_BGZIP as TABIX_BGZIP_TRUTH } from '../../../modules/nf-core/tabix/bgzip' +include { WITTYER } from '../../../modules/nf-core/wittyer' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIP_QUERY } from '../../../modules/nf-core/htslib/bgziptabix' +include { HTSLIB_BGZIPTABIX as TABIX_BGZIP_TRUTH } from '../../../modules/nf-core/htslib/bgziptabix' workflow WITTYER_BENCHMARK { take: - input_ch // channel: [val(meta), test_vcf, test_index, truth_vcf, truth_index, regionsbed, targets_bed ] + input_ch // channel: [val(meta), test_vcf, test_index, truth_vcf, truth_index, regionsbed, targets_bed ] main: TABIX_BGZIP_QUERY( - input_ch.map { meta, vcf, _tbi, _truth_vcf, _truth_tbi, _bed, _targets_bed -> - [ meta, vcf ] - } + input_ch.map { meta, vcf, tbi, _truth_vcf, _truth_tbi, _bed, _targets_bed -> + [meta, vcf, tbi, []] + }, + 'decompress', + false, + 'vcf', ) TABIX_BGZIP_TRUTH( - input_ch.map { meta, _vcf, _tbi, truth_vcf, _truth_tbi, _bed, _targets_bed -> - [ meta, truth_vcf ] - } + input_ch.map { meta, _vcf, _tbi, truth_vcf, truth_tbi, _bed, _targets_bed -> + [meta, truth_vcf, truth_tbi, []] + }, + 'decompress', + false, + 'vcf', ) - input_ch.map { meta, _vcf, _tbi, _truth_vcf, _truth_tbi, bed, _targets_bed -> - [ meta, bed ] + input_ch + .map { meta, _vcf, _tbi, _truth_vcf, _truth_tbi, bed, _targets_bed -> + [meta, bed] } .set { bed } @@ -39,8 +46,8 @@ workflow WITTYER_BENCHMARK { WITTYER.out.report .map { _meta, report -> tuple([vartype: params.variant_type] + [benchmark_tool: "wittyer"], report) } .groupTuple() - .set{ report } + .set { report } emit: - report // channel: [val(meta), reports] + report // channel: [val(meta), reports] } diff --git a/subworkflows/local/wittyer_benchmark/tests/main.nf.test b/subworkflows/local/wittyer_benchmark/tests/main.nf.test index 097d74ac..d4ffb2cd 100644 --- a/subworkflows/local/wittyer_benchmark/tests/main.nf.test +++ b/subworkflows/local/wittyer_benchmark/tests/main.nf.test @@ -7,8 +7,8 @@ nextflow_workflow { tag "subworkflows" tag "subworkflows_wittyer_benchmark" tag "subworkflows/wittyer_benchmark" - tag "tabix" - tag "tabix/bgzip" + tag "htslib" + tag "htslib/bgziptabix" tag "wittyer" test("benchmark with wittyer") { diff --git a/tests/default.nf.test.snap b/tests/default.nf.test.snap index 814cd43e..1c5cf095 100644 --- a/tests/default.nf.test.snap +++ b/tests/default.nf.test.snap @@ -1,7 +1,7 @@ { "Params: --analysis 'germline' --variant_type 'structural' --method 'svanalyzer'": { "content": [ - 73, + 70, { "BCFTOOLS_DEDUP": { "bcftools": 1.22 @@ -61,10 +61,8 @@ "svanalyzer": 0.36 }, "TABIX_BGZIP_UNZIP": { - "tabix": 1.21 - }, - "TABIX_TABIX_2": { - "tabix": 1.21 + "htslib": 1.24, + "xz": "5.8.3" }, "VCF_TO_CSV": { "python": "3.13.0" @@ -237,15 +235,15 @@ "test3.manta_mqc.stats:md5,c6d5b9f40c4aa8c7b30155464eb52e3c" ] ], - "timestamp": "2026-09-18T13:28:49.188118653", + "timestamp": "2026-10-01T15:00:45.693728379", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.1" + "nextflow": "26.04.6" } }, "-stub": { "content": [ - 73, + 70, { "BCFTOOLS_DEDUP": { "bcftools": 1.22 @@ -305,10 +303,8 @@ "svanalyzer": 0.36 }, "TABIX_BGZIP_UNZIP": { - "tabix": 1.21 - }, - "TABIX_TABIX_2": { - "tabix": 1.21 + "htslib": 1.24, + "xz": "5.8.3" }, "VCF_TO_CSV": { "python": "3.13.0" @@ -436,10 +432,10 @@ "test3.manta_mqc.stats:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "timestamp": "2026-09-18T16:34:03.788580397", + "timestamp": "2026-10-01T15:08:43.763758315", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.1" + "nextflow": "26.04.6" } } } \ No newline at end of file diff --git a/tests/germline_small.nf.test.snap b/tests/germline_small.nf.test.snap index a70e9d80..a5324987 100644 --- a/tests/germline_small.nf.test.snap +++ b/tests/germline_small.nf.test.snap @@ -69,6 +69,10 @@ "HAPPY_REPORT": { "ga4gh-happy-report": "0.1.2" }, + "HTSLIB_BGZIPTABIX": { + "htslib": 1.24, + "xz": "5.8.3" + }, "MERGE_REPORTS": { "python": "3.13.0" }, @@ -91,11 +95,8 @@ "rtgtools": 3.13 }, "TABIX_BGZIPTABIX": { - "bgzip": 1.21, - "tabix": 1.21 - }, - "TABIX_TABIX": { - "tabix": 1.21 + "htslib": 1.24, + "xz": "5.8.3" }, "VCF_TO_CSV": { "python": "3.13.0" @@ -432,7 +433,7 @@ "test7.bcftools.bcftools_stats.txt:md5,ccc59737c476e1f77dcef59c50d0e56a" ] ], - "timestamp": "2026-09-28T14:50:38.785887301", + "timestamp": "2026-10-02T11:37:30.484164952", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.6" @@ -508,6 +509,10 @@ "HAPPY_REPORT": { "ga4gh-happy-report": "0.1.2" }, + "HTSLIB_BGZIPTABIX": { + "htslib": 1.24, + "xz": "5.8.3" + }, "MERGE_REPORTS": { "python": "3.13.0" }, @@ -530,11 +535,8 @@ "rtgtools": 3.13 }, "TABIX_BGZIPTABIX": { - "bgzip": 1.21, - "tabix": 1.21 - }, - "TABIX_TABIX": { - "tabix": 1.21 + "htslib": 1.24, + "xz": "5.8.3" }, "VCF_TO_CSV": { "python": "3.13.0" @@ -782,7 +784,7 @@ "test7.bcftools.bcftools_stats.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "timestamp": "2026-09-28T14:54:13.098778486", + "timestamp": "2026-10-02T11:41:45.377527609", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.6" diff --git a/tests/somatic_snv.nf.test.snap b/tests/somatic_snv.nf.test.snap index da052c39..e15aa109 100644 --- a/tests/somatic_snv.nf.test.snap +++ b/tests/somatic_snv.nf.test.snap @@ -70,12 +70,12 @@ "python": "3.13.0" }, "TABIX_BGZIPTABIX": { - "bgzip": 1.21, - "tabix": 1.21 + "htslib": 1.24, + "xz": "5.8.3" }, "TABIX_BGZIPTABIX_GT": { - "bgzip": 1.21, - "tabix": 1.21 + "htslib": 1.24, + "xz": "5.8.3" }, "VCF_TO_CSV": { "python": "3.13.0" @@ -261,10 +261,10 @@ "test9.mutect2.bcftools_stats.txt:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "timestamp": "2026-09-18T16:41:49.520325688", + "timestamp": "2026-10-02T11:06:24.433907666", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.1" + "nextflow": "26.04.6" } }, "Params: --analysis 'somatic' --variant_type 'snv' --method 'sompy,rtgtools'": { @@ -338,12 +338,12 @@ "python": "3.13.0" }, "TABIX_BGZIPTABIX": { - "bgzip": 1.21, - "tabix": 1.21 + "htslib": 1.24, + "xz": "5.8.3" }, "TABIX_BGZIPTABIX_GT": { - "bgzip": 1.21, - "tabix": 1.21 + "htslib": 1.24, + "xz": "5.8.3" }, "VCF_TO_CSV": { "python": "3.13.0" @@ -631,10 +631,10 @@ "test9.mutect2.bcftools_stats.txt:md5,13f07551d60c681e81499dbd189b4537" ] ], - "timestamp": "2026-09-18T13:48:25.586604257", + "timestamp": "2026-10-02T11:03:02.520302764", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.1" + "nextflow": "26.04.6" } } } \ No newline at end of file diff --git a/tests/somatic_sv.nf.test.snap b/tests/somatic_sv.nf.test.snap index 7dd55585..de80cc1c 100644 --- a/tests/somatic_sv.nf.test.snap +++ b/tests/somatic_sv.nf.test.snap @@ -1,7 +1,7 @@ { "Params: --analysis 'somatic' --variant_type 'structural' --method 'truvari,svbenchmark'": { "content": [ - 53, + 51, { "BCFTOOLS_NORM": { "bcftools": 1.22 @@ -49,17 +49,16 @@ "survivor": "1.0.7" }, "TABIX_BGZIP": { - "tabix": 1.21 + "htslib": 1.24, + "xz": "5.8.3" }, "TABIX_BGZIPTABIX": { - "bgzip": 1.21, - "tabix": 1.21 + "htslib": 1.24, + "xz": "5.8.3" }, "TABIX_BGZIP_UNZIP": { - "tabix": 1.21 - }, - "TABIX_TABIX_2": { - "tabix": 1.21 + "htslib": 1.24, + "xz": "5.8.3" }, "TRUVARI_BENCH": { "truvari": "5.4.0" @@ -258,10 +257,10 @@ "test12.tiddit_mqc.stats:md5,950514053b461a3868a12fd5ced0a3d8" ] ], - "timestamp": "2026-09-18T13:43:47.877866207", + "timestamp": "2026-10-01T15:51:16.867984533", "meta": { "nf-test": "0.9.5", - "nextflow": "26.04.1" + "nextflow": "26.04.6" } } } \ No newline at end of file