-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TSPS-328 add optional samples subselection to SubsetVcfByBedFile WDL (#…
…138)
- Loading branch information
1 parent
997f357
commit 110b968
Showing
4 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
pipelines/imputation/scientificValidation/UpdateVcfHeaderContigs.wdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
version 1.0 | ||
|
||
# This script is under review. It is not actively tested or maintained at this time. | ||
workflow UpdateVcfDictionaryHeader { | ||
input { | ||
File input_vcf | ||
File input_vcf_index | ||
File ref_dict | ||
} | ||
|
||
call UpdateVcfDictionaryHeader { | ||
input: | ||
vcf = input_vcf, | ||
vcf_index = input_vcf_index, | ||
ref_dict = ref_dict, | ||
basename = basename(input_vcf, '.vcf.gz') | ||
} | ||
|
||
output { | ||
File output_vcf = UpdateVcfDictionaryHeader.output_vcf | ||
File output_vcf_index = UpdateVcfDictionaryHeader.output_vcf_index | ||
} | ||
} | ||
|
||
task UpdateVcfDictionaryHeader { | ||
input { | ||
File vcf | ||
File vcf_index | ||
File ref_dict | ||
String basename | ||
Boolean disable_sequence_dictionary_validation = true | ||
|
||
Int disk_size_gb = ceil(4*(size(vcf, "GiB") + size(vcf_index, "GiB"))) + 20 | ||
String gatk_docker = "us.gcr.io/broad-gatk/gatk:4.5.0.0" | ||
Int cpu = 1 | ||
Int memory_mb = 6000 | ||
Int preemptible = 0 | ||
} | ||
Int command_mem = memory_mb - 1500 | ||
Int max_heap = memory_mb - 1000 | ||
|
||
String disable_sequence_dict_validation_flag = if disable_sequence_dictionary_validation then "--disable-sequence-dictionary-validation" else "" | ||
|
||
command <<< | ||
set -e -o pipefail | ||
|
||
ln -sf ~{vcf} input.vcf.gz | ||
ln -sf ~{vcf_index} input.vcf.gz.tbi | ||
|
||
## update the header of the merged vcf | ||
gatk --java-options "-Xms~{command_mem}m -Xmx~{max_heap}m" \ | ||
UpdateVCFSequenceDictionary \ | ||
--source-dictionary ~{ref_dict} \ | ||
--output ~{basename}.vcf.gz \ | ||
--replace -V input.vcf.gz \ | ||
~{disable_sequence_dict_validation_flag} | ||
>>> | ||
runtime { | ||
docker: gatk_docker | ||
disks: "local-disk ${disk_size_gb} HDD" | ||
memory: "${memory_mb} MiB" | ||
cpu: cpu | ||
preemptible: preemptible | ||
} | ||
output { | ||
File output_vcf = "~{basename}.vcf.gz" | ||
File output_vcf_index = "~{basename}.vcf.gz.tbi" | ||
} | ||
} |