You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
940B

  1. task depth {
  2. File raw_bam
  3. File raw_bam_idx
  4. File deduped_bam
  5. File deduped_bam_idx
  6. String sample_id
  7. File regions
  8. String docker
  9. String cluster_config
  10. String disk_size
  11. command <<<
  12. /opt/conda/bin/samtools depth -aa -b ${regions} ${raw_bam} > ${sample_id}.raw.depth
  13. /opt/conda/bin/samtools depth -aa -b ${regions} ${deduped_bam} > ${sample_id}.deduped.depth
  14. sort -k1,1V -k2,2n ${sample_id}.raw.depth | awk '{printf "%s:%i\t%i\n" , $1,$2,$3}' > ${sample_id}.raw.sorted.depth
  15. sort -k1,1V -k2,2n ${sample_id}.deduped.depth | awk '{printf "%s:%i\t%i\n" , $1,$2,$3}' > ${sample_id}.deduped.sorted.depth
  16. 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
  17. >>>
  18. runtime {
  19. docker:docker
  20. cluster: cluster_config
  21. systemDisk: "cloud_ssd 40"
  22. dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
  23. }
  24. output {
  25. File bam_depth = "${sample_id}.depth"
  26. }
  27. }