{ | { | ||||
"{{ project_name }}.sample_id": "{{ sample_id }}", | "{{ project_name }}.sample_id": "{{ sample_id }}", | ||||
"{{ project_name }}.bam": "{{ bam }}", | |||||
"{{ project_name }}.bam_idx": "{{ bam_idx }}", | |||||
"{{ project_name }}.raw_bam": "{{ raw_bam }}", | |||||
"{{ project_name }}.raw_bam_idx": "{{ raw_bam_idx }}", | |||||
"{{ project_name }}.deduped_bam": "{{ deduped_bam }}", | |||||
"{{ project_name }}.deduped_bam_idx": "{{ deduped_bam_idx }}", | |||||
"{{ project_name }}.regions": "{{ regions }}", | "{{ project_name }}.regions": "{{ regions }}", | ||||
"{{ project_name }}.disk_size": "{{ disk_size }}", | "{{ project_name }}.disk_size": "{{ disk_size }}", | ||||
"{{ project_name }}.docker": "{{ docker }}", | "{{ project_name }}.docker": "{{ docker }}", |
task depth { | task depth { | ||||
File bam | |||||
File bam_idx | |||||
File raw_bam | |||||
File raw_bam_idx | |||||
File deduped_bam | |||||
File deduped_bam_idx | |||||
String sample_id | String sample_id | ||||
File regions | File regions | ||||
String docker | String docker | ||||
String disk_size | String disk_size | ||||
command <<< | command <<< | ||||
/opt/conda/bin/samtools depth -b ${regions} ${bam} > ${sample_id}.depth | |||||
/opt/conda/bin/samtools depth -b ${regions} ${raw_bam} > ${sample_id}.raw.depth | |||||
/opt/conda/bin/samtools depth -b ${regions} ${dedup_bam} > ${sample_id}.deduped.depth | |||||
awk '{printf "%s:%i\t%i\n" , $1,$2,$3}' ${sample_id}.raw.depth | sort > ${sample_id}.raw.sorted.depth | |||||
awk '{printf "%s:%i\t%i\n" , $1,$2,$3}' ${sample_id}.deduped.depth | sort > ${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 { | runtime { |
import "./tasks/depth.wdl" as depth | import "./tasks/depth.wdl" as depth | ||||
workflow {{ project_name }} { | workflow {{ project_name }} { | ||||
File bam | |||||
File bam_idx | |||||
File raw_bam | |||||
File raw_bam_idx | |||||
File deduped_bam | |||||
File deduped_bam_idx | |||||
String sample_id | String sample_id | ||||
File regions | File regions | ||||
String docker | String docker | ||||
call depth.depth as depth { | call depth.depth as depth { | ||||
input: | input: | ||||
bam=bam, | |||||
bam_idx=bam_idx, | |||||
raw_bam=raw_bam, | |||||
raw_bam_idx=raw_bam_idx, | |||||
deduped_bam=deduped_bam, | |||||
deduped_bam_idx=deduped_bam_idx, | |||||
sample_id=sample_id, | sample_id=sample_id, | ||||
regions=regions, | regions=regions, | ||||
docker=docker, | docker=docker, |