VEP (Variant Effect Predictor) predicts the functional effects of genomic variants. The annotated VCF will be converted into MAF based on vcf2maf.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

103 行
2.7KB

  1. task VEP {
  2. File vcf
  3. String sample_id
  4. String basename = basename(vcf,".vcf")
  5. File ref_dir
  6. String fasta
  7. String vep_path
  8. File cache
  9. String ncbi_build
  10. String species
  11. String vcf2maf_path
  12. String docker
  13. String cluster_config
  14. String disk_size
  15. command <<<
  16. set -o pipefail
  17. set -e
  18. nt=$(nproc)
  19. source /etc/profile
  20. #awk -F'\t' '{if(($1~"^#")||($1!~"^#" && $7=="PASS")){print $0}}' ${vcf} > ${sample_id}.vcf
  21. # Judge the SAMPLE info of vcf file
  22. tumor_id=`awk -F'\t' '{if($1~"^#CHROM"){print $10}}' ${vcf}`
  23. normal_id=`awk -F'\t' '{if($1~"^#CHROM"){print $11}}' ${vcf}`
  24. if [ $normal_id ]; then
  25. SAMPLE_vcf2maf="--tumor-id $tumor_id --normal-id $normal_id"
  26. SAMPLE_vcf2vcf="--vcf-tumor-id $tumor_id --vcf-normal-id $normal_id"
  27. cp ${vcf} raw.vcf
  28. else
  29. SAMPLE_vcf2maf="--tumor-id $tumor_id"
  30. # Add a column and remove it after vcf2vcf
  31. SAMPLE_vcf2vcf="--vcf-tumor-id $tumor_id --vcf-normal-id $tumor_id"
  32. awk -F'\t' 'OFS="\t" {if($1!~"^##" && length($11)==0) $11=$10; print $0}' ${vcf} > raw.vcf
  33. fi
  34. # Set the buffer_size based on the data size
  35. nrow=`awk -F'\t' '{if($1~"^chr"){print $0}}' ${vcf} | wc -l`
  36. if [ $nrow -lt 5000 ]; then
  37. buffer_size="--buffer_size 5000"
  38. else
  39. buffer_size="--buffer_size 1000"
  40. fi
  41. # vcf2vcf: transfer into a standardized format
  42. echo "Transfer the VCF file into a standardized format..."
  43. perl ${vcf2maf_path}/vcf2vcf.pl \
  44. --input-vcf $raw.vcf --output-vcf norm.vcf \
  45. $SAMPLE_vcf2vcf \
  46. --ref-fasta ${ref_dir}/${fasta}
  47. if [ $normal_id ]; then
  48. cp $norm.vcf ${basename}.norm.vcf
  49. else
  50. cut -f 1,2,3,4,5,6,7,8,9,10 $norm.vcf > ${basename}.norm.vcf
  51. # VEP annotation
  52. echo "VEP annotation..."
  53. perl ${vep_path}/vep --format vcf --vcf \
  54. --input_file ${basename}.norm.vcf --output_file ${basename}.vep.vcf \
  55. --assembly ${ncbi_build} \
  56. --species ${species} \
  57. --everything --af_exac \
  58. --offline \
  59. --cache --dir_cache ${cache} \
  60. --fasta ${ref_dir}/${fasta} \
  61. $buffer_size \
  62. --fork $nt
  63. # vcf2maf
  64. echo "vcf2maf..."
  65. perl ${vcf2maf_path}/vcf2maf.pl \
  66. --inhibit-vep \
  67. --input-vcf ${basename}.vep.vcf --output-maf ${basename}.maf \
  68. $SAMPLE_vcf2maf \
  69. --ref-fasta ${ref_dir}/${fasta} \
  70. --ncbi-build ${ncbi_build} \
  71. --species ${species}
  72. >>>
  73. runtime {
  74. docker: docker
  75. cluster: cluster_config
  76. systemDisk: "cloud_ssd 40"
  77. dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
  78. }
  79. output {
  80. File norm_vcf = "${basename}.norm.vcf"
  81. File vep_vcf = "${basename}.vep.vcf"
  82. File maf = "${basename}.maf"
  83. }
  84. }