Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mutect2 WDL and pon WDL had inconsistent input names #6187

Merged
merged 3 commits into from
Oct 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 41 additions & 30 deletions scripts/mutect2_wdl/mutect2_pon.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ workflow Mutect2_Panel {
Int scatter_count
Array[String] normal_bams
Array[String] normal_bais
String gnomad
File gnomad
File gnomad_idx
String? m2_extra_args
String? create_pon_extra_args
Boolean? compress
Expand All @@ -30,15 +31,30 @@ workflow Mutect2_Panel {
Int? min_contig_size
Int? num_contigs

File? gatk_override

# runtime
String gatk_docker
Int? preemptible_attempts
File? gatk_override
String basic_bash_docker = "ubuntu:16.04"

Int? preemptible
Int? max_retries
Int small_task_cpu = 2
Int small_task_mem = 4
Int small_task_disk = 100
Int boot_disk_size = 12

# Use as a last resort to increase the disk given to every task in case of ill behaving data
Int? emergency_extra_disk
}

Int contig_size = select_first([min_contig_size, 1000000])
Int preemptible_or_default = select_first([preemptible, 2])
Int max_retries_or_default = select_first([max_retries, 2])

Runtime standard_runtime = {"gatk_docker": gatk_docker, "gatk_override": gatk_override,
"max_retries": max_retries_or_default, "preemptible": preemptible_or_default, "cpu": small_task_cpu,
"machine_mem": small_task_mem * 1000, "command_mem": small_task_mem * 1000 - 500,
"disk": small_task_disk, "boot_disk_size": boot_disk_size}

scatter (normal_bam in zip(normal_bams, normal_bais)) {
call m2.Mutect2 {
Expand All @@ -53,7 +69,7 @@ workflow Mutect2_Panel {
m2_extra_args = select_first([m2_extra_args, ""]) + "--max-mnp-distance 0",
gatk_override = gatk_override,
gatk_docker = gatk_docker,
preemptible_attempts = preemptible_attempts,
preemptible = preemptible,
max_retries = max_retries
}
}
Expand All @@ -65,8 +81,7 @@ workflow Mutect2_Panel {
ref_dict = ref_dict,
scatter_count = select_first([num_contigs, 24]),
split_intervals_extra_args = "--subdivision-mode BALANCING_WITHOUT_INTERVAL_SUBDIVISION --min-contig-size " + contig_size,
gatk_override = gatk_override,
gatk_docker = gatk_docker
runtime_params = standard_runtime
}

scatter (subintervals in SplitIntervals.interval_files ) {
Expand All @@ -78,12 +93,10 @@ workflow Mutect2_Panel {
ref_fai = ref_fai,
ref_dict = ref_dict,
gnomad = gnomad,
gnomad_idx = gnomad_idx,
output_vcf_name = pon_name,
create_pon_extra_args = create_pon_extra_args,
gatk_override = gatk_override,
preemptible_attempts = preemptible_attempts,
max_retries = max_retries,
gatk_docker = gatk_docker
runtime_params = standard_runtime
}
}

Expand All @@ -93,10 +106,7 @@ workflow Mutect2_Panel {
input_vcf_indices = CreatePanel.output_vcf_index,
output_name = pon_name,
compress = select_first([compress, false]),
gatk_override = gatk_override,
gatk_docker = gatk_docker,
preemptible_attempts = preemptible_attempts,
max_retries = max_retries
runtime_params = standard_runtime
}

output {
Expand All @@ -115,25 +125,25 @@ task CreatePanel {
File ref_fai
File ref_dict
String output_vcf_name
String gnomad
File gnomad
File gnomad_idx
String? create_pon_extra_args

File? gatk_override

# runtime
String gatk_docker
Int? mem
Int? preemptible_attempts
Int? max_retries
Int? disk_space
Runtime runtime_params
}

Int machine_mem = select_first([mem, 8])
Int machine_mem = 8
Int command_mem = machine_mem - 1

parameter_meta{
gnomad: {localization_optional: true}
gnomad_idx: {localization_optional: true}
}

command {
set -e
export GATK_LOCAL_JAR=~{default="/root/gatk.jar" gatk_override}
export GATK_LOCAL_JAR=~{default="/root/gatk.jar" runtime_params.gatk_override}

gatk GenomicsDBImport --genomicsdb-workspace-path pon_db -R ~{ref_fasta} -V ~{sep=' -V ' input_vcfs} -L ~{intervals}

Expand All @@ -142,12 +152,13 @@ task CreatePanel {
}

runtime {
docker: gatk_docker
bootDiskSizeGb: 12
docker: runtime_params.gatk_docker
bootDiskSizeGb: runtime_params.boot_disk_size
memory: machine_mem + " GB"
disks: "local-disk " + select_first([disk_space, 100]) + " HDD"
preemptible: select_first([preemptible_attempts, 3])
maxRetries: select_first([max_retries, 0])
disks: "local-disk " + runtime_params.disk + " HDD"
preemptible: runtime_params.preemptible
maxRetries: runtime_params.max_retries
cpu: runtime_params.cpu
}

output {
Expand Down