@@ -19,29 +19,31 @@ process COMPRESSION_ENCRYPTION_VCF {
19
19
def meta_joined = ArrayUtil . sort(imputed_meta_vcf_data)
20
20
def info_joined = ArrayUtil . sort(imputed_info)
21
21
def prefix = " chr${ chr} "
22
- def imputed_name = " ${ prefix} .dose.vcf.gz"
23
- def meta_name = " ${ prefix} .empiricalDose.vcf.gz"
22
+ def minimac4_format = params. imputation. format
23
+ def bcftools_output = minimac4_format == ' bcf' ? " b" : " z"
24
+ def imputed_name = " ${ prefix} .dose.$minimac4_format "
25
+ def meta_name = " ${ prefix} .empiricalDose.$minimac4_format "
24
26
def zip_name = " chr_${ chr} .zip"
25
- def info_name = " ${ prefix} .info.gz "
27
+ def info_name = " ${ prefix} .info.$m inimac4_format "
26
28
def aes = params. encryption. aes ? " -mem=AES256" : " "
27
29
def panel_version = params. refpanel. id
28
-
30
+
29
31
"""
30
32
# concat info files
31
- bcftools concat --threads ${ task.cpus} -n ${ info_joined} -o ${ info_name} -Oz
33
+ bcftools concat --threads ${ task.cpus} -n ${ info_joined} -o ${ info_name} -O $b cftools_output
32
34
33
35
# concat dosage files and update header
34
- bcftools concat --threads ${ task.cpus} -n ${ imputed_joined} -o intermediate_${ imputed_name} -Oz
36
+ bcftools concat --threads ${ task.cpus} -n ${ imputed_joined} -o intermediate_${ imputed_name} -O $b cftools_output
35
37
echo "##mis_pipeline=${ workflow.manifest.version} " > add_header.txt
36
38
echo "##mis_phasing=${ params.phasing.engine} " >> add_header.txt
37
39
echo "##mis_panel=${ panel_version} " >> add_header.txt
38
- bcftools annotate --threads ${ task.cpus} -h add_header.txt intermediate_${ imputed_name} -o ${ imputed_name} -Oz
40
+ bcftools annotate --threads ${ task.cpus} -h add_header.txt intermediate_${ imputed_name} -o ${ imputed_name} -O $b cftools_output
39
41
rm intermediate_${ imputed_name}
40
42
41
43
# write meta files
42
44
if [[ "${ params.imputation.meta} " = true ]]
43
45
then
44
- bcftools concat --threads ${ task.cpus} -n ${ meta_joined} -o ${ meta_name} -Oz
46
+ bcftools concat --threads ${ task.cpus} -n ${ meta_joined} -o ${ meta_name} -O $b cftools_output
45
47
tabix ${ meta_name}
46
48
fi
47
49
@@ -55,7 +57,7 @@ process COMPRESSION_ENCRYPTION_VCF {
55
57
if [[ "${ params.encryption.enabled} " = true ]]
56
58
then
57
59
7z a -tzip ${ aes} -mmt${ task.cpus} -p"${ params.encryption_password} " ${ zip_name} ${ prefix} *
58
- rm *vcf.gz* *info.gz add_header.txt
60
+ rm *$m inimac4_format add_header.txt
59
61
fi
60
62
61
63
# create md5 of zip file
0 commit comments