Skip to content

Commit

Permalink
make several BAM ops more frugal: [GATK ValidateSamFile, samtools fas…
Browse files Browse the repository at this point in the history
…tq, samtools reset]
  • Loading branch information
SHuang-Broad committed May 9, 2024
1 parent 053ada2 commit aa0e08d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions wdl/tasks/Utility/BAMutils.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ task ValidateSamFile {
RuntimeAttr? runtime_attr_override
}
Int disk_size = ceil(size(bam, "GiB")) + 50
String output_basename = basename(basename(bam, ".bam"), ".cram")
String output_name = "${output_basename}_${validation_mode}.txt"
Expand All @@ -307,9 +306,12 @@ task ValidateSamFile {
}

#########################
Int disk_size = ceil(size(bam, "GiB")) + 10

RuntimeAttr default_attr = object {
cpu_cores: 2,
mem_gb: 8,
mem_gb: 6,
disk_gb: disk_size,
preemptible_tries: 2,
max_retries: 1,
Expand Down Expand Up @@ -1280,7 +1282,7 @@ task BamToFastq {
RuntimeAttr default_attr = object {
cpu_cores: 2,
mem_gb: 8,
mem_gb: 6,
disk_gb: disk_size,
preemptible_tries: 2,
max_retries: 1,
Expand Down Expand Up @@ -1500,9 +1502,9 @@ task SamtoolsReset {
time gcloud storage cp ~{bam} ~{local_bam}
samtools view -@1 ~{local_bam} | grep -v "^@" | awk -F '\t' '{print $2}' | sort | uniq -c > orignal.SAM-flag.stats.txt &
samtools view ~{local_bam} | grep -v "^@" | awk -F '\t' '{print $2}' | sort | uniq -c > orignal.SAM-flag.stats.txt &
samtools reset -@3 \
samtools reset -@4 \
--remove-tag ~{sep=',' tags_to_drop} \
-o ~{prefix}.unaligned.bam \
~{local_bam}
Expand All @@ -1511,8 +1513,8 @@ task SamtoolsReset {
#########################
RuntimeAttr default_attr = object {
cpu_cores: 4,
mem_gb: 16,
cpu_cores: 6,
mem_gb: 10,
disk_gb: disk_size,
preemptible_tries: 2,
max_retries: 1,
Expand Down

0 comments on commit aa0e08d

Please sign in to comment.