用VEP对vcf格式的突变数据进行注释

VEP是国际三大数据库之一的ENSEMBL提供的,也是非常主流和方便,但它是基于perl语言的,所以在模块方面可能会有点烦人。跟snpEFF一样,也是对遗传变异信息提供更具体的注释,而不仅仅是基于位点区域和基因。如果你熟悉外显子联盟这个数据库EXAC(ExAC.r0.3.sites.vep.vcf.gz),你可以下载它所有的突变记录数据,看看它对每个变异位点到底注释了些什么,它就是典型的用VEP来注释的。

随便一个位点,注释了如此多的信息!~~~

1       861389  .       C       T       5621.53 PASS    AC=4;AC_AFR=0;AC_AMR=0;AC_Adj=4;AC_EAS=0;AC_FIN=0;AC_Het=4;AC_Hom=0;AC_NFE=3;AC_OTH=1;AC_SAS=0;AF=3.300e-05;AN=121216;AN_AFR=10212;AN_AMR=11516;AN_Adj=119730;AN_EAS=8606;AN_FIN=6594;AN_NFE=65414;AN_OTH=890;AN_SAS=16498;BaseQRankSum=2.78;ClippingRankSum=-2.380e-01;DP=1488042;FS=7.913;GQ_MEAN=62.49;GQ_STDDEV=14.73;Het_AFR=0;Het_AMR=0;Het_EAS=0;Het_FIN=0;Het_NFE=3;Het_OTH=1;Het_SAS=0;Hom_AFR=0;Hom_AMR=0;Hom_EAS=0;Hom_FIN=0;Hom_NFE=0;Hom_OTH=0;Hom_SAS=0;InbreedingCoeff=-0.0004;MQ=59.70;MQ0=0;MQRankSum=0.198;NCC=409;QD=15.11;ReadPosRankSum=0.561;VQSLOD=0.392;culprit=FS;DP_HIST=373|361|219|102|34981|16744|5493|1367|498|210|121|54|32|18|13|9|3|3|3|4,0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|1|1|1;GQ_HIST=26|352|26|24|472|62|71|34|23|29|34|16|44468|8058|2176|2147|1116|370|365|739,0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|4;CSQ=T|ENSG00000187634|ENST00000420190|Transcript|missense_variant|157|68|23|P/L|cCg/cTg||1||1|SAMD11|HGNC|28706|protein_coding|||ENSP00000411579||Q5SV95_HUMAN&I7FV93_HUMAN&A6PWC8_HUMAN|UPI000155D47C|deleterious(0)|probably_damaging(0.999)|2/7|||ENST00000420190.1:c.68C>T|ENSP00000411579.1:p.Pro23Leu||||||||||||||||||,T|ENSG00000268179|ENST00000598827|Transcript|missense_variant|211|211|71|G/R|Ggg/Agg||1||-1|AL645608.1|Clone_based_ensembl_gene||protein_coding|YES||ENSP00000471152||M0R0C9_HUMAN|UPI0000D61E05||probably_damaging(0.98)|6/6|||ENST00000598827.1:c.211G>A|ENSP00000471152.1:p.Gly71Arg||||||||||||||||||,T|ENSG00000187634|ENST00000437963|Transcript|missense_variant|128|68|23|P/L|cCg/cTg||1||1|SAMD11|HGNC|28706|protein_coding|||ENSP00000393181||Q5SV95_HUMAN&I7FV93_HUMAN|UPI000155D47B|deleterious(0)|probably_damaging(0.999)|2/5|||ENST00000437963.1:c.68C>T|ENSP00000393181.1:p.Pro23Leu||||||||||||||||||,T|ENSG00000187634|ENST00000342066|Transcript|missense_variant|151|68|23|P/L|cCg/cTg||1||1|SAMD11|HGNC|28706|protein_coding|YES|CCDS2.2|ENSP00000342313|SAM11_HUMAN|Q5SV95_HUMAN&I7FV93_HUMAN&A6PWC8_HUMAN|UPI0000D61E04|deleterious(0)|probably_damaging(0.999)|2/14|||ENST00000342066.3:c.68C>T|ENSP00000342313.3:p.Pro23Leu||||||||||||||||||,T||ENSR00000528850|RegulatoryFeature|regulatory_region_variant|||||||1||||||regulatory_region|||||||||||||||||||||||||||||||

头文件里面有对每一列的详细介绍,包括突变的标准格式

HGVS.c   --》ENST00000420190.1:c.68C>T

HGVS.p –》ENSP00000411579.1:p.Pro23Leu

