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

Sz add mem disk aligned metrics #448

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 10 additions & 4 deletions wdl/tasks/QC/AlignedMetrics.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ workflow AlignedMetrics {
File ref_dict

String? gcs_output_dir

Int? mem_gb_input_ReadMetrics # Optional input for memory in GiB
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it might be better to define the inputs as the struct for runtime attributes. Then you can just bubble that whole struct down.

RuntimeAttr? runtime_attr_override

Int? disk_gb_input_ReadMetrics # Optional input for disk size in GiB

}

call ReadMetrics as AlignedReadMetrics { input: bam = aligned_bam }
Expand Down Expand Up @@ -625,12 +629,14 @@ task ComputeBedCoverage {
task ReadMetrics {
input {
File bam

Int? mem_gb_input_ReadMetrics # Optional input for memory in GiB
Int? disk_gb_input_ReadMetrics # Optional input for disk size in GiB
RuntimeAttr? runtime_attr_override
}

String basename = basename(bam, ".bam")
Int disk_size = 2*ceil(size(bam, "GB"))
Int calculated_disk_size = 2*ceil(size(bam, "GB"))
Int disk_size = select_first([disk_gb_input_ReadMetrics, calculated_disk_size]) # Use disk_gb_input if provided, otherwise use calculated_disk_size

command <<<
set -euxo pipefail
Expand All @@ -655,8 +661,8 @@ task ReadMetrics {
#########################
RuntimeAttr default_attr = object {
cpu_cores: 2,
mem_gb: 50,
disk_gb: disk_size,
mem_gb: select_first([mem_gb_input_ReadMetrics, 50]), # Use mem_gb_input if provided, otherwise default to 50
disk_gb: disk_size, # Use disk_gb_input if provided, otherwise use calculated_disk_size
boot_disk_gb: 10,
preemptible_tries: 2,
max_retries: 1,
Expand Down
Loading