Skip to content

Commit eb568d3

Browse files
committed
make several BAM ops more frugal: [GATK ValidateSamFile, samtools fastq, samtools reset]
1 parent d62b98e commit eb568d3

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

wdl/tasks/Utility/BAMutils.wdl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ task ValidateSamFile {
282282
RuntimeAttr? runtime_attr_override
283283
}
284284

285-
Int disk_size = ceil(size(bam, "GiB")) + 50
286285
String output_basename = basename(basename(bam, ".bam"), ".cram")
287286
String output_name = "${output_basename}_${validation_mode}.txt"
288287

@@ -307,9 +306,12 @@ task ValidateSamFile {
307306
}
308307

309308
#########################
309+
310+
Int disk_size = ceil(size(bam, "GiB")) + 10
311+
310312
RuntimeAttr default_attr = object {
311313
cpu_cores: 2,
312-
mem_gb: 8,
314+
mem_gb: 6,
313315
disk_gb: disk_size,
314316
preemptible_tries: 2,
315317
max_retries: 1,
@@ -1280,7 +1282,7 @@ task BamToFastq {
12801282
12811283
RuntimeAttr default_attr = object {
12821284
cpu_cores: 2,
1283-
mem_gb: 8,
1285+
mem_gb: 6,
12841286
disk_gb: disk_size,
12851287
preemptible_tries: 2,
12861288
max_retries: 1,
@@ -1500,9 +1502,9 @@ task SamtoolsReset {
15001502
15011503
time gcloud storage cp ~{bam} ~{local_bam}
15021504
1503-
samtools view -@1 ~{local_bam} | grep -v "^@" | awk -F '\t' '{print $2}' | sort | uniq -c > orignal.SAM-flag.stats.txt &
1505+
samtools view ~{local_bam} | grep -v "^@" | awk -F '\t' '{print $2}' | sort | uniq -c > orignal.SAM-flag.stats.txt &
15041506
1505-
samtools reset -@3 \
1507+
samtools reset -@4 \
15061508
--remove-tag ~{sep=',' tags_to_drop} \
15071509
-o ~{prefix}.unaligned.bam \
15081510
~{local_bam}
@@ -1511,8 +1513,8 @@ task SamtoolsReset {
15111513
15121514
#########################
15131515
RuntimeAttr default_attr = object {
1514-
cpu_cores: 4,
1515-
mem_gb: 16,
1516+
cpu_cores: 6,
1517+
mem_gb: 10,
15161518
disk_gb: disk_size,
15171519
preemptible_tries: 2,
15181520
max_retries: 1,

0 commit comments

Comments
 (0)