Skip to content

Commit 1612966

Browse files
jsotobroadJose Soto
authored andcommitted
add set -e -o pipefail to all relevant imputation tasks (#1434)
Co-authored-by: Jose Soto <jsoto@broadinstitute.org>
1 parent 57bf483 commit 1612966

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tasks/broad/ImputationTasks.wdl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ task CalculateChromosomeLength {
1212
}
1313

1414
command {
15+
set -e -o pipefail
16+
1517
grep -P "SN:~{chrom}\t" ~{ref_dict} | sed 's/.*LN://' | sed 's/\t.*//'
1618
}
1719
runtime {
@@ -38,6 +40,8 @@ task GetMissingContigList {
3840
}
3941

4042
command <<<
43+
set -e -o pipefail
44+
4145
grep "@SQ" ~{ref_dict} | sed 's/.*SN://' | sed 's/\t.*//' > contigs.txt
4246
awk 'NR==FNR{arr[$0];next} !($0 in arr)' ~{included_contigs} contigs.txt > missing_contigs.txt
4347
>>>
@@ -543,7 +547,6 @@ task UpdateHeader {
543547
String disable_sequence_dict_validation_flag = if disable_sequence_dictionary_validation then "--disable-sequence-dictionary-validation" else ""
544548

545549
command <<<
546-
547550
## update the header of the merged vcf
548551
gatk --java-options "-Xms~{command_mem}m -Xmx~{max_heap}m" \
549552
UpdateVCFSequenceDictionary \
@@ -644,6 +647,7 @@ task OptionalQCSites {
644647
Float hwe = select_first([optional_qc_hwe, 0.000001])
645648
command <<<
646649
set -e -o pipefail
650+
647651
ln -sf ~{input_vcf} input.vcf.gz
648652
ln -sf ~{input_vcf_index} input.vcf.gz.tbi
649653
@@ -676,6 +680,7 @@ task MergeSingleSampleVcfs {
676680
}
677681
command <<<
678682
set -e -o pipefail
683+
679684
# Move the index file next to the vcf with the corresponding name
680685
681686
declare -a VCFS=(~{sep=' ' input_vcfs})
@@ -715,6 +720,8 @@ task CountSamples {
715720
}
716721

717722
command <<<
723+
set -e -o pipefail
724+
718725
bcftools query -l ~{vcf} | wc -l
719726
>>>
720727
runtime {
@@ -915,6 +922,7 @@ task SetIDs {
915922
}
916923
command <<<
917924
set -e -o pipefail
925+
918926
bcftools annotate ~{vcf} --set-id '%CHROM\:%POS\:%REF\:%FIRST_ALT' -Oz -o ~{output_basename}.vcf.gz
919927
bcftools index -t ~{output_basename}.vcf.gz
920928
>>>
@@ -1074,6 +1082,8 @@ task FindSitesUniqueToFileTwoOnly {
10741082
Int disk_size_gb = ceil(size(file1, "GiB") + 2*size(file2, "GiB")) + 10
10751083
}
10761084
command <<<
1085+
set -e -o pipefail
1086+
10771087
comm -13 <(sort ~{file1} | uniq) <(sort ~{file2} | uniq) > missing_sites.ids
10781088
>>>
10791089
runtime {

0 commit comments

Comments
 (0)