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.

86 line
3.8KB

  1. task benchmark {
  2. File vcf
  3. File benchmarking_dir
  4. File ref_dir
  5. File filtered_bed
  6. String sample = basename(vcf,".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. cat ${vcf} | grep '#' > header_original
  24. cat ${vcf} | grep -v '#' | sort -k1,1 -k2,2n > body_sorted
  25. cat header_original body_sorted > sorted.vcf
  26. if [[ ${sample} =~ "LCL5" ]];then
  27. /opt/hap.py/bin/hap.py /cromwell_root/tmp/reference_datasets_v202103/LCL5.high.confidence.calls.vcf sorted.vcf -f ${filtered_bed} --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  28. cat sorted.vcf | grep '##' > header
  29. cat sorted.vcf | grep -v '#' > body
  30. cat header LCL5_name body > LCL5.vcf
  31. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg bgzip LCL5.vcf -c > ${sample}.reformed.vcf.gz
  32. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg index -f vcf ${sample}.reformed.vcf.gz
  33. elif [[ ${sample} =~ "LCL6" ]]; then
  34. /opt/hap.py/bin/hap.py /cromwell_root/tmp/reference_datasets_v202103/LCL6.high.confidence.calls.vcf sorted.vcf -f ${filtered_bed} --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  35. cat sorted.vcf | grep '##' > header
  36. cat sorted.vcf | grep -v '#' > body
  37. cat header LCL6_name body > LCL6.vcf
  38. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg bgzip LCL6.vcf -c > ${sample}.reformed.vcf.gz
  39. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg index -f vcf ${sample}.reformed.vcf.gz
  40. elif [[ ${sample} =~ "LCL7" ]]; then
  41. /opt/hap.py/bin/hap.py /cromwell_root/tmp/reference_datasets_v202103/LCL7.high.confidence.calls.vcf sorted.vcf -f ${filtered_bed} --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  42. cat sorted.vcf | grep '##' > header
  43. cat sorted.vcf | grep -v '#' > body
  44. cat header LCL7_name body > LCL7.vcf
  45. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg bgzip LCL7.vcf -c > ${sample}.reformed.vcf.gz
  46. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg index -f vcf ${sample}.reformed.vcf.gz
  47. elif [[ ${sample} =~ "LCL8" ]]; then
  48. /opt/hap.py/bin/hap.py /cromwell_root/tmp/reference_datasets_v202103/LCL8.high.confidence.calls.vcf sorted.vcf -f ${filtered_bed} --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  49. cat sorted.vcf | grep '##' > header
  50. cat sorted.vcf | grep -v '#' > body
  51. cat header LCL8_name body > LCL8.vcf
  52. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg bgzip LCL8.vcf -c > ${sample}.reformed.vcf.gz
  53. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg index -f vcf ${sample}.reformed.vcf.gz
  54. else
  55. echo "only for quartet samples"
  56. fi
  57. >>>
  58. runtime {
  59. docker:docker
  60. cluster:cluster_config
  61. systemDisk:"cloud_ssd 40"
  62. dataDisk:"cloud_ssd " + disk_size + " /cromwell_root/"
  63. }
  64. output {
  65. File rtg_vcf = "${sample}.reformed.vcf.gz"
  66. File rtg_vcf_index = "${sample}.reformed.vcf.gz.tbi"
  67. File gzip_vcf = "${sample}.vcf.gz"
  68. File gzip_vcf_index = "${sample}.vcf.gz.tbi"
  69. File roc_all_csv = "${sample}.roc.all.csv.gz"
  70. File roc_indel = "${sample}.roc.Locations.INDEL.csv.gz"
  71. File roc_indel_pass = "${sample}.roc.Locations.INDEL.PASS.csv.gz"
  72. File roc_snp = "${sample}.roc.Locations.SNP.csv.gz"
  73. File roc_snp_pass = "${sample}.roc.Locations.SNP.PASS.csv.gz"
  74. File summary = "${sample}.summary.csv"
  75. File extended = "${sample}.extended.csv"
  76. File metrics = "${sample}.metrics.json.gz"
  77. }
  78. }