diff --git a/modules/nf-core/minimac4/impute/main.nf b/modules/nf-core/minimac4/impute/main.nf index d4a3e52201d..c26454cc4da 100644 --- a/modules/nf-core/minimac4/impute/main.nf +++ b/modules/nf-core/minimac4/impute/main.nf @@ -8,7 +8,7 @@ process MINIMAC4_IMPUTE { 'biocontainers/minimac4:4.1.6--hcb620b3_1' }" input: - tuple val(meta), path(target_vcf), path(target_index), path(ref_msav), path(sites_vcf), path(sites_index), path(map) + tuple val(meta), path(target_vcf), path(target_index), path(ref_msav), path(sites_vcf), path(sites_index), path(map), val(region) output: tuple val(meta), path("*.{bcf,sav,vcf.gz,vcf,ubcf,usav}"), emit: vcf @@ -18,17 +18,18 @@ process MINIMAC4_IMPUTE { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def extension = args.contains("--output-format bcf") || args.contains("-O bcf") ? "bcf" : + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def extension = args.contains("--output-format bcf") || args.contains("-O bcf") ? "bcf" : args.contains("--output-format sav") || args.contains("-O sav") ? "sav" : args.contains("--output-format vcf.gz") || args.contains("-O vcf.gz") ? "vcf.gz" : args.contains("--output-format vcf") || args.contains("-O vcf") ? "vcf" : args.contains("--output-format ubcf") || args.contains("-O ubcf") ? "ubcf" : args.contains("--output-format usav") || args.contains("-O usav") ? "usav" : "vcf.gz" - def sites_cmd = sites_vcf ? "--sites $sites_vcf" : "" - def map_cmd = map ? "--map $map" : "" + def sites_cmd = sites_vcf ? "--sites $sites_vcf" : "" + def map_cmd = map ? "--map $map" : "" + def region_cmd = region ? "--region $region" : "" """ minimac4 \\ $ref_msav \\ @@ -36,6 +37,7 @@ process MINIMAC4_IMPUTE { $args \\ $sites_cmd \\ $map_cmd \\ + $region_cmd \\ --threads $task.cpus \\ -o ${prefix}.${extension} diff --git a/modules/nf-core/minimac4/impute/meta.yml b/modules/nf-core/minimac4/impute/meta.yml index 6c7cbf7b791..5c1931b07c7 100644 --- a/modules/nf-core/minimac4/impute/meta.yml +++ b/modules/nf-core/minimac4/impute/meta.yml @@ -58,6 +58,10 @@ input: pattern: "*.map" ontologies: - edam: "http://edamontology.org/data_1278" + - region: + type: string + description: Region to perform imputation + pattern: "(chr)?\\d*:\\d*-\\d*" output: vcf: diff --git a/modules/nf-core/minimac4/impute/tests/main.nf.test b/modules/nf-core/minimac4/impute/tests/main.nf.test index d2d075b6fb1..9657df7a815 100644 --- a/modules/nf-core/minimac4/impute/tests/main.nf.test +++ b/modules/nf-core/minimac4/impute/tests/main.nf.test @@ -45,7 +45,7 @@ nextflow_process { .combine(MINIMAC4_COMPRESSREF.out.msav) .map{ meta, target_vcf, target_index, sites_vcf, sites_index, map, metaRef, ref -> [ - meta, target_vcf, target_index, ref, sites_vcf, sites_index, map + meta, target_vcf, target_index, ref, sites_vcf, sites_index, map, "chr22" ] } """ @@ -86,7 +86,7 @@ nextflow_process { .combine(MINIMAC4_COMPRESSREF.out.msav) .map{ meta, target_vcf, target_index, metaRef, ref -> [ - meta, target_vcf, target_index, ref, [], [], [] + meta, target_vcf, target_index, ref, [], [], [], [] ] } """ @@ -126,7 +126,7 @@ nextflow_process { [id: "NA12878", chr: "chr22"], 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/subworkflows/nf-core/vcf_impute_minimac4/main.nf b/subworkflows/nf-core/vcf_impute_minimac4/main.nf new file mode 100644 index 00000000000..655e0224a8a --- /dev/null +++ b/subworkflows/nf-core/vcf_impute_minimac4/main.nf @@ -0,0 +1,96 @@ +include { MINIMAC4_COMPRESSREF } from '../../../modules/nf-core/minimac4/compressref' +include { MINIMAC4_IMPUTE } from '../../../modules/nf-core/minimac4/impute' +include { GLIMPSE2_LIGATE } from '../../../modules/nf-core/glimpse2/ligate' +include { BCFTOOLS_INDEX as BCFTOOLS_INDEX_1 } from '../../../modules/nf-core/bcftools/index' +include { BCFTOOLS_INDEX as BCFTOOLS_INDEX_2 } from '../../../modules/nf-core/bcftools/index' + +workflow VCF_IMPUTE_MINIMAC4 { + + take: + ch_input // channel (mandatory): [ [id, chr], vcf, tbi ] + ch_panel // channel (mandatory): [ [panel, chr], vcf, tbi ] + ch_posfile // channel (optional) : [ [panel, chr], sites_vcf, sites_index ] + ch_chunks // channel (optional) : [ [panel, chr], regionout ] + ch_map // channel (optional) : [ [panel, chr], map] + + main: + + ch_versions = channel.empty() + + ch_panel_branched = ch_panel.branch { _meta, file, _index -> + def name = file.toString() + vcf : name.matches(/.*\.(vcf|bcf)(\.gz)?$/) + msav : name.endsWith('.msav') + other: true + } + + ch_panel_branched.other.map{ + error "ERROR: ch_panel files must be either VCF/BCF or MSAV." + } + + // Compress reference panel to MSAV format + MINIMAC4_COMPRESSREF(ch_panel_branched.vcf) + ch_versions = ch_versions.mix(MINIMAC4_COMPRESSREF.out.versions.first()) + + ch_panel_msav = MINIMAC4_COMPRESSREF.out.msav + .mix( + ch_panel_branched.msav.map{ meta, file, _index -> [meta, file]} + ) + + ch_panel_impute = ch_panel_msav + .combine(ch_posfile, by:0) + .combine(ch_chunks, by:0) + .combine(ch_map, by:0) + + ch_panel_impute.ifEmpty{ + error "ERROR: join operation resulted in an empty channel. Please provide a valid ch_posfile, ch_chunks and ch_map channel as input." + } + + // Prepare input channels for MINIMAC4 + ch_minimac4_input = ch_input + .combine(ch_panel_impute) + .map { metaI, target_vcf, target_tbi, metaPC, ref_msav, sites_vcf, sites_index, regionout, map -> + [ + metaPC + metaI + ["regionout": regionout], + target_vcf, target_tbi, + ref_msav, sites_vcf, sites_index, + map, regionout + ] + } + // Perform imputation + MINIMAC4_IMPUTE( ch_minimac4_input ) + ch_versions = ch_versions.mix(MINIMAC4_IMPUTE.out.versions.first()) + + // Index the output VCF file + BCFTOOLS_INDEX_1( MINIMAC4_IMPUTE.out.vcf ) + ch_versions = ch_versions.mix(BCFTOOLS_INDEX_1.out.versions.first()) + + // Ligate all phased files in one and index it + ligate_input = MINIMAC4_IMPUTE.out.vcf + .join( + BCFTOOLS_INDEX_1.out.tbi + .mix(BCFTOOLS_INDEX_1.out.csi) + ) + .map{ meta, vcf, index -> + def keysToKeep = meta.keySet() - ['regionout'] + [ meta.subMap(keysToKeep), vcf, index ] + } + .groupTuple() + + GLIMPSE2_LIGATE( ligate_input ) + ch_versions = ch_versions.mix( GLIMPSE2_LIGATE.out.versions.first() ) + + BCFTOOLS_INDEX_2( GLIMPSE2_LIGATE.out.merged_variants ) + ch_versions = ch_versions.mix( BCFTOOLS_INDEX_2.out.versions.first() ) + + // Join imputed and index files + ch_vcf_index = GLIMPSE2_LIGATE.out.merged_variants + .join( + BCFTOOLS_INDEX_2.out.tbi + .mix(BCFTOOLS_INDEX_2.out.csi) + ) + + emit: + vcf_index = ch_vcf_index // channel: [ [id, panel, chr], vcf, index ] + versions = ch_versions // channel: [ versions.yml ] +} diff --git a/subworkflows/nf-core/vcf_impute_minimac4/meta.yml b/subworkflows/nf-core/vcf_impute_minimac4/meta.yml new file mode 100644 index 00000000000..1b1273c73b0 --- /dev/null +++ b/subworkflows/nf-core/vcf_impute_minimac4/meta.yml @@ -0,0 +1,116 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "VCF_IMPUTE_MINIMAC4" +description: | + Subworkflow to impute VCF files using MINIMAC4 software. The subworkflow + takes VCF files, phased reference panel, and genetic maps 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" key will be added to the meta map to distinguish the different file + before ligation and therefore should not be used. +keywords: + - VCF + - imputation + - minimac4 + - phasing + - MSAV +components: + - minimac4/compressref + - minimac4/impute + - bcftools/index + - 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,vcf.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_posfile: + description: Channel with variants position to impute + structure: + - meta: + type: map + description: | + Metadata map containing chromosome information + - sites_vcf: + type: file + descrition: | + VCF/BCF file containing position to impute + - sites_index: + type: file + description: | + CSI|TBI index file of the sites to impute + - 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: Minimac 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_minimac4/tests/main.nf.test b/subworkflows/nf-core/vcf_impute_minimac4/tests/main.nf.test new file mode 100644 index 00000000000..0954d2f97b0 --- /dev/null +++ b/subworkflows/nf-core/vcf_impute_minimac4/tests/main.nf.test @@ -0,0 +1,262 @@ +nextflow_workflow { + + name "Test Subworkflow VCF_IMPUTE_MINIMAC4" + script "../main.nf" + + config "./nextflow.config" + + workflow "VCF_IMPUTE_MINIMAC4" + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/vcf_impute_minimac4" + + tag "minimac4" + tag "minimac4/compressref" + tag "minimac4/impute" + tag "bcftools" + tag "bcftools/index" + tag "glimpse2" + tag "glimpse2/ligate" + + test("Impute with minimac4 one vcf no map, no posfile, no chunks, panel as vcf") { + 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([ + [id: "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([[id: "1000GP", chr: "chr22"], [], []]) + input[3] = Channel.of([[id: "1000GP", chr: "chr22"], "chr22"]) + input[4] = Channel.of([[id: "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 minimac4 one vcf with map, posfile, chunks, panel as vcf") { + 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( + [ + [id: "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) + ],[ + [id: "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( + [ + [id: "1000GP", chr: "chr22"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.sites.vcf.gz", checkIfExist:true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr22.sites.vcf.gz.csi", checkIfExist:true) + ],[ + [id: "1000GP", chr: "chr21"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr21.sites.vcf.gz", checkIfExist:true), + file(params.modules_testdata_base_path + "genomics/homo_sapiens/popgen/1000GP.chr21.sites.vcf.gz.csi", checkIfExist:true) + ]) + input[3] = channel.of( + [[chr: "chr22", id: "1000GP"], "chr22:16570065-16592216"], + [[chr: "chr22", id: "1000GP"], "chr22:16592229-16609999"], + [[chr: "chr21", id: "1000GP"], "chr21:16570065-16592216"], + [[chr: "chr21", id: "1000GP"], "chr21:16592229-16609999"] + ) + input[4] = channel.of([ + [id: "1000GP", chr: "chr22"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr22.minimac.map", checkIfExist:true) + ],[ + [id: "1000GP", chr: "chr21"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr21.minimac.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") { + tag "test" + 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( + [ + [id: "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) + ],[ + [id: "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( + [[id: "1000GP", chr: "chr22"],[],[]], + [[id: "1000GP", chr: "chr21"],[],[]] + ) + input[3] = channel.of( + [[chr: "chr22", id: "1000GP"], "chr22:16570065-16592216"], + [[chr: "chr22", id: "1000GP"], "chr22:16592229-16609999"], + [[chr: "chr21", id: "1000GP"], "chr21:16570065-16592216"], + [[chr: "chr21", id: "1000GP"], "chr21:16592229-16609999"] + ) + input[4] = channel.of( + [[id: "1000GP", chr: "chr22"], []], + [[id: "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 panel format - 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( + [ + [id: "1000GP", chr: "chr22"], + file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genetic_map/genome.GRCh38.chr22.minimac.map", checkIfExist:true), + [] + ], + [[id: "1000GP", chr: "chr21"],[],[]] + ) + input[2] = channel.of( + [[id: "1000GP", chr: "chr22"],[],[]], + [[id: "1000GP", chr: "chr21"],[],[]] + ) + input[3] = channel.of( + [[chr: "chr22", id: "1000GP"], "chr22:16570065-16592216"], + [[chr: "chr22", id: "1000GP"], "chr22:16592229-16609999"], + [[chr: "chr21", id: "1000GP"], "chr21:16570065-16592216"], + [[chr: "chr21", id: "1000GP"], "chr21:16592229-16609999"] + ) + input[4] = channel.of( + [[id: "1000GP", chr: "chr22"], []], + [[id: "1000GP", chr: "chr21"], []] + ) + """ + } + } + then { + assertAll( + { assert workflow.failed }, + { assert workflow.errorMessage.contains("ERROR: ch_panel files must be either VCF/BCF or MSAV.") } + ) + } + } + + 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( + [ + [id: "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) + ],[ + [id: "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( + [[id: "1000GP", chr: "chr22"],[],[]], + [[id: "1000GP_2", chr: "chr21"],[],[]] // Wrong panel + ) + input[3] = channel.of( + [[chr: "chr22", id: "1000GP"], "chr22:16570065-16592216"], + [[chr: "chr22", id: "1000GP"], "chr22:16592229-16609999"], + [[chr: "chr21", id: "1000GP"], "chr21:16570065-16592216"], + [[chr: "chr21", id: "1000GP"], "chr21:16592229-16609999"] + ) + input[4] = channel.of( + [[id: "1000GP_1", chr: "chr22"], []], // Wrong panel + [[id: "1000GP", chr: "chr21"], []] + ) + """ + } + } + then { + assertAll( + { assert workflow.failed }, + { assert workflow.errorMessage.contains("ERROR: join operation resulted in an empty channel. Please provide a valid ch_posfile, ch_chunks and ch_map channel as input.") } + ) + } + } +} diff --git a/subworkflows/nf-core/vcf_impute_minimac4/tests/main.nf.test.snap b/subworkflows/nf-core/vcf_impute_minimac4/tests/main.nf.test.snap new file mode 100644 index 00000000000..7e472abfc6f --- /dev/null +++ b/subworkflows/nf-core/vcf_impute_minimac4/tests/main.nf.test.snap @@ -0,0 +1,212 @@ +{ + "homo_sapiens - empty channels - stub": { + "content": [ + { + "0": [ + [ + { + "id": "NA12878", + "chr": "chr21" + }, + "NA12878_chr21.ligate.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "NA12878_chr21.ligate.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "NA12878", + "chr": "chr22" + }, + "NA12878_chr22.ligate.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "NA12878_chr22.ligate.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,373fe12da367d3891473f487a9536d04", + "versions.yml:md5,a4842af8fedc3522b989d4ee28f08d80", + "versions.yml:md5,c4f18dd6f40ed9d3800cf2343ea37718", + "versions.yml:md5,c973327c440ac43a279155f7c78f758c", + "versions.yml:md5,e4a5385750692998068c944b99976f4e" + ], + "vcf_index": [ + [ + { + "id": "NA12878", + "chr": "chr21" + }, + "NA12878_chr21.ligate.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "NA12878_chr21.ligate.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + [ + { + "id": "NA12878", + "chr": "chr22" + }, + "NA12878_chr22.ligate.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "NA12878_chr22.ligate.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,373fe12da367d3891473f487a9536d04", + "versions.yml:md5,a4842af8fedc3522b989d4ee28f08d80", + "versions.yml:md5,c4f18dd6f40ed9d3800cf2343ea37718", + "versions.yml:md5,c973327c440ac43a279155f7c78f758c", + "versions.yml:md5,e4a5385750692998068c944b99976f4e" + ] + }, + [ + { + "VCF_IMPUTE_MINIMAC4:MINIMAC4_COMPRESSREF": { + "minimac4": "4.1.6" + } + }, + { + "VCF_IMPUTE_MINIMAC4:MINIMAC4_IMPUTE": { + "minimac4": "4.1.6" + } + }, + { + "VCF_IMPUTE_MINIMAC4:GLIMPSE2_LIGATE": { + "glimpse2": "2.0.0" + } + }, + { + "VCF_IMPUTE_MINIMAC4:BCFTOOLS_INDEX_2": { + "bcftools": 1.22 + } + }, + { + "VCF_IMPUTE_MINIMAC4:BCFTOOLS_INDEX_1": { + "bcftools": 1.22 + } + } + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-04T15:43:11.308656267" + }, + "Impute with minimac4 one vcf no map, no posfile, no chunks, panel as vcf": { + "content": [ + [ + [ + { + "id": "NA12878", + "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" + ], + "a0615a8a5ce53f496ac691c5fc82a44" + ] + ], + [ + "versions.yml:md5,373fe12da367d3891473f487a9536d04", + "versions.yml:md5,a4842af8fedc3522b989d4ee28f08d80", + "versions.yml:md5,c4f18dd6f40ed9d3800cf2343ea37718", + "versions.yml:md5,c973327c440ac43a279155f7c78f758c", + "versions.yml:md5,e4a5385750692998068c944b99976f4e" + ], + [ + { + "VCF_IMPUTE_MINIMAC4:MINIMAC4_COMPRESSREF": { + "minimac4": "4.1.6" + } + }, + { + "VCF_IMPUTE_MINIMAC4:MINIMAC4_IMPUTE": { + "minimac4": "4.1.6" + } + }, + { + "VCF_IMPUTE_MINIMAC4:GLIMPSE2_LIGATE": { + "glimpse2": "2.0.0" + } + }, + { + "VCF_IMPUTE_MINIMAC4:BCFTOOLS_INDEX_2": { + "bcftools": 1.22 + } + }, + { + "VCF_IMPUTE_MINIMAC4:BCFTOOLS_INDEX_1": { + "bcftools": 1.22 + } + } + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-04T15:42:40.880959591" + }, + "Impute with minimac4 one vcf with map, posfile, chunks, panel as vcf": { + "content": [ + [ + [ + { + "id": "NA12878", + "chr": "chr21" + }, + "NA12878_chr21.ligate.vcf.gz", + "NA12878_chr21.ligate.vcf.gz.csi", + "VcfFile [chromosomes=[chr21], sampleCount=1, variantCount=836, phased=true, phasedAutodetect=true]", + [ + "NA12878" + ], + "76106bc8377b38cb64e1aa069c196a0d" + ], + [ + { + "id": "NA12878", + "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" + ], + "a0615a8a5ce53f496ac691c5fc82a44" + ] + ], + [ + { + "VCF_IMPUTE_MINIMAC4:MINIMAC4_COMPRESSREF": { + "minimac4": "4.1.6" + } + }, + { + "VCF_IMPUTE_MINIMAC4:MINIMAC4_IMPUTE": { + "minimac4": "4.1.6" + } + }, + { + "VCF_IMPUTE_MINIMAC4:GLIMPSE2_LIGATE": { + "glimpse2": "2.0.0" + } + }, + { + "VCF_IMPUTE_MINIMAC4:BCFTOOLS_INDEX_2": { + "bcftools": 1.22 + } + }, + { + "VCF_IMPUTE_MINIMAC4:BCFTOOLS_INDEX_1": { + "bcftools": 1.22 + } + } + ] + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.0" + }, + "timestamp": "2025-12-04T15:42:56.289368627" + } +} \ No newline at end of file diff --git a/subworkflows/nf-core/vcf_impute_minimac4/tests/nextflow.config b/subworkflows/nf-core/vcf_impute_minimac4/tests/nextflow.config new file mode 100644 index 00000000000..dcc9328d3b6 --- /dev/null +++ b/subworkflows/nf-core/vcf_impute_minimac4/tests/nextflow.config @@ -0,0 +1,21 @@ +process { + withName: 'MINIMAC4_COMPRESSREF' { + ext.args = '' + } + withName: 'MINIMAC4_IMPUTE' { + ext.prefix = { "${meta.id}_${meta.chr}_${meta.regionout}.minimac4" } + ext.args = '--output-format vcf.gz' + } + + withName: GLIMPSE2_LIGATE { + ext.prefix = { "${meta.id}_${meta.chr}.ligate" } + } + + withName: BCFTOOLS_INDEX_1 { + ext.args = '--tbi' + } + + withName: BCFTOOLS_INDEX_2 { + ext.args = '--csi' + } +}