Skip to content

Commit 65dbc0d

Browse files
committed
changed minimac for the sav format
1 parent 53e8163 commit 65dbc0d

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

modules/local/imputation/minimac4.nf

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 ./ \

nextflow.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ params {
5656
prob_threshold_s1 : -1,
5757
diff_threshold : -1,
5858
min_recom : -1,
59+
output_format : 'vcf.gz' #'either vcf.gz or sav'
5960
]
6061

6162
encryption = [

0 commit comments

Comments
 (0)