diff --git a/modules/nf-core/beagle5/beagle/main.nf b/modules/nf-core/beagle5/beagle/main.nf index 93ffbc6a3a98..e66c9e40b019 100644 --- a/modules/nf-core/beagle5/beagle/main.nf +++ b/modules/nf-core/beagle5/beagle/main.nf @@ -8,7 +8,9 @@ process BEAGLE5_BEAGLE { 'biocontainers/beagle:5.5_27Feb25.75f--hdfd78af_0' }" input: - tuple val(meta), path(vcf), path(vcf_index), path(refpanel), path(refpanel_index), path(genmap), path(exclsamples), path(exclmarkers) + // Including `val(region)` to prevent errors with multi-chromosome VCFs and single-chromosome reference panels. + // This enhances clarity and simplifies implementation in the subworkflow. + tuple val(meta), path(vcf), path(vcf_index), path(refpanel), path(refpanel_index), path(genmap), path(exclsamples), path(exclmarkers), val(region) output: tuple val(meta), path("*.vcf.gz"), emit: vcf @@ -22,7 +24,8 @@ process BEAGLE5_BEAGLE { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}.bglout" def ref_command = refpanel ? "ref=$refpanel" : "" - def map_command = genmap ? "map=$genmap" : "" + def map_command = genmap ? "map=$genmap" : "" + def region_cmd = region ? "chrom=$region" : "" def excludesamples_command = exclsamples ? "excludesamples=$exclsamples" : "" def excludemarkers_command = exclmarkers ? "excludemarkers=$exclmarkers" : "" @@ -40,8 +43,9 @@ process BEAGLE5_BEAGLE { $args \\ ${ref_command} \\ ${map_command} \\ + ${region_cmd} \\ ${excludesamples_command} \\ - ${excludemarkers_command} \\ + ${excludemarkers_command} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/beagle5/beagle/meta.yml b/modules/nf-core/beagle5/beagle/meta.yml index 100d915bc59e..8f32c9a7c7ea 100644 --- a/modules/nf-core/beagle5/beagle/meta.yml +++ b/modules/nf-core/beagle5/beagle/meta.yml @@ -57,6 +57,10 @@ input: the analysis pattern: "*.*" ontologies: [] + - region: + type: string + description: Region to perform imputation + pattern: "(chr)?\\d*:\\d*-\\d*" output: vcf: - - meta: diff --git a/modules/nf-core/beagle5/beagle/tests/main.nf.test b/modules/nf-core/beagle5/beagle/tests/main.nf.test index a8aaee4d3402..6157c15b99d8 100644 --- a/modules/nf-core/beagle5/beagle/tests/main.nf.test +++ b/modules/nf-core/beagle5/beagle/tests/main.nf.test @@ -5,8 +5,6 @@ nextflow_process { script "../main.nf" process "BEAGLE5_BEAGLE" - config "./nextflow.config" - tag "modules" tag "modules_nfcore" tag "beagle5" @@ -15,16 +13,13 @@ nextflow_process { test("test-beagle5-beagle") { when { - params { - module_args = "" - } process { """ input[0] = [ [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz", checkIfExists: true), file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz.csi", checkIfExists: true), - [], [], [], [], [] + [], [], [], [], [], [] ] """ } @@ -46,9 +41,6 @@ nextflow_process { test("test-beagle5-beagle-ref") { when { - params { - module_args = "chrom=chr22" - } process { """ input[0] = [ @@ -57,7 +49,7 @@ nextflow_process { file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz.csi", checkIfExists: true), 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), - [], [], [] + [], [], [], "chr22" ] """ } @@ -78,9 +70,6 @@ nextflow_process { test("test-beagle5-beagle-ref-map") { when { - params { - module_args = "chrom=chr22" - } process { """ input[0] = [ @@ -90,7 +79,7 @@ nextflow_process { 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), file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr22.plink.map"), - [], [] + [], [], "chr22" ] """ } @@ -112,16 +101,13 @@ nextflow_process { test("test-beagle5-beagle-ref-map - stub") { options '-stub' when { - params { - module_args = "" - } process { """ input[0] = [ [ id:'test', single_end:false ], // meta map file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz", checkIfExists: true), file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz.csi", checkIfExists: true), - [], [], [], [], [] + [], [], [], [], [], [] ] """ } diff --git a/modules/nf-core/beagle5/beagle/tests/nextflow.config b/modules/nf-core/beagle5/beagle/tests/nextflow.config deleted file mode 100644 index fe87f4a4cf57..000000000000 --- a/modules/nf-core/beagle5/beagle/tests/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - withName: "BEAGLE5_BEAGLE" { - ext.args = params.module_args - } -} diff --git a/subworkflows/nf-core/vcf_impute_beagle5/main.nf b/subworkflows/nf-core/vcf_impute_beagle5/main.nf new file mode 100644 index 000000000000..3ccb03229b61 --- /dev/null +++ b/subworkflows/nf-core/vcf_impute_beagle5/main.nf @@ -0,0 +1,116 @@ +include { BEAGLE5_BEAGLE } from '../../../modules/nf-core/beagle5/beagle' +include { BCFTOOLS_VIEW } from '../../../modules/nf-core/bcftools/view' +include { GLIMPSE2_LIGATE } from '../../../modules/nf-core/glimpse2/ligate' +include { BCFTOOLS_INDEX as BCFTOOLS_INDEX_BEAGLE } from '../../../modules/nf-core/bcftools/index' +include { BCFTOOLS_INDEX as BCFTOOLS_INDEX_LIGATE } from '../../../modules/nf-core/bcftools/index' + +workflow VCF_IMPUTE_BEAGLE5 { + + take: + ch_input // channel (mandatory): [ [id], vcf, tbi ] + ch_panel // channel (mandatory): [ [panel, chr], vcf, tbi ] + ch_chunks // channel (optional) : [ [panel, chr], regionout ] + ch_map // channel (optional) : [ [chr], map] + + main: + ch_versions = channel.empty() + + // Branch input files based on format + ch_input + .branch { _meta, vcf, _tbi -> + bcf: vcf.name.contains('.bcf') + vcf: vcf.name.contains('.vcf') + other: true + } + .set { ch_input_branched } + + ch_input_branched.other.map{ _meta, vcf, _tbi -> + error "ERROR: ${vcf.name} in ch_input channel must be in VCF or BCF format." + } + + // Convert BCF to VCF if necessary + BCFTOOLS_VIEW( + ch_input_branched.bcf, + [], [], [] + ) + ch_versions = ch_versions.mix(BCFTOOLS_VIEW.out.versions.first()) + + // Combine VCF files + ch_ready_vcf = ch_input_branched.vcf + .mix(BCFTOOLS_VIEW.out.vcf + .join( + BCFTOOLS_VIEW.out.csi + .mix(BCFTOOLS_VIEW.out.tbi) + ) + ) + + // Prepare input channels for BEAGLE5 by combining VCF, panel, and map files + ch_chunks_counts = ch_chunks + .groupTuple() + .map { metaPC, regionouts -> + [metaPC, regionouts.size()] + } + + ch_panel_map = ch_panel + .combine(ch_map, by: 0) + .combine(ch_chunks, by: 0) + .combine(ch_chunks_counts, by: 0) + + ch_panel_map.ifEmpty{ + error "ERROR: join operation resulted in an empty channel. Please provide a valid ch_panel and ch_map channel as input." + } + + ch_beagle_input = ch_ready_vcf + .combine(ch_panel_map) + .map { metaI, input_vcf, input_index, metaPC, panel_vcf, panel_index, map, regionout, regionsize -> [ + metaI + metaPC + ["regionout": regionout, "regionsize": regionsize], + input_vcf, input_index, + panel_vcf, panel_index, + map, [], [], regionout + ]} + + // Run BEAGLE5 imputation + BEAGLE5_BEAGLE(ch_beagle_input) + ch_versions = ch_versions.mix(BEAGLE5_BEAGLE.out.versions.first()) + + // Index the imputed VCF files + BCFTOOLS_INDEX_BEAGLE(BEAGLE5_BEAGLE.out.vcf) + ch_versions = ch_versions.mix(BCFTOOLS_INDEX_BEAGLE.out.versions.first()) + + // Ligate all phased files in one and index it + ligate_input = BEAGLE5_BEAGLE.out.vcf + .join( + BCFTOOLS_INDEX_BEAGLE.out.tbi + .mix(BCFTOOLS_INDEX_BEAGLE.out.csi) + ) + .map{ meta, vcf, index -> + def keysToKeep = meta.keySet() - ['regionout', 'regionsize'] + [ + groupKey(meta.subMap(keysToKeep), meta.regionsize), + vcf, index + ] + } + .groupTuple() + .map{ groupKeyObj, vcf, index -> + // Extract the actual meta from the groupKey + def meta = groupKeyObj.getGroupTarget() + [meta, vcf, index] + } + + GLIMPSE2_LIGATE( ligate_input ) + ch_versions = ch_versions.mix( GLIMPSE2_LIGATE.out.versions.first() ) + + BCFTOOLS_INDEX_LIGATE( GLIMPSE2_LIGATE.out.merged_variants ) + ch_versions = ch_versions.mix( BCFTOOLS_INDEX_LIGATE.out.versions.first() ) + + // Join imputed and index files + ch_vcf_index = GLIMPSE2_LIGATE.out.merged_variants + .join( + BCFTOOLS_INDEX_LIGATE.out.tbi + .mix(BCFTOOLS_INDEX_LIGATE.out.csi) + ) + + emit: + vcf_index = ch_vcf_index // channel: [ [id, chr, tools], vcf, index ] + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/vcf_impute_beagle5/meta.yml b/subworkflows/nf-core/vcf_impute_beagle5/meta.yml new file mode 100644 index 000000000000..a207e20bdfd1 --- /dev/null +++ b/subworkflows/nf-core/vcf_impute_beagle5/meta.yml @@ -0,0 +1,100 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: VCF_IMPUTE_BEAGLE5 +description: | + Subworkflow to impute VCF files using BEAGLE5 software. The subworkflow + takes VCF files, phased reference panel, genetic maps and chunks region to perform imputation + and outputs phased and imputed VCF files. + Meta map of all channels, except ch_input, will be used to perform joint operations. + "regionout" and "regionsize" keys will be added to the meta map to distinguish the different + file before ligation and therefore should not be used. +keywords: + - VCF + - imputation + - beagle5 + - phasing +components: + - beagle5/beagle + - bcftools/index + - bcftools/view + - glimpse2/ligate +input: + - ch_input: + description: Channel with input data + structure: + - meta: + type: map + description: | + Metadata map containing sample information + - vcf: + type: file + description: Input VCF files + pattern: "*.{vcf,bcf}{.gz}?" + - index: + type: file + description: Input index file + pattern: "*.{tbi,csi}" + - ch_panel: + description: Channel with phased reference panel data + structure: + - meta: + type: map + description: | + Metadata map that will be combined with the input data map + - vcf: + type: file + description: Reference panel VCF files by chromosomes + pattern: "*.{vcf,bcf,vcf.gz}" + - index: + type: file + description: Reference panel VCF index files + pattern: "*.{tbi,csi}" + - ch_chunks: + description: Channel containing the region to impute + structure: + - meta: + type: map + description: | + Metadata map containing chromosome information + - regionout: + type: string + description: Region to perform the phasing on + pattern: "[chr]+[0-9]+:[0-9]+-[0-9]+" + - ch_map: + description: Channel with genetic map data + structure: + - meta: + type: map + description: | + Metadata map containing chromosome information + - map: + type: file + description: Plink format genetic map files + pattern: "*.map" +output: + - vcf_index: + description: Channel with imputed and phased VCF files + structure: + - meta: + type: map + description: | + Metadata map of the target input file combined with the reference panel map. + - vcf: + type: file + description: VCF imputed and phased file by sample + pattern: "*.{vcf,bcf,vcf.gz}" + - index: + type: file + description: VCF index file + pattern: "*.{tbi,csi}" + - versions: + description: Channel containing software versions file + structure: + - versions.yml: + type: file + description: File containing versions of the software used +authors: + - "@LouisLeNezet" + - "@gichas" +maintainers: + - "@LouisLeNezet" + - "@gichas" diff --git a/subworkflows/nf-core/vcf_impute_beagle5/tests/main.nf.test b/subworkflows/nf-core/vcf_impute_beagle5/tests/main.nf.test new file mode 100644 index 000000000000..448d23769d66 --- /dev/null +++ b/subworkflows/nf-core/vcf_impute_beagle5/tests/main.nf.test @@ -0,0 +1,237 @@ +nextflow_workflow { + + name "Test Subworkflow VCF_IMPUTE_BEAGLE5" + script "../main.nf" + workflow "VCF_IMPUTE_BEAGLE5" + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/vcf_impute_beagle5" + + config "./nextflow.config" + + tag "beagle5" + tag "beagle5/beagle" + tag "bcftools" + tag "bcftools/index" + tag "bcftools/view" + tag "glimpse2" + tag "glimpse2/ligate" + + + test("Impute with beagle5 one vcf - panel - whole chromosome - no map - one chromosomes") { + when { + workflow { + """ + input[0] = Channel.of([ + [id: "NA12878"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz", checkIfExist:true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz.csi", checkIfExist:true) + ]) + input[1] = Channel.of([ + [panel: "1000GP", chr: "chr22"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz", checkIfExist:true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz.csi", checkIfExist:true) + ]) + input[2] = Channel.of([[panel: "1000GP", chr: "chr22"], "chr22"]) // chunks + input[3] = Channel.of([[panel: "1000GP", chr: "chr22"], []]) + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out.vcf_index.collect{[ + it[0], + path(it[1]).getFileName().toString(), + path(it[2]).getFileName().toString(), + path(it[1]).vcf.summary, + path(it[1]).vcf.header.getGenotypeSamples().sort(), + path(it[1]).vcf.variantsMD5 + ]}, + workflow.out.versions, + workflow.out.versions.collect{ path(it).yaml } + ).match() } + ) + } + } + + test("Impute with beagle5 one bcf gz - panel - map - chunks - two chrosomes") { + setup { + run ("BCFTOOLS_VIEW", alias: "BCFTOOLS_VIEW_BCF" ) { + script "../../../../modules/nf-core/bcftools/view" + process { + """ + input[0] = channel.of([ + [id: "NA12878"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz", checkIfExist:true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz.csi", checkIfExist:true) + ]) + input[1] = [] + input[2] = [] + input[3] = [] + """ + } + } + } + when { + params { + bcftools_view_args = "--write-index=csi --output-type b" + } + workflow { + """ + input[0] = BCFTOOLS_VIEW_BCF.out.vcf.join(BCFTOOLS_VIEW_BCF.out.csi) + input[1] = channel.of([ + [panel: "1000GP", chr: "chr22"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz", checkIfExist:true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.vcf.gz.csi", checkIfExist:true) + ],[ + [panel: "1000GP", chr: "chr21"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr21.vcf.gz", checkIfExist:true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr21.vcf.gz.csi", checkIfExist:true) + ]) + input[2] = channel.of( + [[chr: "chr22", panel: "1000GP"], "chr22:16570065-16592216"], + [[chr: "chr22", panel: "1000GP"], "chr22:16592229-16609999"], + [[chr: "chr21", panel: "1000GP"], "chr21:16570065-16592216"], + [[chr: "chr21", panel: "1000GP"], "chr21:16592229-16609999"] + ) + input[3] = channel.of([ + [panel: "1000GP", chr: "chr22"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr22.plink.map", checkIfExist:true) + ],[ + [panel: "1000GP", chr: "chr21"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr21.plink.map", checkIfExist:true) + ]) + """ + } + } + + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out.vcf_index.collect{[ + it[0], + path(it[1]).getFileName().toString(), + path(it[2]).getFileName().toString(), + path(it[1]).vcf.summary, + path(it[1]).vcf.header.getGenotypeSamples().sort(), + path(it[1]).vcf.variantsMD5 + ]}, + workflow.out.versions.collect{ path(it).yaml } + ).match() } + ) + } + } + + test("homo_sapiens - empty channels - stub") { + options "-stub" + when { + workflow { + """ + input[0] = channel.of([ + [id: "NA12878"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz", checkIfExist:true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz.csi", checkIfExist:true) + ]) + input[1] = channel.of( + [[panel: "1000GP", chr: "chr22"], [], []], + [[panel: "1000GP", chr: "chr21"], [], []] + ) + input[2] = channel.of( + [[chr: "chr22", panel: "1000GP"], "chr22:16570065-16592216"], + [[chr: "chr22", panel: "1000GP"], "chr22:16592229-16609999"], + [[chr: "chr21", panel: "1000GP"], "chr21:16570065-16592216"], + [[chr: "chr21", panel: "1000GP"], "chr21:16592229-16609999"] + ) + input[3] = channel.of( + [[panel: "1000GP", chr: "chr22"], []], + [[panel: "1000GP", chr: "chr21"], []] + ) + """ + } + } + then { + assertAll( + { assert workflow.success }, + { assert snapshot( + workflow.out, + workflow.out.versions.collect{ path(it).yaml } + ).match() } + ) + } + } + + test("homo_sapiens - error wrong input format - stub") { + options "-stub" + when { + workflow { + """ + input[0] = channel.of([ + [id: "NA12878"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr22.minimac.map", checkIfExist:true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz.csi", checkIfExist:true) + ]) + input[1] = channel.of( + [[panel: "1000GP", chr: "chr22"], [], []], + [[panel: "1000GP", chr: "chr21"], [], []] + ) + input[2] = channel.of( + [[chr: "chr22", panel: "1000GP"], "chr22:16570065-16592216"], + [[chr: "chr22", panel: "1000GP"], "chr22:16592229-16609999"], + [[chr: "chr21", panel: "1000GP"], "chr21:16570065-16592216"], + [[chr: "chr21", panel: "1000GP"], "chr21:16592229-16609999"] + ) + input[3] = channel.of( + [[panel: "1000GP", chr: "chr22"], []], + [[panel: "1000GP", chr: "chr21"], []] + ) + """ + } + } + then { + assertAll( + { assert workflow.failed }, + { assert workflow.errorMessage.contains("ERROR: genome.GRCh38.chr22.minimac.map in ch_input channel must be in VCF or BCF format.") } + ) + } + } + + test("homo_sapiens - error empty joint - stub") { + options "-stub" + when { + workflow { + """ + input[0] = channel.of([ + [id: "NA12878"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz", checkIfExist:true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/vcf/NA12878.chr21_22.1X.glimpse2.vcf.gz.csi", checkIfExist:true) + ]) + input[1] = channel.of( + [[panel: "1000GP_1", chr: "chr22"], [], []], // Wrong panel + [[panel: "1000GP", chr: "chr21"], [], []] + ) + input[2] = channel.of( + [[chr: "chr22", panel: "1000GP"], "chr22:16570065-16592216"], + [[chr: "chr22", panel: "1000GP"], "chr22:16592229-16609999"], + [[chr: "chr21", panel: "1000GP"], "chr21:16570065-16592216"], + [[chr: "chr21", panel: "1000GP"], "chr21:16592229-16609999"] + ) + input[3] = channel.of( + [[panel: "1000GP", chr: "chr22"], []], + [[panel: "1000GP_1", chr: "chr21"], []] // Wrong panel + ) + """ + } + } + then { + assertAll( + { assert workflow.failed }, + { assert workflow.errorMessage.contains("ERROR: join operation resulted in an empty channel. Please provide a valid ch_panel and ch_map channel as input.") } + ) + } + } +} diff --git a/subworkflows/nf-core/vcf_impute_beagle5/tests/main.nf.test.snap b/subworkflows/nf-core/vcf_impute_beagle5/tests/main.nf.test.snap new file mode 100644 index 000000000000..36c113694362 --- /dev/null +++ b/subworkflows/nf-core/vcf_impute_beagle5/tests/main.nf.test.snap @@ -0,0 +1,206 @@ +{ + "Impute with beagle5 one vcf - panel - whole chromosome - no map - one chromosomes": { + "content": [ + [ + [ + { + "id": "NA12878", + "panel": "1000GP", + "chr": "chr22" + }, + "NA12878_chr22.ligate.vcf.gz", + "NA12878_chr22.ligate.vcf.gz.csi", + "VcfFile [chromosomes=[chr22], sampleCount=1, variantCount=903, phased=true, phasedAutodetect=true]", + [ + "NA12878" + ], + "9cab6e975108d5f6dbb7773b794711c2" + ] + ], + [ + "versions.yml:md5,055ba50f00b32df929e0e147ba6d4408", + "versions.yml:md5,3ba3affc995d9a03ef59f8cf9e7fac38", + "versions.yml:md5,e4c10555396b9a57ef3aafc9a4707963", + "versions.yml:md5,ff3101d4f934dc550b466d79e092707c" + ], + [ + { + "VCF_IMPUTE_BEAGLE5:BCFTOOLS_INDEX_BEAGLE": { + "bcftools": 1.22 + } + }, + { + "VCF_IMPUTE_BEAGLE5:BEAGLE5_BEAGLE": { + "beagle": "5.5rev27Feb25.75f" + } + }, + { + "VCF_IMPUTE_BEAGLE5:BCFTOOLS_INDEX_LIGATE": { + "bcftools": 1.22 + } + }, + { + "VCF_IMPUTE_BEAGLE5:GLIMPSE2_LIGATE": { + "glimpse2": "2.0.0" + } + } + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-11T10:40:58.515114119" + }, + "homo_sapiens - empty channels - stub": { + "content": [ + { + "0": [ + [ + { + "id": "NA12878", + "chr": "chr21", + "panel": "1000GP" + }, + "NA12878_chr21.ligate.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "NA12878_chr21.ligate.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "NA12878", + "chr": "chr22", + "panel": "1000GP" + }, + "NA12878_chr22.ligate.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "NA12878_chr22.ligate.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,055ba50f00b32df929e0e147ba6d4408", + "versions.yml:md5,3ba3affc995d9a03ef59f8cf9e7fac38", + "versions.yml:md5,e4c10555396b9a57ef3aafc9a4707963", + "versions.yml:md5,ff3101d4f934dc550b466d79e092707c" + ], + "vcf_index": [ + [ + { + "id": "NA12878", + "chr": "chr21", + "panel": "1000GP" + }, + "NA12878_chr21.ligate.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "NA12878_chr21.ligate.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "NA12878", + "chr": "chr22", + "panel": "1000GP" + }, + "NA12878_chr22.ligate.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "NA12878_chr22.ligate.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,055ba50f00b32df929e0e147ba6d4408", + "versions.yml:md5,3ba3affc995d9a03ef59f8cf9e7fac38", + "versions.yml:md5,e4c10555396b9a57ef3aafc9a4707963", + "versions.yml:md5,ff3101d4f934dc550b466d79e092707c" + ] + }, + [ + { + "VCF_IMPUTE_BEAGLE5:BCFTOOLS_INDEX_BEAGLE": { + "bcftools": 1.22 + } + }, + { + "VCF_IMPUTE_BEAGLE5:BEAGLE5_BEAGLE": { + "beagle": "5.5rev27Feb25.75f" + } + }, + { + "VCF_IMPUTE_BEAGLE5:BCFTOOLS_INDEX_LIGATE": { + "bcftools": 1.22 + } + }, + { + "VCF_IMPUTE_BEAGLE5:GLIMPSE2_LIGATE": { + "glimpse2": "2.0.0" + } + } + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-11T10:37:59.303608442" + }, + "Impute with beagle5 one bcf gz - panel - map - chunks - two chrosomes": { + "content": [ + [ + [ + { + "id": "NA12878", + "chr": "chr21", + "panel": "1000GP" + }, + "NA12878_chr21.ligate.vcf.gz", + "NA12878_chr21.ligate.vcf.gz.csi", + "VcfFile [chromosomes=[chr21], sampleCount=1, variantCount=836, phased=true, phasedAutodetect=true]", + [ + "NA12878" + ], + "70c852b39eb228a54fabc564d7e536e4" + ], + [ + { + "id": "NA12878", + "chr": "chr22", + "panel": "1000GP" + }, + "NA12878_chr22.ligate.vcf.gz", + "NA12878_chr22.ligate.vcf.gz.csi", + "VcfFile [chromosomes=[chr22], sampleCount=1, variantCount=903, phased=true, phasedAutodetect=true]", + [ + "NA12878" + ], + "9cab6e975108d5f6dbb7773b794711c2" + ] + ], + [ + { + "VCF_IMPUTE_BEAGLE5:BCFTOOLS_INDEX_BEAGLE": { + "bcftools": 1.22 + } + }, + { + "VCF_IMPUTE_BEAGLE5:BEAGLE5_BEAGLE": { + "beagle": "5.5rev27Feb25.75f" + } + }, + { + "VCF_IMPUTE_BEAGLE5:BCFTOOLS_INDEX_LIGATE": { + "bcftools": 1.22 + } + }, + { + "VCF_IMPUTE_BEAGLE5:BCFTOOLS_VIEW": { + "bcftools": 1.22 + } + }, + { + "VCF_IMPUTE_BEAGLE5:GLIMPSE2_LIGATE": { + "glimpse2": "2.0.0" + } + } + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-11T10:41:17.021023357" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/vcf_impute_beagle5/tests/nextflow.config b/subworkflows/nf-core/vcf_impute_beagle5/tests/nextflow.config new file mode 100644 index 000000000000..9be75a1c7cb9 --- /dev/null +++ b/subworkflows/nf-core/vcf_impute_beagle5/tests/nextflow.config @@ -0,0 +1,25 @@ +process { + withName: BCFTOOLS_VIEW { + ext.args = { "--write-index=tbi --output-type z" } + } + + withName: BEAGLE5_BEAGLE { + ext.prefix = { "${meta.id}_${meta.regionout}" } + } + + withName: GLIMPSE2_LIGATE { + ext.prefix = { "${meta.id}_${meta.chr}.ligate" } + } + + withName: BCFTOOLS_INDEX_BEAGLE { + ext.args = '--tbi' + } + + withName: BCFTOOLS_INDEX_LIGATE { + ext.args = '--csi' + } + + withName: BCFTOOLS_VIEW_BCF { + ext.args = { params.bcftools_view_args ?: "" } + } +}