Skip to content

Commit

Permalink
change runtime attrs to args in MT pipeline (#8413)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyeramosu committed Jul 11, 2023
1 parent 9216207 commit e0090de
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
11 changes: 6 additions & 5 deletions scripts/mitochondria_m2_wdl/AlignAndCall.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,13 @@ task CollectWgsMetrics {
Int? read_length
Int? coverage_cap

# runtime
Int? preemptible_tries
Int disk_size = ceil(size(input_bam, "GB") + size(ref_fasta, "GB") + size(ref_fasta_index, "GB")) + 20
Int mem = 3
}

Int read_length_for_optimization = select_first([read_length, 151])
Float ref_size = size(ref_fasta, "GB") + size(ref_fasta_index, "GB")
Int disk_size = ceil(size(input_bam, "GB") + ref_size) + 20

meta {
description: "Collect coverage metrics"
Expand Down Expand Up @@ -345,7 +346,7 @@ task CollectWgsMetrics {
>>>
runtime {
preemptible: select_first([preemptible_tries, 5])
memory: "3 GB"
memory: mem + " GB"
disks: "local-disk " + disk_size + " HDD"
docker: "us.gcr.io/broad-gotc-prod/genomes-in-the-cloud:2.4.2-1552931386"
}
Expand Down Expand Up @@ -426,16 +427,16 @@ task M2 {
Boolean? make_bamout
Boolean compress
File? gatk_override
# runtime
String? gatk_docker_override
Int? mem
Int? preemptible_tries
Int disk_size = ceil(size(input_bam, "GB") + size(ref_fasta, "GB") + size(ref_fai, "GB")) + 20
}
String output_vcf = "raw" + if compress then ".vcf.gz" else ".vcf"
String output_vcf_index = output_vcf + if compress then ".tbi" else ".idx"
Float ref_size = size(ref_fasta, "GB") + size(ref_fai, "GB")
Int disk_size = ceil(size(input_bam, "GB") + ref_size) + 20
# Mem is in units of GB but our command and memory runtime values are in MB
Int machine_mem = if defined(mem) then mem * 1000 else 3500
Expand Down
7 changes: 4 additions & 3 deletions scripts/mitochondria_m2_wdl/AlignmentPipeline.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ task AlignAndMarkDuplicates {

String? read_name_regex

# runtime
Int? preemptible_tries
Int disk_size = ceil(size(input_bam, "GB") * 4 + size(ref_fasta, "GB") + size(ref_fasta_index, "GB") + size(ref_amb, "GB") + size(ref_ann, "GB") + size(ref_bwt, "GB") + size(ref_pac, "GB") + size(ref_sa, "GB")) + 20
Int mem = 6
}

String basename = basename(input_bam, ".bam")
String metrics_filename = basename + ".metrics"
Float ref_size = size(ref_fasta, "GB") + size(ref_fasta_index, "GB") + size(ref_amb, "GB") + size(ref_ann, "GB") + size(ref_bwt, "GB") + size(ref_pac, "GB") + size(ref_sa, "GB")
Int disk_size = ceil(size(input_bam, "GB") * 4 + ref_size) + 20

meta {
description: "Aligns with BWA and MergeBamAlignment, then Marks Duplicates. Outputs a coordinate sorted bam."
Expand Down Expand Up @@ -149,7 +150,7 @@ task AlignAndMarkDuplicates {
>>>
runtime {
preemptible: select_first([preemptible_tries, 5])
memory: "6 GB"
memory: mem + " GB"
cpu: "2"
disks: "local-disk " + disk_size + " HDD"
docker: "us.gcr.io/broad-gotc-prod/genomes-in-the-cloud:2.4.2-1552931386"
Expand Down
10 changes: 6 additions & 4 deletions scripts/mitochondria_m2_wdl/MitochondriaPipeline.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ task SubsetBamToChrM {

# runtime
Int? preemptible_tries
Int mem = 3
}
Float ref_size = if defined(ref_fasta) then size(ref_fasta, "GB") + size(ref_fasta_index, "GB") + size(ref_dict, "GB") else 0
Int disk_size = ceil(size(input_bam, "GB") + ref_size) + 20
Expand Down Expand Up @@ -232,7 +233,7 @@ task SubsetBamToChrM {
-O ~{basename}.bam
>>>
runtime {
memory: "3 GB"
memory: mem + " GB"
disks: "local-disk " + disk_size + " HDD"
docker: select_first([gatk_docker_override, "us.gcr.io/broad-gatk/gatk:4.1.7.0"])
preemptible: select_first([preemptible_tries, 5])
Expand All @@ -247,12 +248,12 @@ task RevertSam {
input {
File input_bam
String basename = basename(input_bam, ".bam")
Int machine_mem = 2000

# runtime
Int? preemptible_tries
Int machine_mem = 2000
Int disk_size = ceil(size(input_bam, "GB") * 2.5) + 20
}
Int disk_size = ceil(size(input_bam, "GB") * 2.5) + 20
Int java_mem = machine_mem - 1000

meta {
Expand Down Expand Up @@ -300,9 +301,10 @@ task CoverageAtEveryBase {
File shifted_ref_fasta_index
File shifted_ref_dict

# runtime
Int? preemptible_tries
Int disk_size = ceil(size(input_bam_regular_ref, "GB") + size(input_bam_shifted_ref, "GB") + size(ref_fasta, "GB") * 2) + 20
}
Int disk_size = ceil(size(input_bam_regular_ref, "GB") + size(input_bam_shifted_ref, "GB") + size(ref_fasta, "GB") * 2) + 20

meta {
description: "Remove this hack once there's a GVCF solution."
Expand Down

0 comments on commit e0090de

Please sign in to comment.