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.

84 lines
3.7KB

  1. task benchmark {
  2. File filtered_vcf
  3. File benchmarking_dir
  4. File ref_dir
  5. File bed
  6. String sample = basename(filtered_vcf,".filtered.vcf")
  7. String fasta
  8. String docker
  9. String cluster_config
  10. String disk_size
  11. command <<<
  12. set -o pipefail
  13. set -e
  14. nt=$(nproc)
  15. mkdir -p /cromwell_root/tmp
  16. cp -r ${ref_dir} /cromwell_root/tmp/
  17. cp -r ${benchmarking_dir} /cromwell_root/tmp/
  18. export HGREF=/cromwell_root/tmp/reference_data/GRCh38.d1.vd1.fa
  19. echo -e "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tLCL5" > LCL5_name
  20. echo -e "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tLCL6" > LCL6_name
  21. echo -e "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tLCL7" > LCL7_name
  22. echo -e "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tLCL8" > LCL8_name
  23. if [[ ${sample} =~ "LCL5" ]];then
  24. /opt/hap.py/bin/hap.py /cromwell_root/tmp/reference_datasets_v202103/LCL5.high.confidence.calls.vcf ${filtered_vcf} -f ${bed} --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  25. cat ${filtered_vcf} | grep '##' > header
  26. cat ${filtered_vcf} | grep -v '#' > body
  27. cat header LCL5_name body > LCL5.vcf
  28. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg bgzip LCL5.vcf -c > ${sample}.reformed.vcf.gz
  29. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg index -f vcf ${sample}.reformed.vcf.gz
  30. elif [[ ${sample} =~ "LCL6" ]]; then
  31. /opt/hap.py/bin/hap.py /cromwell_root/tmp/reference_datasets_v202103/LCL6.high.confidence.calls.vcf ${filtered_vcf} -f ${bed} --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  32. cat ${filtered_vcf} | grep '##' > header
  33. cat ${filtered_vcf} | grep -v '#' > body
  34. cat header LCL6_name body > LCL6.vcf
  35. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg bgzip LCL6.vcf -c > ${sample}.reformed.vcf.gz
  36. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg index -f vcf ${sample}.reformed.vcf.gz
  37. elif [[ ${sample} =~ "LCL7" ]]; then
  38. /opt/hap.py/bin/hap.py /cromwell_root/tmp/reference_datasets_v202103/LCL7.high.confidence.calls.vcf ${filtered_vcf} -f ${bed} --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  39. cat ${filtered_vcf} | grep '##' > header
  40. cat ${filtered_vcf} | grep -v '#' > body
  41. cat header LCL7_name body > LCL7.vcf
  42. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg bgzip LCL7.vcf -c > ${sample}.reformed.vcf.gz
  43. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg index -f vcf ${sample}.reformed.vcf.gz
  44. elif [[ ${sample} =~ "LCL8" ]]; then
  45. /opt/hap.py/bin/hap.py /cromwell_root/tmp/reference_datasets_v202103/LCL8.high.confidence.calls.vcf ${filtered_vcf} -f ${bed} --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  46. cat ${filtered_vcf} | grep '##' > header
  47. cat ${filtered_vcf} | grep -v '#' > body
  48. cat header LCL8_name body > LCL8.vcf
  49. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg bgzip LCL8.vcf -c > ${sample}.reformed.vcf.gz
  50. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg index -f vcf ${sample}.reformed.vcf.gz
  51. else
  52. echo "only for quartet samples"
  53. fi
  54. >>>
  55. runtime {
  56. docker:docker
  57. cluster:cluster_config
  58. systemDisk:"cloud_ssd 40"
  59. dataDisk:"cloud_ssd " + disk_size + " /cromwell_root/"
  60. }
  61. output {
  62. File rtg_vcf = "${sample}.reformed.vcf.gz"
  63. File rtg_vcf_index = "${sample}.reformed.vcf.gz.tbi"
  64. File gzip_vcf = "${sample}.vcf.gz"
  65. File gzip_vcf_index = "${sample}.vcf.gz.tbi"
  66. File roc_all_csv = "${sample}.roc.all.csv.gz"
  67. File roc_indel = "${sample}.roc.Locations.INDEL.csv.gz"
  68. File roc_indel_pass = "${sample}.roc.Locations.INDEL.PASS.csv.gz"
  69. File roc_snp = "${sample}.roc.Locations.SNP.csv.gz"
  70. File roc_snp_pass = "${sample}.roc.Locations.SNP.PASS.csv.gz"
  71. File summary = "${sample}.summary.csv"
  72. File extended = "${sample}.extended.csv"
  73. File metrics = "${sample}.metrics.json.gz"
  74. }
  75. }