Germline & Somatic short variant discovery (SNVs + Indels) for WGS & WES.
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.

110 line
3.2KB

  1. task VEP {
  2. File vcf
  3. String sample_id
  4. String basename = basename(vcf,".vcf")
  5. String tumor_id
  6. String normal_id
  7. File ref_dir
  8. String fasta
  9. String vep_path
  10. File cache
  11. String hg
  12. String species
  13. String vcf2maf_path
  14. String docker
  15. String cluster_config
  16. String disk_size
  17. command <<<
  18. set -o pipefail
  19. set -e
  20. nt=$(nproc)
  21. awk -F'\t' '{if(($1~"^#")||($1!~"^#" && $7=="PASS")){print $0}}' ${vcf} > ${basename}.PASS.vcf
  22. # Define ncbi_build
  23. if [ ${hg} == "hg19" ]; then
  24. ncbi_build="GRCh37"
  25. elif [ ${hg} == "hg38" ]; then
  26. ncbi_build="GRCh38"
  27. ncol=`awk -F'\t' '{if($1!~"^#"){print NF}}' ${basename}.PASS.vcf | uniq`
  28. if [ $ncol -lt 11 ]; then
  29. vcf2maf_ID="--tumor-id ${tumor_id} --normal-id ${normal_id}"
  30. else
  31. vcf2maf_ID="--tumor-id ${tumor_id}"
  32. fi
  33. nrow=`awk -F'\t' '{if($1~"^chr"){print $0}}' ${basename}.PASS.vcf | wc -l`
  34. if [ $nrow -lt 5000 ]; then
  35. buffer_size="--buffer_size 5000"
  36. else
  37. buffer_size="--buffer_size 500"
  38. fi
  39. # Extract the BND variants from VCF
  40. # awk -F'\t' '{if(($1~"^#")||($8!~".*SVTYPE=BND.*")){print $0}}' ${sample_id}.PASS.vcf > ${sample_id}.PASS.vcf2maf.vcf
  41. # awk -F'\t' '{if(($1~"^#")||($8~".*SVTYPE=BND.*")){print $0}}' ${sample_id}.PASS.vcf > ${sample_id}.INPUT.VEP.vcf
  42. # vcf2maf
  43. # perl ${vcf2maf_path}/vcf2maf.pl \
  44. # --input-vcf ${sample_id}.PASS.vcf2maf.vcf --output-maf ${basename}.maf \
  45. # --tumor-id ${tumor_id} --normal-id ${normal_id} \
  46. # --ref-fasta ${ref_dir}/${fasta} \
  47. # --vep-path ${vep_path} \
  48. # --vep-data ${cache} \
  49. # --ncbi-build ${ncbi_build} \
  50. # --species ${species} \
  51. # --vep-fork $nt
  52. # vep
  53. # perl ${vep_path}/vep \
  54. # --input_file ${basename}.PASS.vcf --output_file ${basename}.PASS.vep.vcf \
  55. # --fasta ${ref_dir}/${fasta} \
  56. # --dir ${cache} \
  57. # --assembly ${ncbi_build} \
  58. # --species ${species} \
  59. # --fork $nt \
  60. # --format vcf --vcf \
  61. # --no_progress \
  62. # --no_stats \
  63. # $buffer_size \
  64. # --sift b \
  65. # --ccds --uniprot --hgvs --symbol --numbers --domains --gene_phenotype --canonical --protein --biotype --uniprot --tsl --variant_class --shift_hgvs 1 --check_existing --total_length --allele_number --no_escape --xref_refseq --failed 1 --flag_pick_allele --pick_order canonical,tsl,biotype,rank,ccds,length --force_overwrite --offline --pubmed --regulatory
  66. perl ${vep_path}/vep --format vcf --vcf \
  67. --assembly $ncbi_build \
  68. --species ${species} \
  69. --everything --af_exac \
  70. --offline \
  71. --cache --dir_cache ${cache} \
  72. --fasta ${ref_dir}/${fasta} \
  73. --input_file ${basename}.PASS.vcf --output_file ${basename}.PASS.vep.vcf
  74. # vcf2maf
  75. perl ${vcf2maf_path}/vcf2maf.pl \
  76. --inhibit-vep \
  77. --input-vcf ${basename}.PASS.vep.vcf --output-maf ${basename}.PASS.maf \
  78. $vcf2maf_ID \
  79. --ref-fasta ${ref_dir}/${fasta} \
  80. --ncbi-build $ncbi_build \
  81. --species ${species} \
  82. --vep-fork $nt
  83. >>>
  84. runtime {
  85. docker: docker
  86. cluster: cluster_config
  87. systemDisk: "cloud_ssd 40"
  88. dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
  89. }
  90. output {
  91. File input_vcf = "${basename}.PASS.vcf"
  92. File vep_vcf = "${basename}.PASS.vep.vcf"
  93. File maf = "${basename}.PASS.maf"
  94. }
  95. }