task depth { File raw_bam File raw_bam_idx File deduped_bam File deduped_bam_idx String sample_id File regions String docker String cluster_config String disk_size command <<< /opt/conda/bin/samtools depth -aa -b ${regions} ${raw_bam} > ${sample_id}.raw.depth /opt/conda/bin/samtools depth -aa -b ${regions} ${deduped_bam} > ${sample_id}.deduped.depth sort -k1,1V -k2,2n ${sample_id}.raw.depth | awk '{printf "%s:%i\t%i\n" , $1,$2,$3}' > ${sample_id}.raw.sorted.depth sort -k1,1V -k2,2n ${sample_id}.deduped.depth | awk '{printf "%s:%i\t%i\n" , $1,$2,$3}' > ${sample_id}.deduped.sorted.depth join -e NULL -a1 -j 1 -o 1.1,1.2,2.2 ${sample_id}.raw.sorted.depth ${sample_id}.deduped.sorted.depth > ${sample_id}.depth >>> runtime { docker:docker cluster: cluster_config systemDisk: "cloud_ssd 40" dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" } output { File bam_depth = "${sample_id}.depth" } }