task depth { | |||||
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} ${deduped_bam} > ${sample_id}.deduped.depth | |||||
>>> | |||||
runtime { | |||||
docker:docker | |||||
cluster: cluster_config | |||||
systemDisk: "cloud_ssd 40" | |||||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||||
} | |||||
output { | |||||
File deduped_depth = "${sample_id}.deduped.depth" | |||||
} | |||||
} |
task depth { | 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 | |||||
>>> | |||||
File raw_depth | |||||
File deduped_depth | |||||
String sample_id | |||||
File regions | |||||
String docker | |||||
String cluster_config | |||||
String disk_size | |||||
command <<< | |||||
sort -k1,1V -k2,2n ${raw_depth} | awk '{printf "%s:%i\t%i\n" , $1,$2,$3}' > ${sample_id}.raw.sorted.depth | |||||
sort -k1,1V -k2,2n ${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" | |||||
} | |||||
runtime { | |||||
docker:docker | |||||
cluster: cluster_config | |||||
systemDisk: "cloud_ssd 40" | |||||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||||
} | |||||
output { | |||||
File bam_depth = "${sample_id}.depth" | |||||
} | |||||
} | } |
task depth { | |||||
File raw_bam | |||||
File raw_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 | |||||
>>> | |||||
runtime { | |||||
docker:docker | |||||
cluster: cluster_config | |||||
systemDisk: "cloud_ssd 40" | |||||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||||
} | |||||
output { | |||||
File raw_depth = "${sample_id}.raw.depth" | |||||
} | |||||
} |
import "./tasks/raw_depth.wdl" as raw_depth | |||||
import "./tasks/deduped_depth.wdl" as deduped_depth | |||||
import "./tasks/depth.wdl" as depth | import "./tasks/depth.wdl" as depth | ||||
workflow {{ project_name }} { | workflow {{ project_name }} { | ||||
String cluster_config | String cluster_config | ||||
String disk_size | String disk_size | ||||
call depth.depth as depth { | |||||
call raw_depth.raw_depth as raw_depth { | |||||
input: | input: | ||||
raw_bam=raw_bam, | raw_bam=raw_bam, | ||||
raw_bam_idx=raw_bam_idx, | raw_bam_idx=raw_bam_idx, | ||||
sample_id=sample_id, | |||||
regions=regions, | |||||
docker=docker, | |||||
cluster_config=cluster_config, | |||||
disk_size=disk_size | |||||
} | |||||
call deduped_depth.deduped_depth as deduped_depth { | |||||
input: | |||||
deduped_bam=deduped_bam, | deduped_bam=deduped_bam, | ||||
deduped_bam_idx=deduped_bam_idx, | deduped_bam_idx=deduped_bam_idx, | ||||
sample_id=sample_id, | sample_id=sample_id, | ||||
cluster_config=cluster_config, | cluster_config=cluster_config, | ||||
disk_size=disk_size | disk_size=disk_size | ||||
} | } | ||||
call depth.depth as depth { | |||||
input: | |||||
raw_depth=raw_depth, | |||||
deduped_depth=deduped_depth, | |||||
sample_id=sample_id, | |||||
regions=regions, | |||||
docker=docker, | |||||
cluster_config=cluster_config, | |||||
disk_size=disk_size | |||||
} | |||||
} | } |