# VEP custom annotation

**URL:** <https://discuss.hail.is/t/vep-custom-annotation/406>\
**Category:** Help \[0.1\]\
**Created:** [January 24, 2018, 1:15pm UTC](https://discuss.hail.is/t/vep-custom-annotation/406 "2018-01-24T13:15:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![enriquea](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/enriquea/32/237_2.png) [@enriquea](https://discuss.hail.is/u/enriquea)\
**Post date:** [January 24, 2018, 1:15pm UTC](https://discuss.hail.is/t/vep-custom-annotation/406/1 "2018-01-24T13:15:53Z")

</div>

Hi all,

I’m a beginner in Hail. I was wondering if it is possible to annotate from custom file/sources when using ‘vep’ function in Hail.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [January 24, 2018, 1:42pm UTC](https://discuss.hail.is/t/vep-custom-annotation/406/2 "2018-01-24T13:42:26Z")

</div>

I think I don’t completely understand what you’re looking to do. It’s not possible to run VEP with different configurations / plugins than we expose in the method parameters (e.g. CSQ vs the full json schema). However, it’s absolutely possible to annotate from text files like .bed / interval files, VCFs, or arbitrary delimited text files.

Can you share what those custom files/sources look like?

---

<div class="post-metadata">

**Author:** ![enriquea](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/enriquea/32/237_2.png) [@enriquea](https://discuss.hail.is/u/enriquea)\
**Post date:** [January 24, 2018, 1:57pm UTC](https://discuss.hail.is/t/vep-custom-annotation/406/3 "2018-01-24T13:57:08Z")

</div>

Hi,

I have annotated some VCF files with VEP using the below script:

```auto
#!/bin/bash
set -e
set -u
set -o pipefail

cd ~/projects/wes_10k

for inputfile in test_data/*.vcf.gz
 do
  outfile=$(basename "$inputfile")
  outfile="${outfile%.*}"
  echo "processing file: $inputfile ..."
  perl ./vep -i "$inputfile" -o ./vep_annotated/"$outfile.gz" \
       --fork 24 \
       --cache \
       --offline \
       --cache_version 90 \
       --custom ~/.vep/annotation/gonl.SV.r5.vcf.gz,GONL,vcf,exact,0,AF \
       --custom ~/.vep/annotation/anon-SweGen_STR_NSPHS_1000samples_freq_hg19.vcf.gz,SWEGEN,vcf,exact,0,AF \
       --custom ~/.vep/annotation/gnomad.exomes.r2.0.1.sites.noVEP.vcf.gz,GNOMAD,vcf,exact,0,AF \
       --custom ~/.vep/annotation/ExAC.0.3.GRCh37.vcf.gz,ExAC,vcf,exact,0,AF \
       --custom ~/.vep/annotation/conserved_sorted_cleaned.bed.gz,CONSERVED,bed,overlap,0 \
       --custom ~/.vep/annotation/ddd-unaffected-parental-maf-2017-03-18.bed.gz,DDD_PARENT,bed,overlap,0 \
       --custom ~/.vep/annotation/enhancer_sorted_cleaned.bed.gz,ENHANCER,bed,overlap,0 \
       --custom ~/.vep/annotation/ESP6500SI_21012013_MAF.bed.gz,ESP6500SI,bed,overlap,0 \
       --custom ~/.vep/annotation/heart_sorted_cleaned.bed.gz,ENH_HEART,bed,overlap,0 \
       --custom ~/.vep/annotation/segmentaldup_USCS_hg19_sorted_cleaned.bed.gz,SEGMENTAL_DUP,bed,overlap,0 \
       --custom ~/.vep/annotation/TRF_USCS_hg19_sorted_cleaned.bed.gz,TRF,bed,overlap,0 \
       --custom ~/.vep/annotation/UK10K_COHORT_20130116_AF.bed.gz,UK10K,bed,overlap,0 \
       --flag_pick --vcf --force_overwrite --compress_output bgzip
 done

```

But I would like to integrate this step also into my Hail workflow. So, Can I run Vep into Hail using the same settings?

Thanks

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [January 24, 2018, 3:01pm UTC](https://discuss.hail.is/t/vep-custom-annotation/406/4 "2018-01-24T15:01:22Z")

</div>

No, this won’t work ☹

It’s hard to make VEP totally customizable in Hail, because we need to know what the schema of the resulting annotations is. VEP doesn’t make it easy to know / guess that, so we’ve had to guess and check it for the standard+LOFTEE setup (the Hail supports).

It would certainly be possible to run this yourself on the sites files, and join with the multi-sample VCFs later.

---

<div class="post-metadata">

**Author:** ![enriquea](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/enriquea/32/237_2.png) [@enriquea](https://discuss.hail.is/u/enriquea)\
**Post date:** [January 24, 2018, 3:13pm UTC](https://discuss.hail.is/t/vep-custom-annotation/406/5 "2018-01-24T15:13:21Z")

</div>

I see, many thanks for your quick reply. Anyhow, Hail allows me to parse/process really well these annotations later in the workflow!

Thanks again!
