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.

75 lines
1.9KB

  1. task pindel {
  2. String sample_id
  3. File bam
  4. File reference
  5. File reference_fai
  6. String docker
  7. String cluster
  8. String disk_size
  9. command <<<
  10. set -o pipefail
  11. set -e
  12. mkdir ./pindel_result/
  13. mkdir ./input
  14. cp ${bam} ./input
  15. bam_file_name=`echo ${bam}|awk -F "/" '{print $NF}'`
  16. samtools index -@ 4 ./input/$bam_file_name
  17. java "-Xmx16G" -jar /software/picard/picard.jar CollectInsertSizeMetrics \
  18. -H ./pindel_result/${sample_id}_picard.pdf \
  19. -I ./input/$bam_file_name \
  20. -O ./pindel_result/${sample_id}_picard.txt
  21. mean_insert_size=`cat pindel_result/${sample_id}_picard.txt|sed -n '8p'|cut -f 6|cut -d . -f 1`
  22. bam_file_name=`echo ${bam}|awk -F "/" '{print $NF}'`
  23. echo -e "./input/$bam_file_name\t$mean_insert_size\t${sample_id}" > ${sample_id}_config.txt
  24. pindel -i ${sample_id}_config.txt \
  25. -f ${reference} \
  26. -o ./pindel_result/${sample_id} \
  27. -c all \
  28. -T 4 \
  29. -x 4 \
  30. -l \
  31. -B 0 \
  32. -M 3 \
  33. -J /software/picard/hg38_ucsc_centromere.bed
  34. grep "ChrID" pindel_result/${sample_id}_SI > pindel_result/${sample_id}_all_indel
  35. grep "ChrID" pindel_result/${sample_id}_D >> pindel_result/${sample_id}_all_indel
  36. awk -v chrID="chr1" '$8==chrID {print}' pindel_result/${sample_id}_all_indel > pindel_result/${sample_id}_indel
  37. for i in `seq 2 22` X Y M
  38. do
  39. awk -v chrID=chr$i '$8==chrID {print}' pindel_result/${sample_id}_all_indel >> pindel_result/${sample_id}_indel
  40. done
  41. pindel2vcf -r ${reference} \
  42. -R GRCh38.d1.vd1 \
  43. -d GDC \
  44. -p pindel_result/${sample_id}_indel \
  45. -v pindel_result/${sample_id}.pindel.indel.vcf
  46. >>>
  47. runtime {
  48. docker: docker
  49. cluster: cluster
  50. systemDisk: "cloud_ssd 40"
  51. dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
  52. }
  53. output {
  54. Array[File] pindel_result = glob("./pindel_result/${sample_id}*")
  55. }
  56. }