Skip to content

Commit

Permalink
Fix non-deterministic errors in GetSampleIdsFromVcfTar (broadinstitut…
Browse files Browse the repository at this point in the history
  • Loading branch information
mwalker174 authored and gatk-sv-bot committed Jun 27, 2023
1 parent 262c3fb commit d84f00d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions wdl/Utils.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ task GetSampleIdsFromVcfArray {
maxRetries: select_first([runtime_attr.max_retries, default_attr.max_retries])
}
}
task GetSampleIdsFromVcfTar {
input {
File vcf_tar
Expand All @@ -99,24 +99,18 @@ task GetSampleIdsFromVcfTar {
RuntimeAttr default_attr = object {
cpu_cores: 1,
mem_gb: 0.9,
disk_gb: 10 + ceil(size(vcf_tar, "GiB")),
disk_gb: ceil(50 + 2 * size(vcf_tar, "GiB")),
boot_disk_gb: 10,
preemptible_tries: 3,
max_retries: 1
}
RuntimeAttr runtime_attr = select_first([runtime_attr_override, default_attr])
command <<<
set -euo pipefail
# Using a named pipe keeps pipefail from triggering
mkfifo tmppipe
while read f
do
tar -Ozxf ~{vcf_tar} $f &>2 /dev/null > tmppipe &
bcftools query -l tmppipe
done < <(tar -tzf ~{vcf_tar} | grep '\.vcf\.gz$') | sort -u > ~{prefix}.txt
mkdir vcfs
tar xzf ~{vcf_tar} -C vcfs/
ls vcfs/*.vcf.gz | xargs -n1 bcftools query -l | sort -u > ~{prefix}.txt
>>>
output {
Expand Down

0 comments on commit d84f00d

Please sign in to comment.