还有该突变对蛋白功能的影响,包括sift和polyphen的打分~~~

不多说了,直接介绍该软件如何使用吧!

 

软件安装:

最新版是84:http://useast.ensembl.org/info/docs/tools/vep/script/vep_download.html

然后进入目录用perl的形式来安装这个软件:perl INSTALL.pl 即可

安装时其实有很多参数可以选择的,请仔细阅读介绍;http://useast.ensembl.org/info/docs/tools/vep/script/vep_download.html

 

前提是你已经安装好了两个模块!

perl -e 'use DBD::mysql'

perl -e 'use Archive::Extract'

如果不报错,就证明你已经安装过这些模块,如果报错,去搜索我以前关于perl模块的博客吧,不是很简单的事情。

By default the script will install the cache files in the ".vep" subdirectory of the user's home area. Using this option users can configure where cache files are installed.

我不想把cache文件放在默认的$HOME/.vep/下面,所以我安装的时候稍微做了更改

 

下载完了软件,接下来就要下载注释用的数据库啦!

它支持非常多的物种的注释,我这里拿人类做例子咯:ftp://ftp.ensembl.org/pub/release-82/variation/VEP/

我下载的是ftp里面的82 版本: wget ftp://ftp.ensembl.org/pub/release-82/variation/VEP/homo_sapiens_refseq_vep_82_GRCh37.tar.gz

有6.1G,所以会有点耗时~

下载完毕后直接用tar –zxvf解压即可使用啦!

我安装软件的时候指定了cache目录,而不是默认的$HOME/.vep/

 

Download the archive file for your species

Extract the archive in your cache directory. By default the VEP uses $HOME/.vep/ as the cache directory, where $HOME is your UNIX home directory.

mv homo_sapiens_vep_84.tar.gz ~/.vep/ cd ~/.vep/tar xfz homo_sapiens_vep_84.tar.gz

Run the VEP with the--cache option

所以要把下载的6.1G数据库放在我自己的cashe目录

如果你安装VEP的时候用的默认安装参数,就需要把自己下载的6.1G文件放在  ~/.vep/ 目录下面

参考:http://davetang.org/wiki2/index.php?title=VEP

输入数据:

它支持好几种输入格式数据:

  • BED: a simple tab-delimited format containing 3-12 columns of data. The first 3 columns contain the coordinates of the feature. If available, the VEP will use the 4th column of the file as the identifier of the feature.
  • GFF: a format for describing genes and other features. If available, the VEP will use the "ID" field as the identifier of this feature.
  • GTF: treated in an identical manner to GFF.
  • VCF: a format used to describe genomic variants. The VEP will use the 3rd column of the file as the identifier.
  • bigWig: a format for storage of dense continuous data. The VEP uses the value for the given position as the "identifier". Note that bigWig files contain their own indices, and do not need to be indexed by tabix.

Any other files can be easily converted to be compatible with the VEP; the easiest format to produce is a BED-like file containing coordinates and an (optional) identifier:

其实重点就是给出你的突变的坐标即可,在哪条染色体,什么位置!

我们可以拿snpEFF里面的example文件夹里面的数据来做测试。

 

 

运行命令:

可以直接进入安装目录(VEP_ensembl/ensembl-tools-release-84/scripts/variant_effect_predictor)运行那个主程序

variant_effect_predictor.pl -i example_GRCh37.vcf \

--cache --assembly GRCh37 \

--offline --force_overwrite

或者用全路径的形式去调用这个程序

参数非常复杂,详细介绍见:http://useast.ensembl.org/info/docs/tools/vep/script/vep_options.html

一般用标准参数就好啦,而且还有一些插件,其中我比较喜欢dbNSFP and LOFTEE plugins,这也是EXAC里面用过的。

3

 

结果解读:

这个非常复杂,对结果理解了多少,就是我们对软件理解了多少。

具体大家看readme吧,注释信息太多了,按需索取:

直接看EXAC(ExAC.r0.3.sites.vep.vcf.gz)文件里面近一亿条突变记录也能慢慢理解!

 

参考:http://gemini.readthedocs.io/en/latest/content/functional_annotation.html

 

2018年更新:

为了其它软件的顺利运行,我们根据教程来设置默认的安装目录及变量环境:Ensembl's VEP , If you don't have VEP installed, then follow this gist.

