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.

39 lines
1.1KB

  1. task samtools {
  2. File sam
  3. String sample_id
  4. String bam = sample_id + ".bam"
  5. String sorted_bam = sample_id + ".sorted.bam"
  6. String percent_bam = sample_id + ".percent.bam"
  7. String sorted_bam_index = sample_id + ".sorted.bam.bai"
  8. String ins_size = sample_id + ".ins_size"
  9. String docker
  10. String cluster
  11. Int insert_size
  12. command <<<
  13. set -o pipefail
  14. set -e
  15. /opt/conda/bin/samtools view -bS ${sam} > ${bam}
  16. /opt/conda/bin/samtools sort -m 1000000000 ${bam} -o ${sorted_bam}
  17. /opt/conda/bin/samtools index ${sorted_bam}
  18. /opt/conda/bin/samtools view -bs 42.1 ${sorted_bam} > ${percent_bam}
  19. /opt/conda/bin/samtools stats -i ${insert_size} ${sorted_bam} |grep ^IS|cut -f 2- > ${sample_id}.ins_size
  20. >>>
  21. runtime {
  22. docker: docker
  23. cluster: cluster
  24. systemDisk: "cloud_ssd 40"
  25. dataDisk: "cloud_ssd 200 /cromwell_root/"
  26. }
  27. output {
  28. File out_bam = sorted_bam
  29. File out_percent = percent_bam
  30. File out_bam_index = sorted_bam_index
  31. File out_ins_size = ins_size
  32. }
  33. }