vcf_ch = Channel
.fromPath( '/result/Chr1/*.gz' )
.toSortedList()
.collect()
tabix_ch = Channel
.fromPath( '/result/Chr1/*.gz.tbi' )
.collect()
process VCF_SUBSET {
publishDir "$baseDir/result/ALL_CHR", mode: 'copy', overwrite: true
input:
path file from vcf_ch
path tabix_file from tabix_ch
output:
file "*.vcf.gz"
script:
"""
bcftools merge -i AF:avg,MAF:avg,R2:avg ${file} --threads 20 -Oz -o test.vcf.gz
"""
}
Many thanks,