Browse Source

update: depth.wdl

master
YaqingLiu 4 years ago
parent
commit
0a50f7e548
3 changed files with 21 additions and 10 deletions
  1. +4
    -2
      inputs
  2. +9
    -3
      tasks/depth.wdl
  3. +8
    -5
      workflow.wdl

+ 4
- 2
inputs View File

{ {
"{{ 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 }}",

+ 9
- 3
tasks/depth.wdl View File

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 {

+ 8
- 5
workflow.wdl View File

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,

Loading…
Cancel
Save