From 5f3baa4b4ac013d5a735f796803dd1171e276e25 Mon Sep 17 00:00:00 2001 From: Anabella Trigila <18577080+atrigila@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:45:15 -0300 Subject: [PATCH 1/8] add quilt2 sbwf --- .../nf-core/bam_impute_quilt2/main.nf | 80 +++++++++ .../nf-core/bam_impute_quilt2/meta.yml | 131 +++++++++++++++ .../bam_impute_quilt2/tests/main.nf.test | 155 ++++++++++++++++++ .../bam_impute_quilt2/tests/main.nf.test.snap | 105 ++++++++++++ .../bam_impute_quilt2/tests/nextflow.config | 16 ++ 5 files changed, 487 insertions(+) create mode 100644 subworkflows/nf-core/bam_impute_quilt2/main.nf create mode 100644 subworkflows/nf-core/bam_impute_quilt2/meta.yml create mode 100644 subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test create mode 100644 subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap create mode 100644 subworkflows/nf-core/bam_impute_quilt2/tests/nextflow.config diff --git a/subworkflows/nf-core/bam_impute_quilt2/main.nf b/subworkflows/nf-core/bam_impute_quilt2/main.nf new file mode 100644 index 000000000000..0053051180bd --- /dev/null +++ b/subworkflows/nf-core/bam_impute_quilt2/main.nf @@ -0,0 +1,80 @@ +include { QUILT_QUILT2 } from '../../../modules/nf-core/quilt/quilt2/main' +include { GLIMPSE2_LIGATE } from '../../../modules/nf-core/glimpse2/ligate/main' +include { BCFTOOLS_INDEX } from '../../../modules/nf-core/bcftools/index/main' + +workflow BAM_IMPUTE_QUILT2 { + take: + ch_input // channel (mandatory): [ meta, bam/cram, bai/crai, bampaths, bamnames ] + ch_reference_panel // channel (mandatory): [ meta, reference_vcf, reference_index ] + ch_chunks // channel (optional): [ meta, chr, start, end ] + ch_map // channel (optional): [ meta, genetic_map ] + ch_fasta // channel (optional): [ meta, fasta, fai ] + n_gen // integer: Number of generations since founding or mixing + buffer // integer: Buffer of region to perform imputation over + + main: + + ch_versions = channel.empty() + + ch_parameters = ch_reference_panel + .combine(ch_map, by: 0) + .combine(ch_chunks, by: 0) + + ch_parameters.ifEmpty { + error("ERROR: join operation resulted in an empty channel. Please provide a valid ch_chunks and ch_map channel as input.") + } + + ch_bam_params = ch_input + .combine(ch_parameters) + .map { meta_input, bam, bai, bampath, bamname, meta_panel, reference_vcf, reference_index, genetic_map, chr, start, end -> + def regionout = "${chr}" + if (start != [] && end != []) { + regionout = "${chr}:${start}-${end}" + } + + [ + meta_panel + meta_input + [regionout: regionout], + bam, + bai, + bampath, + bamname, + reference_vcf, + reference_index, + [], + [], + [], + chr, + start, + end, + n_gen, + buffer, + genetic_map, + ] + } + + QUILT_QUILT2(ch_bam_params, ch_fasta) + ch_versions = ch_versions.mix(QUILT_QUILT2.out.versions_r_quilt) + ch_versions = ch_versions.mix(QUILT_QUILT2.out.versions_r_base) + + ligate_input = QUILT_QUILT2.out.vcf + .join(QUILT_QUILT2.out.tbi) + .map { meta, vcf, index -> + def keys_to_keep = meta.keySet() - ['regionout'] + [meta.subMap(keys_to_keep), vcf, index] + } + .groupTuple() + + GLIMPSE2_LIGATE(ligate_input) + + BCFTOOLS_INDEX(GLIMPSE2_LIGATE.out.merged_variants) + + ch_vcf_index = GLIMPSE2_LIGATE.out.merged_variants.join( + BCFTOOLS_INDEX.out.tbi.mix(BCFTOOLS_INDEX.out.csi), + failOnMismatch: true, + failOnDuplicate: true, + ) + + emit: + vcf_index = ch_vcf_index // channel: [ meta, vcf, tbi/csi ] + versions = ch_versions // channel: [ versions.yml ] or topic-based version tuples +} diff --git a/subworkflows/nf-core/bam_impute_quilt2/meta.yml b/subworkflows/nf-core/bam_impute_quilt2/meta.yml new file mode 100644 index 000000000000..73b470ceb88e --- /dev/null +++ b/subworkflows/nf-core/bam_impute_quilt2/meta.yml @@ -0,0 +1,131 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "bam_impute_quilt2" +description: | + Impute low-coverage BAM or CRAM inputs with QUILT2 and ligate chunked outputs per chromosome. +keywords: + - bam + - cram + - imputation + - quilt + - quilt2 + - vcf +components: + - quilt/quilt2 + - glimpse2/ligate + - bcftools/index +input: + - ch_input: + description: | + Channel with target sequencing data and optional rename files. + structure: + - meta: + type: map + description: Metadata map for the input batch. + - bam_or_cram: + type: file + description: Input BAM or CRAM file, or a list of BAM or CRAM files. + pattern: "*.{bam,cram}" + - index: + type: file + description: Index for the BAM or CRAM input. + pattern: "*.{bai,crai}" + - bampaths: + type: file + description: | + Optional text file listing BAM or CRAM paths to impute. + One file per line. + pattern: "*.{txt,tsv}" + - bamnames: + type: file + description: | + Optional text file listing sample names in the same order as `bampaths`. + One file per line. + pattern: "*.{txt,tsv}" + - ch_reference_panel: + description: | + Channel with phased reference panel VCFs per chromosome. + structure: + - meta: + type: map + description: | + Metadata map that will be combined with the input metadata. + Must include `id` for the panel name and `chr` for the chromosome. + - vcf: + type: file + description: Reference panel VCF or BCF. + pattern: "*.{vcf,vcf.gz,bcf}" + - index: + type: file + description: Index for the reference panel VCF or BCF. + pattern: "*.{tbi,csi}" + - ch_chunks: + description: | + Channel with optional imputation chunks per chromosome. + structure: + - meta: + type: map + description: Metadata map with the panel id and chromosome. + - chr: + type: string + description: Chromosome name. + - start: + type: integer + description: Start position of the chunk. + - end: + type: integer + description: End position of the chunk. + - ch_map: + description: | + Channel with optional genetic maps per chromosome. + structure: + - meta: + type: map + description: Metadata map with the panel id and chromosome. + - map: + type: file + description: Genetic map used by QUILT2. + pattern: "*.{txt,map}{,gz}" + - ch_fasta: + description: | + Channel with optional reference FASTA data, required for CRAM inputs. + structure: + - meta: + type: map + description: Metadata map for the reference genome. + - fasta: + type: file + description: Reference genome FASTA. + pattern: "*.{fa,fasta}" + - fai: + type: file + description: FASTA index file. + pattern: "*.fai" + - n_gen: + type: integer + description: Number of generations since founding or mixing. + - buffer: + type: integer + description: Buffer of region to perform imputation over. +output: + - vcf_index: + description: | + Imputed and indexed VCFs after ligating chunked outputs per chromosome. + structure: + - meta: + type: map + description: Metadata map combined from the input batch and panel metadata. + - vcf: + type: file + description: Imputed VCF file. + pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" + - index: + type: file + description: Index for the imputed VCF or BCF file. + pattern: "*.{tbi,csi}" + - versions: + description: | + Collected software version information emitted by the constituent modules. +authors: + - "@atrigila" +maintainers: + - "@atrigila" diff --git a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test new file mode 100644 index 000000000000..d66881ddd47d --- /dev/null +++ b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test @@ -0,0 +1,155 @@ +nextflow_workflow { + + name "Test Subworkflow BAM_IMPUTE_QUILT2" + script "../main.nf" + config "./nextflow.config" + + workflow "BAM_IMPUTE_QUILT2" + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/bam_impute_quilt2" + + tag "quilt" + tag "quilt/quilt2" + tag "bcftools" + tag "bcftools/index" + tag "glimpse2" + tag "glimpse2/ligate" + + test("Impute with quilt2 one individual, one region, map and fasta") { + when { + params { + quilt_args = "--save_prepared_reference=TRUE --seed=1" + } + workflow { + """ + bampath = channel.of("NA12878.chr21_22.1X.bam").collectFile(name: "bampath.txt", newLine: true) + input[0] = channel.of([ + [id: "allid"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam.bai", checkIfExists: true) + ]) + .combine(bampath) + .combine(channel.of([[]])) + input[1] = channel.of([ + [id: "1000GP", chr: "chr22"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz.csi", checkIfExists: true) + ]) + input[2] = channel.of( + [[id: "1000GP", chr: "chr22"], "chr22", "16570000", "16610000"] + ) + input[3] = channel.of([ + [id: "1000GP", chr: "chr22"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr22.stitch.map", checkIfExists: true) + ]) + input[4] = channel.of([ + [id: "GRCh38"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genome.fasta", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genome.fasta.fai", checkIfExists: true) + ]).collect() + input[5] = 100 + input[6] = 10000 + """ + } + } + then { + assert workflow.success + assert snapshot( + workflow.out.vcf_index.collect { meta, vcf, index -> [ + path(vcf).getFileName().toString(), + path(index).getFileName().toString(), + path(vcf).vcf.summary, + path(vcf).vcf.header.getGenotypeSamples().sort(), + path(vcf).vcf.variantsMD5 + ]}, + workflow.out.versions.collect { it instanceof String ? path(it).yaml : it } + ).match() + } + } + + test("homo_sapiens - empty channels - stub") { + options "-stub" + when { + params { + quilt_args = "--seed=1" + } + workflow { + """ + bampath = channel.of("NA12878.chr21_22.1X.bam").collectFile(name: "bampath.txt", newLine: true) + bamname = channel.of("MySample1").collectFile(name: "bamname.txt", newLine: true) + ch_samples = channel.of([ + [id: "allid"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam.bai", checkIfExists: true) + ]) + input[0] = ch_samples.combine(bampath).combine(bamname) + input[1] = channel.of( + [[id: "1000GP", chr: "chr22"], [], []], + [[id: "1000GP", chr: "chr21"], [], []] + ) + input[2] = channel.of( + [[id: "1000GP", chr: "chr22"], "chr22", 16570065, 16592216], + [[id: "1000GP", chr: "chr22"], "chr22", 16592229, 16609999], + [[id: "1000GP", chr: "chr21"], "chr21", 16570065, 16592216], + [[id: "1000GP", chr: "chr21"], "chr21", 16592229, 16609999] + ) + input[3] = channel.of( + [[id: "1000GP", chr: "chr22"], []], + [[id: "1000GP", chr: "chr21"], []] + ) + input[4] = channel.of([[id: "GRCh38"], [], []]).collect() + input[5] = 100 + input[6] = 10000 + """ + } + } + then { + assert workflow.success + assert snapshot(sanitizeOutput(workflow.out)).match() + } + } + + test("homo_sapiens - error empty join - stub") { + options "-stub" + when { + params { + quilt_args = "--seed=1" + } + workflow { + """ + bampath = channel.of("NA12878.chr21_22.1X.bam").collectFile(name: "bampath.txt", newLine: true) + bamname = channel.of("MySample1").collectFile(name: "bamname.txt", newLine: true) + ch_samples = channel.of([ + [id: "allid"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam.bai", checkIfExists: true) + ]) + input[0] = ch_samples.combine(bampath).combine(bamname) + input[1] = channel.of( + [[id: "otherpanel", chr: "chr22"], [], []], + [[id: "1000GP", chr: "chr21"], [], []] + ) + input[2] = channel.of( + [[id: "1000GP", chr: "chr22"], "chr22", 16570065, 16592216], + [[id: "1000GP", chr: "chr22"], "chr22", 16592229, 16609999], + [[id: "1000GP", chr: "chr21"], "chr21", 16570065, 16592216], + [[id: "1000GP", chr: "chr21"], "chr21", 16592229, 16609999] + ) + input[3] = channel.of( + [[id: "1000GP", chr: "chr22"], []], + [[id: "otherpanel", chr: "chr21"], []] + ) + input[4] = channel.of([[id: "GRCh38"], [], []]).collect() + input[5] = 100 + input[6] = 10000 + """ + } + } + then { + assert workflow.failed + assert workflow.errorMessage.contains("ERROR: join operation resulted in an empty channel. Please provide a valid ch_chunks and ch_map channel as input.") + } + } +} diff --git a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap new file mode 100644 index 000000000000..0d6a47e7cd76 --- /dev/null +++ b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap @@ -0,0 +1,105 @@ +{ + "homo_sapiens - empty channels - stub": { + "content": [ + { + "vcf_index": [ + [ + { + "id": "allid", + "chr": "chr21" + }, + "allid_chr21.ligate.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "allid_chr21.ligate.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "allid", + "chr": "chr22" + }, + "allid_chr22.ligate.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "allid_chr22.ligate.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + [ + "BAM_IMPUTE_QUILT2:QUILT_QUILT2", + "r-base", + "4.4.3" + ], + [ + "BAM_IMPUTE_QUILT2:QUILT_QUILT2", + "r-base", + "4.4.3" + ], + [ + "BAM_IMPUTE_QUILT2:QUILT_QUILT2", + "r-base", + "4.4.3" + ], + [ + "BAM_IMPUTE_QUILT2:QUILT_QUILT2", + "r-base", + "4.4.3" + ], + [ + "BAM_IMPUTE_QUILT2:QUILT_QUILT2", + "r-quilt", + "2.0.4" + ], + [ + "BAM_IMPUTE_QUILT2:QUILT_QUILT2", + "r-quilt", + "2.0.4" + ], + [ + "BAM_IMPUTE_QUILT2:QUILT_QUILT2", + "r-quilt", + "2.0.4" + ], + [ + "BAM_IMPUTE_QUILT2:QUILT_QUILT2", + "r-quilt", + "2.0.4" + ] + ] + } + ], + "timestamp": "2026-04-15T18:38:49.393022606", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + }, + "Impute with quilt2 one individual, one region, map and fasta": { + "content": [ + [ + [ + "allid_chr22.ligate.vcf.gz", + "allid_chr22.ligate.vcf.gz.tbi", + "VcfFile [chromosomes=[chr22], sampleCount=1, variantCount=903, phased=true, phasedAutodetect=false]", + [ + "NA12878" + ], + "de865f8128d121d8ae4b5e4c3aa662e2" + ] + ], + [ + [ + "BAM_IMPUTE_QUILT2:QUILT_QUILT2", + "r-base", + "4.4.3" + ], + [ + "BAM_IMPUTE_QUILT2:QUILT_QUILT2", + "r-quilt", + "2.0.4" + ] + ] + ], + "timestamp": "2026-04-15T18:41:23.30801371", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/bam_impute_quilt2/tests/nextflow.config b/subworkflows/nf-core/bam_impute_quilt2/tests/nextflow.config new file mode 100644 index 000000000000..30cbb8ab8f0a --- /dev/null +++ b/subworkflows/nf-core/bam_impute_quilt2/tests/nextflow.config @@ -0,0 +1,16 @@ +process { + withName: QUILT_QUILT2 { + cpus = 1 + ext.args = { "${params.quilt_args}" } + ext.prefix = { "${meta.id}_${meta.chr}_${meta.regionout}.quilt2" } + } + + withName: GLIMPSE2_LIGATE { + ext.prefix = { "${meta.id}_${meta.chr}.ligate" } + } + + withName: BCFTOOLS_INDEX { + ext.args = "--tbi" + publishDir = [enabled: false] + } +} From d16d0310cafa7243cb038cc629e7118c8c0b6f6c Mon Sep 17 00:00:00 2001 From: Anabella Trigila <18577080+atrigila@users.noreply.github.com> Date: Sat, 9 May 2026 16:31:01 -0300 Subject: [PATCH 2/8] publishDir not necessary for the unittest --- subworkflows/nf-core/bam_impute_quilt2/tests/nextflow.config | 1 - 1 file changed, 1 deletion(-) diff --git a/subworkflows/nf-core/bam_impute_quilt2/tests/nextflow.config b/subworkflows/nf-core/bam_impute_quilt2/tests/nextflow.config index 30cbb8ab8f0a..c9280911b4a0 100644 --- a/subworkflows/nf-core/bam_impute_quilt2/tests/nextflow.config +++ b/subworkflows/nf-core/bam_impute_quilt2/tests/nextflow.config @@ -11,6 +11,5 @@ process { withName: BCFTOOLS_INDEX { ext.args = "--tbi" - publishDir = [enabled: false] } } From a7130d338bc27b6ccf8ed31f4a3b10a2e89c00bd Mon Sep 17 00:00:00 2001 From: Anabella Trigila <18577080+atrigila@users.noreply.github.com> Date: Sat, 9 May 2026 16:32:46 -0300 Subject: [PATCH 3/8] add a line to explain that the regionout key will be used to store temporarily the region and therefore shouldn't be used in the meta map --- subworkflows/nf-core/bam_impute_quilt2/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subworkflows/nf-core/bam_impute_quilt2/meta.yml b/subworkflows/nf-core/bam_impute_quilt2/meta.yml index 73b470ceb88e..e131aeaddf85 100644 --- a/subworkflows/nf-core/bam_impute_quilt2/meta.yml +++ b/subworkflows/nf-core/bam_impute_quilt2/meta.yml @@ -1,7 +1,7 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json name: "bam_impute_quilt2" description: | - Impute low-coverage BAM or CRAM inputs with QUILT2 and ligate chunked outputs per chromosome. + Impute low-coverage BAM or CRAM inputs with QUILT2 and ligate chunked outputs per chromosome. 'Region out' key will be used to store temporarily the region and therefore shouldn't be used in the meta maps. keywords: - bam - cram From 51129fc42d98ae8650af3e09192334d317b9ae15 Mon Sep 17 00:00:00 2001 From: Anabella Trigila <18577080+atrigila@users.noreply.github.com> Date: Sat, 9 May 2026 16:34:35 -0300 Subject: [PATCH 4/8] QUILT2 uses topics for versions --- subworkflows/nf-core/bam_impute_quilt2/main.nf | 2 -- 1 file changed, 2 deletions(-) diff --git a/subworkflows/nf-core/bam_impute_quilt2/main.nf b/subworkflows/nf-core/bam_impute_quilt2/main.nf index 0053051180bd..8dc9148a39f4 100644 --- a/subworkflows/nf-core/bam_impute_quilt2/main.nf +++ b/subworkflows/nf-core/bam_impute_quilt2/main.nf @@ -53,8 +53,6 @@ workflow BAM_IMPUTE_QUILT2 { } QUILT_QUILT2(ch_bam_params, ch_fasta) - ch_versions = ch_versions.mix(QUILT_QUILT2.out.versions_r_quilt) - ch_versions = ch_versions.mix(QUILT_QUILT2.out.versions_r_base) ligate_input = QUILT_QUILT2.out.vcf .join(QUILT_QUILT2.out.tbi) From da4160cdd5b8287aa144f1eb27961d654997c5f0 Mon Sep 17 00:00:00 2001 From: Anabella Trigila <18577080+atrigila@users.noreply.github.com> Date: Sat, 9 May 2026 16:43:16 -0300 Subject: [PATCH 5/8] Add a test with the optional bamnames input file to ensure it does work properly --- .../bam_impute_quilt2/tests/main.nf.test | 53 ++++++++++++ .../bam_impute_quilt2/tests/main.nf.test.snap | 81 +++++++------------ 2 files changed, 81 insertions(+), 53 deletions(-) diff --git a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test index d66881ddd47d..200d58d41738 100644 --- a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test +++ b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test @@ -69,6 +69,59 @@ nextflow_workflow { } } + test("Impute with quilt2 one individual, one region, map, fasta and bamnames") { + when { + params { + quilt_args = "--seed=1" + } + workflow { + """ + bampath = channel.of("NA12878.chr21_22.1X.bam").collectFile(name: "bampath.txt", newLine: true) + bamname = channel.of("MySample1").collectFile(name: "bamname.txt", newLine: true) + input[0] = channel.of([ + [id: "allid"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/NA12878.chr21_22.1X.bam.bai", checkIfExists: true) + ]) + .combine(bampath) + .combine(bamname) + input[1] = channel.of([ + [id: "1000GP", chr: "chr22"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz.csi", checkIfExists: true) + ]) + input[2] = channel.of( + [[id: "1000GP", chr: "chr22"], "chr22", "16570000", "16610000"] + ) + input[3] = channel.of([ + [id: "1000GP", chr: "chr22"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr22.stitch.map", checkIfExists: true) + ]) + input[4] = channel.of([ + [id: "GRCh38"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genome.fasta", checkIfExists: true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genome.fasta.fai", checkIfExists: true) + ]).collect() + input[5] = 100 + input[6] = 10000 + """ + } + } + then { + assert workflow.success + assert snapshot( + workflow.out.vcf_index.collect { meta, vcf, index -> [ + path(vcf).getFileName().toString(), + path(index).getFileName().toString(), + path(vcf).vcf.summary, + path(vcf).vcf.header.getGenotypeSamples().sort(), + path(vcf).vcf.variantsMD5 + ]}, + workflow.out.versions.collect { it instanceof String ? path(it).yaml : it } + ).match() + } + } + test("homo_sapiens - empty channels - stub") { options "-stub" when { diff --git a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap index 0d6a47e7cd76..bc3306cfb92d 100644 --- a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap @@ -21,53 +21,37 @@ ] ], "versions": [ + + ] + } + ], + "timestamp": "2026-05-09T16:40:01.487040417", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "Impute with quilt2 one individual, one region, map, fasta and bamnames": { + "content": [ + [ + [ + "allid_chr22.ligate.vcf.gz", + "allid_chr22.ligate.vcf.gz.tbi", + "VcfFile [chromosomes=[chr22], sampleCount=1, variantCount=903, phased=true, phasedAutodetect=false]", [ - "BAM_IMPUTE_QUILT2:QUILT_QUILT2", - "r-base", - "4.4.3" - ], - [ - "BAM_IMPUTE_QUILT2:QUILT_QUILT2", - "r-base", - "4.4.3" - ], - [ - "BAM_IMPUTE_QUILT2:QUILT_QUILT2", - "r-base", - "4.4.3" - ], - [ - "BAM_IMPUTE_QUILT2:QUILT_QUILT2", - "r-base", - "4.4.3" - ], - [ - "BAM_IMPUTE_QUILT2:QUILT_QUILT2", - "r-quilt", - "2.0.4" - ], - [ - "BAM_IMPUTE_QUILT2:QUILT_QUILT2", - "r-quilt", - "2.0.4" - ], - [ - "BAM_IMPUTE_QUILT2:QUILT_QUILT2", - "r-quilt", - "2.0.4" + "MySample1" ], - [ - "BAM_IMPUTE_QUILT2:QUILT_QUILT2", - "r-quilt", - "2.0.4" - ] + "de865f8128d121d8ae4b5e4c3aa662e2" ] - } + ], + [ + + ] ], - "timestamp": "2026-04-15T18:38:49.393022606", + "timestamp": "2026-05-09T16:39:50.933749879", "meta": { "nf-test": "0.9.5", - "nextflow": "25.10.4" + "nextflow": "26.04.0" } }, "Impute with quilt2 one individual, one region, map and fasta": { @@ -84,22 +68,13 @@ ] ], [ - [ - "BAM_IMPUTE_QUILT2:QUILT_QUILT2", - "r-base", - "4.4.3" - ], - [ - "BAM_IMPUTE_QUILT2:QUILT_QUILT2", - "r-quilt", - "2.0.4" - ] + ] ], - "timestamp": "2026-04-15T18:41:23.30801371", + "timestamp": "2026-05-09T16:39:30.814000823", "meta": { "nf-test": "0.9.5", - "nextflow": "25.10.4" + "nextflow": "26.04.0" } } } \ No newline at end of file From cf4dac1d24bb2f041d5369a8f77c71ebb8cff1f4 Mon Sep 17 00:00:00 2001 From: Anabella Trigila <18577080+atrigila@users.noreply.github.com> Date: Mon, 11 May 2026 14:31:52 -0300 Subject: [PATCH 6/8] Update subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Louis Le Nézet <58640615+LouisLeNezet@users.noreply.github.com> --- subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test | 1 - 1 file changed, 1 deletion(-) diff --git a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test index 200d58d41738..8540090e605b 100644 --- a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test +++ b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test @@ -117,7 +117,6 @@ nextflow_workflow { path(vcf).vcf.header.getGenotypeSamples().sort(), path(vcf).vcf.variantsMD5 ]}, - workflow.out.versions.collect { it instanceof String ? path(it).yaml : it } ).match() } } From e4e0474b7ce3b8efabe1ee24e41b09c61b392584 Mon Sep 17 00:00:00 2001 From: Anabella Trigila <18577080+atrigila@users.noreply.github.com> Date: Mon, 11 May 2026 14:32:43 -0300 Subject: [PATCH 7/8] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Louis Le Nézet <58640615+LouisLeNezet@users.noreply.github.com> --- subworkflows/nf-core/bam_impute_quilt2/main.nf | 2 -- subworkflows/nf-core/bam_impute_quilt2/meta.yml | 5 +---- subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test | 1 - .../nf-core/bam_impute_quilt2/tests/main.nf.test.snap | 5 +---- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/subworkflows/nf-core/bam_impute_quilt2/main.nf b/subworkflows/nf-core/bam_impute_quilt2/main.nf index 8dc9148a39f4..78a1aad1f672 100644 --- a/subworkflows/nf-core/bam_impute_quilt2/main.nf +++ b/subworkflows/nf-core/bam_impute_quilt2/main.nf @@ -14,7 +14,6 @@ workflow BAM_IMPUTE_QUILT2 { main: - ch_versions = channel.empty() ch_parameters = ch_reference_panel .combine(ch_map, by: 0) @@ -74,5 +73,4 @@ workflow BAM_IMPUTE_QUILT2 { emit: vcf_index = ch_vcf_index // channel: [ meta, vcf, tbi/csi ] - versions = ch_versions // channel: [ versions.yml ] or topic-based version tuples } diff --git a/subworkflows/nf-core/bam_impute_quilt2/meta.yml b/subworkflows/nf-core/bam_impute_quilt2/meta.yml index e131aeaddf85..90b060587921 100644 --- a/subworkflows/nf-core/bam_impute_quilt2/meta.yml +++ b/subworkflows/nf-core/bam_impute_quilt2/meta.yml @@ -1,7 +1,7 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json name: "bam_impute_quilt2" description: | - Impute low-coverage BAM or CRAM inputs with QUILT2 and ligate chunked outputs per chromosome. 'Region out' key will be used to store temporarily the region and therefore shouldn't be used in the meta maps. + Impute low-coverage BAM or CRAM inputs with QUILT2 and ligate chunked outputs per chromosome. 'regionout' key will be used to store temporarily the region and therefore shouldn't be used in the meta maps. keywords: - bam - cram @@ -122,9 +122,6 @@ output: type: file description: Index for the imputed VCF or BCF file. pattern: "*.{tbi,csi}" - - versions: - description: | - Collected software version information emitted by the constituent modules. authors: - "@atrigila" maintainers: diff --git a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test index 8540090e605b..3354cf046bce 100644 --- a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test +++ b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test @@ -64,7 +64,6 @@ nextflow_workflow { path(vcf).vcf.header.getGenotypeSamples().sort(), path(vcf).vcf.variantsMD5 ]}, - workflow.out.versions.collect { it instanceof String ? path(it).yaml : it } ).match() } } diff --git a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap index bc3306cfb92d..2ee2ceee3fe0 100644 --- a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap @@ -23,7 +23,7 @@ "versions": [ ] - } + ] ], "timestamp": "2026-05-09T16:40:01.487040417", "meta": { @@ -43,9 +43,6 @@ ], "de865f8128d121d8ae4b5e4c3aa662e2" ] - ], - [ - ] ], "timestamp": "2026-05-09T16:39:50.933749879", From 52998ef0ee3a46ba6d6e728dade46af2db8aa9fa Mon Sep 17 00:00:00 2001 From: Anabella Trigila <18577080+atrigila@users.noreply.github.com> Date: Sun, 17 May 2026 12:21:26 -0300 Subject: [PATCH 8/8] fix linting --- .../nf-core/bam_impute_quilt2/tests/main.nf.test.snap | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap index 2ee2ceee3fe0..d53730c9e804 100644 --- a/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap +++ b/subworkflows/nf-core/bam_impute_quilt2/tests/main.nf.test.snap @@ -19,11 +19,8 @@ "allid_chr22.ligate.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", "allid_chr22.ligate.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" ] - ], - "versions": [ - - ] ] + } ], "timestamp": "2026-05-09T16:40:01.487040417", "meta": { @@ -63,9 +60,6 @@ ], "de865f8128d121d8ae4b5e4c3aa662e2" ] - ], - [ - ] ], "timestamp": "2026-05-09T16:39:30.814000823", @@ -74,4 +68,4 @@ "nextflow": "26.04.0" } } -} \ No newline at end of file +}