您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

benchmark.wdl 2.6KB

4 年前
4 年前
4 年前
4 年前
4 年前
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. task benchmark {
  2. File vcf
  3. File benchmarking_dir
  4. File ref_dir
  5. String sample = basename(vcf,".splited.vcf")
  6. String fasta
  7. String docker
  8. String cluster_config
  9. String disk_size
  10. command <<<
  11. set -o pipefail
  12. set -e
  13. nt=$(nproc)
  14. mkdir -p /cromwell_root/tmp
  15. cp -r ${ref_dir} /cromwell_root/tmp/
  16. export HGREF=/cromwell_root/tmp/reference_data/GRCh38.d1.vd1.fa
  17. cat ${vcf} | grep '#' > header
  18. cat ${vcf} | grep -v '#' | grep -v '0/0' | grep -v '\./\.'| awk '
  19. BEGIN { OFS = "\t" }
  20. {
  21. for ( i=9; i<=NF; i++ ) {
  22. split($i,a,":") ;$i = a[1];
  23. }
  24. }
  25. { print }
  26. ' > body
  27. cat header body > filtered.vcf
  28. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg bgzip filtered.vcf -c > ${sample}.rtg.vcf.gz
  29. /opt/rtg-tools/dist/rtg-tools-3.10.1-4d58ead/rtg index -f vcf ${sample}.rtg.vcf.gz
  30. if [[ ${sample} =~ "LCL5" ]];then
  31. /opt/hap.py/bin/hap.py ${benchmarking_dir}/LCL5.ref.v20201103.vcf.gz ${sample}.rtg.vcf.gz -f ${benchmarking_dir}/Quartet.callable.voted.collapse.bed --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  32. elif [[ ${sample} =~ "LCL6" ]]; then
  33. /opt/hap.py/bin/hap.py ${benchmarking_dir}/LCL6.ref.v20201103.vcf.gz ${sample}.rtg.vcf.gz -f ${benchmarking_dir}/Quartet.callable.voted.collapse.bed --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  34. elif [[ ${sample} =~ "LCL7" ]]; then
  35. /opt/hap.py/bin/hap.py ${benchmarking_dir}/LCL7.ref.v20201103.vcf.gz ${sample}.rtg.vcf.gz -f ${benchmarking_dir}/Quartet.callable.voted.collapse.bed --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  36. elif [[ ${sample} =~ "LCL8" ]]; then
  37. /opt/hap.py/bin/hap.py ${benchmarking_dir}/LCL8.ref.v20201103.vcf.gz ${sample}.rtg.vcf.gz -f ${benchmarking_dir}/Quartet.callable.voted.collapse.bed --threads $nt -o ${sample} -r ${ref_dir}/${fasta}
  38. else
  39. echo "only for quartet samples"
  40. fi
  41. >>>
  42. runtime {
  43. docker:docker
  44. cluster:cluster_config
  45. systemDisk:"cloud_ssd 40"
  46. dataDisk:"cloud_ssd " + disk_size + " /cromwell_root/"
  47. }
  48. output {
  49. File rtg_vcf = "${sample}.rtg.vcf.gz"
  50. File rtg_vcf_index = "${sample}.rtg.vcf.gz.tbi"
  51. File gzip_vcf = "${sample}.vcf.gz"
  52. File gzip_vcf_index = "${sample}.vcf.gz.tbi"
  53. File roc_all_csv = "${sample}.roc.all.csv.gz"
  54. File roc_indel = "${sample}.roc.Locations.INDEL.csv.gz"
  55. File roc_indel_pass = "${sample}.roc.Locations.INDEL.PASS.csv.gz"
  56. File roc_snp = "${sample}.roc.Locations.SNP.csv.gz"
  57. File roc_snp_pass = "${sample}.roc.Locations.SNP.PASS.csv.gz"
  58. File summary = "${sample}.summary.csv"
  59. File extended = "${sample}.extended.csv"
  60. File metrics = "${sample}.metrics.json.gz"
  61. }
  62. }