Description

Concatenate several VCF files using bcftools concat. An additional option can be given to sort the concatenated VCF.

Input

name
description
pattern

meta

Groovy Map containing at least a common field for each VCF that needs to be merged
e.g. [ id:‘test.001’, common_meta:‘test’ ]

ch_vcfs

VCF files and their indices that should be concatenated as well as the expected number of vcf
Structure: [ meta, vcf, tbi, count ]

arr_common_meta

OPTIONAL:
A string array of the common meta keys to use to group the vcfs.
Please make sure all VCFs that need to be concatenated have the same value in the
the meta fields specified - the subworkflow will error if a required key is missing from a meta map.

sort

Whether or not to sort the output VCF,
this can be useful if this subworkflow isn’t used in a scatter/gather workflow

Output

name
description
pattern

meta

Groovy Map containing sample information
e.g. [ id:‘test’ ]

vcf

The concatenated (and possible sorted) VCF file
Structure: [ meta, vcf ]

*.vcf.gz

index

The indices of the output VCFs
Structure: [ meta, [tbi, csi] ]

*.vcf.gz.{tbi,csi}

vcf_index

Aggregated channel with the vcf and indices
Structure: [ meta, vcf, [tbi, csi] ]