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.

81 lines
2.1KB

  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. temp_mean_insert_size=`cat pindel_result/${sample_id}_picard.txt|sed -n '8p'|cut -f 6|cut -d . -f 1`
  22. if [ $temp_mean_insert_size -lt 151 ];then
  23. mean_insert_size=151
  24. else
  25. mean_insert_size=`echo $temp_mean_insert_size`
  26. fi
  27. bam_file_name=`echo ${bam}|awk -F "/" '{print $NF}'`
  28. echo -e "./input/$bam_file_name\t$mean_insert_size\t${sample_id}" > ${sample_id}_config.txt
  29. pindel -i ${sample_id}_config.txt \
  30. -f ${reference} \
  31. -o ./pindel_result/${sample_id} \
  32. -c all \
  33. -T 4 \
  34. -x 4 \
  35. -l \
  36. -B 0 \
  37. -M 3 \
  38. -J /software/picard/hg38_ucsc_centromere.bed
  39. grep "ChrID" pindel_result/${sample_id}_SI > pindel_result/${sample_id}_all_indel
  40. grep "ChrID" pindel_result/${sample_id}_D >> pindel_result/${sample_id}_all_indel
  41. awk -v chrID="chr1" '$8==chrID {print}' pindel_result/${sample_id}_all_indel > pindel_result/${sample_id}_indel
  42. for i in `seq 2 22` X Y M
  43. do
  44. awk -v chrID=chr$i '$8==chrID {print}' pindel_result/${sample_id}_all_indel >> pindel_result/${sample_id}_indel
  45. done
  46. pindel2vcf -r ${reference} \
  47. -R GRCh38.d1.vd1 \
  48. -d GDC \
  49. -p pindel_result/${sample_id}_indel \
  50. -v pindel_result/${sample_id}.pindel.indel.vcf
  51. >>>
  52. runtime {
  53. docker: docker
  54. cluster: cluster
  55. systemDisk: "cloud_ssd 40"
  56. dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
  57. }
  58. output {
  59. Array[File] pindel_result = glob("./pindel_result/${sample_id}*")
  60. }
  61. }