@@ -20,6 +20,10 @@ process MINIMAC4 {
2020 tuple val(chr_cleaned), val(start), val(end), file(" *.dose.vcf.gz" ), file(" *.info.gz" ), file(" *.empiricalDose.vcf.gz" ), emit: imputed_chunks
2121
2222 script:
23+ output_format = params. imputation. output_format ?: ' vcf.gz'
24+ if (! [' sav' , ' vcf.gz' ]. contains(output_format)) {
25+ throw new IllegalArgumentException (" Invalid params.imputation.output_format: ${ output_format} . Use 'sav' or 'vcf.gz'." )
26+ }
2327 map = minimac_map ? ' --map ' + minimac_map : ' '
2428 r2_filter = min_r2 != 0 ? ' --min-r2 ' + min_r2 : ' '
2529 diff_threshold = diffThreshold != - 1 ? ' --diff-threshold ' + diffThreshold : ' '
@@ -31,19 +35,22 @@ process MINIMAC4 {
3135 chr_mapped = (refpanel_build == ' hg38' ) ? ' chr' + chr_cleaned : chr_cleaned
3236 used_threads = params. service. threads != - 1 ? params. service. threads : task. cpus
3337
38+ dose_output = " ${ chunkfile_name} .dose.${ output_format} "
39+ empirical_output = " ${ chunkfile_name} .empiricalDose.${ output_format} "
40+
3441 """
3542 tabix ${ chunkfile}
3643
3744 minimac4 \
3845 --region ${ chr_mapped} :${ start} -${ end} \
3946 --overlap ${ minimac_window} \
40- --output ${ chunkfile_name } .dose.vcf.gz \
41- --output-format vcf.gz \
47+ --output ${ dose_output } \
48+ --output-format ${ output_format } \
4249 --format GT,DS,GP,HDS \
4350 --min-ratio ${ minimac_min_ratio} \
4451 --all-typed-sites \
4552 --sites ${ chunkfile_name} .info.gz \
46- --empirical-output ${ chunkfile_name } .empiricalDose.vcf.gz \
53+ --empirical-output ${ empirical_output } \
4754 --threads ${ used_threads} \
4855 --decay ${ decay} \
4956 --temp-prefix ./ \
0 commit comments