export VEP_PATH=$HOME/vep
export VEP_DATA=$HOME/.vep
mkdir $VEP_PATH $VEP_DATA; cd $VEP_PATH
export PERL5LIB=$VEP_PATH:$PERL5LIB
export PATH=$VEP_PATH/htslib:$PATH
## 这一块代码就创建文件夹和下载数据,理论上不会出错,取决于网速
 perl -e '{print join"\n",@INC}'
 ## 这种临时添加perl模块路径的方法不好用,需要修改 
 source   ~/.bashrc
 
curl -LO https://github.com/Ensembl/ensembl-tools/archive/release/86.tar.gz
tar -zxf 86.tar.gz --starting-file variant_effect_predictor --transform='s|.*/|./|g'

基因组数据库下载

Download and unpack VEP's offline cache for GRCh37, GRCh38, and GRCm38:

cd $VEP_DATA
rsync -zvh rsync://ftp.ensembl.org/ensembl/pub/release-86/variation/VEP/homo_sapiens_vep_86_GRCh37.tar.gz $VEP_DATA
rsync -zvh rsync://ftp.ensembl.org/ensembl/pub/release-86/variation/VEP/homo_sapiens_vep_86_GRCh38.tar.gz $VEP_DATA
rsync -zvh rsync://ftp.ensembl.org/ensembl/pub/release-86/variation/VEP/mus_musculus_vep_86_GRCm38.tar.gz $VEP_DATA
cat $VEP_DATA/*_vep_86_GRC{h37,h38,m38}.tar.gz | tar -izxf - -C $VEP_DATA
## 解压下载好的数据库到指定文件夹
# 4.9G Apr 23 19:40 homo_sapiens_vep_86_GRCh38.tar.gz
## 这一步下载的文件有点大,可能会些微耗时,一般不修改默认文件夹。

Install the Ensembl API, the reference FASTAs for GRCh37/GRCh38/GRCm38:

cd $VEP_PATH
#perl INSTALL.pl --AUTO af --SPECIES homo_sapiens --ASSEMBLY GRCh37 --DESTDIR $VEP_PATH --CACHEDIR $VEP_DATA
perl INSTALL.pl --AUTO af --SPECIES homo_sapiens --ASSEMBLY GRCh38 --DESTDIR $VEP_PATH --CACHEDIR $VEP_DATA
#perl INSTALL.pl --AUTO af --SPECIES mus_musculus --ASSEMBLY GRCm38 --DESTDIR $VEP_PATH --CACHEDIR $VEP_DATA
## 这中间会安装 BioPerl

如果成功,会有提示,如下:

 - downloading Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz
  - converting sequence data to bgzip format
 Going to run:
/home/jianmingzeng/vep/biodbhts/scripts/convert_gz_2_bgz.sh /home/jianmingzeng/.vep/homo_sapiens/86_GRCh38/Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz /home/jianmingzeng/vep/htslib/bgzip
This may take some time and will be removed when files are provided in bgzip format
Converted FASTA gzip file to bgzip successfully
[fai_load] build FASTA index.
 - indexing OK
The FASTA file should be automatically detected by the VEP when using --cache or --offline. If it is not, use "--fasta /home/jianmingzeng/.vep/homo_sapiens/86_GRCh38/Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz"
​
​
All done

因为用到perl模块,如果你的服务器环境没有配置好,会需要一些设置;

perl -e 'use LWP::Simple'wget -O- http://cpanmin.us | perl - -l ~/perl5 App::cpanminus local::lib
eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.profile
echo 'export MANPATH=$HOME/perl5/man:$MANPATH' >> ~/.profile
source ~/.profile
​
cpanm -v --notest -l ~/perl5  Archive::Extract;
cpanm -v --notest -l ~/perl5  Archive::Zip;
cpanm -v --notest -l ~/perl5  HTML::Entities;
cpanm -v --notest -l ~/perl5  LWP::Simple;
cpanm -v --notest -l ~/perl5  Compress::Zlib;
perl -e 'use Archive::Extract'
perl -e 'use HTML::Entities'
perl -e 'use HTML::HeadParser'
perl -e 'use LWP::Simple'
perl -e 'use Archive::Zip'
perl -e 'use Compress::Zlib'
​
cpanm -v --notest -l ~/perl5  DBD::mysql;
perl -e 'use DBD::mysql'

Convert the offline cache for use with tabix, that significantly speeds up the lookup of known variants:

#perl convert_cache.pl --species homo_sapiens --version 86_GRCh37 --dir $VEP_DATA
perl convert_cache.pl --species homo_sapiens --version 86_GRCh38 --dir $VEP_DATA
#perl convert_cache.pl --species mus_musculus --version 86_GRCm38 --dir $VEP_DATA
## 这个步骤特别耗时

更多细节去看我以前在生信菜鸟团博客分享的笔记:http://www.bio-info-trainee.com/1600.html

安装过程如下:

2018-04-27 13:42:12 - Processing homo_sapiens
2018-04-27 13:42:12 - Processing version 86_GRCh38
2018-04-27 13:42:12 - Processing _var cache type
[===========================================================]  [ 100% ]
2018-04-27 14:59:39 - All done!

下载安装关联软件

Download and build samtools and bcftools, which we'll need for steps below, and when running vcf2maf/maf2maf:

mkdir $VEP_PATH/samtools && cd $VEP_PATH/samtools
curl -LOOO https://github.com/samtools/{samtools/releases/download/1.3.1/samtools-1.3.1,bcftools/releases/download/1.3.1/bcftools-1.3.1,htslib/releases/download/1.3.2/htslib-1.3.2}.tar.bz2
cat *tar.bz2 | tar -ijxf -
cd htslib-1.3.2 && make && make prefix=$VEP_PATH/samtools install && cd ..
cd samtools-1.3.1 && make && make prefix=$VEP_PATH/samtools install && cd ..
cd bcftools-1.3.1 && make && make prefix=$VEP_PATH/samtools install && cd ..
cd ..

Download the liftOver binary down the same path, and make it executable:

curl -L http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/liftOver > bin/liftOver
chmod a+x bin/liftOver

Set $PATH to find all those tools, and also add this line to your ~/.bashrc to make it persistent. Be sure to edit the path below, if you didn't do this in your $HOME:

export PATH=$HOME/vep/samtools/bin:$PATH

使用VEP在真实数据

一般都需要先看看帮助文件:

 perl ~/vep/variant_effect_predictor.pl  --help
#----------------------------------#
# ENSEMBL VARIANT EFFECT PREDICTOR #
#----------------------------------#
​
version 86
by Will McLaren (wm2@ebi.ac.uk)
​
Help: dev@ensembl.org , helpdesk@ensembl.org
Twitter: @ensembl , @EnsemblWill
​

http://www.ensembl.org/info/docs/tools/vep/script/index.html

​
Usage:
perl variant_effect_predictor.pl [--cache|--offline|--database] [arguments]
​
Basic options
=============
​
--help                 Display this message and quit
​
-i | --input_file      Input file
-o | --output_file     Output file
--force_overwrite      Force overwriting of output file
--species [species]    Species to use [default: "human"]
​
--everything           Shortcut switch to turn on commonly used options. See web
                       documentation for details [default: off]
--fork [num_forks]     Use forking to improve script runtime
​
For full option documentation see:

http://www.ensembl.org/info/docs/tools/vep/script/vep_options.html

一般收入数据的vcf格式的:http://samtools.github.io/hts-specs/VCFv4.2.pdf

不过也没有那么标准,我给了如下:

chr1    12861477    .   T   C   .   .   32:1:3.03%:T:23:8:25.81%
chr1    16588939    .   T   C   .   .   22:0:0%:T:8:3:27.27%
chr1    16703018    .   C   G   .   .   28:0:0%:C:21:6:22.22%

处理起来毫无压力:

perl ~/vep/variant_effect_predictor.pl  -i tmp.vcf  -o test.results \
--cache --force_overwrite  --assembly GRCh38 --vcf

得到的结果其实和snpEFF没啥子区别,反正工具嘛,顺手即可。

其它输入数据:

它支持好几种输入格式数据:

  • BED: a simple tab-delimited format containing 3-12 columns of data. The first 3 columns contain the coordinates of the feature. If available, the VEP will use the 4th column of the file as the identifier of the feature.
  • GFF: a format for describing genes and other features. If available, the VEP will use the "ID" field as the identifier of this feature.
  • GTF: treated in an identical manner to GFF.
  • VCF: a format used to describe genomic variants. The VEP will use the 3rd column of the file as the identifier.
  • bigWig: a format for storage of dense continuous data. The VEP uses the value for the given position as the "identifier". Note that bigWig files contain their own indices, and do not need to be indexed by tabix.

Any other files can be easily converted to be compatible with the VEP; the easiest format to produce is a BED-like file containing coordinates and an (optional) identifier:

其实重点就是给出你的突变的坐标即可,在哪条染色体,什么位置!

不过,值得注意的是,我测试了BED格式,似乎不可以。

输出数据及其复杂

建议打印说明慢慢理解,争取熟记掌握。

snpEFF的输出文件说明书我就打印出来了。

非常重要。

Comments are closed.