【4.4】基因突变的功能注释--VEP

VEP(Variant Effect Predictor)官网教程:

一、软件简介

VEP(Variant Effect Predictor):ensembl旗下的注释工具,属于比较常用的注释软件

https://asia.ensembl.org/info/docs/tools/vep/index.html

基本功能:

1)借助Sequence Ontology (SO)将突变类型大致分为39种类型 https://asia.ensembl.org/info/genome/variation/prediction/predicted_data.html#consequences

二、安装

方法1 通过conda来安装(我是通过这个方法安装好的):

实际上,使用conda安装vep是最快的 (最新的版本号是107, 个人需要所以安装100版本)

conda create -n vep
conda activate vep     #我的是conda activate pVACtools 

conda install -c bioconda ensembl-vep
#conda install -c bioconda ensembl-vep=100

注意:conda安装过程只安装了依赖的包和程序代码,数据库还需自己下载

方法2

官网教程推荐用git安装 (这个因为网络问题,以及库的冲突,搞了半天)

git clone https://github.com/Ensembl/ensembl-vep
cd ensembl-vep
git pull
git checkout release/107 #可以改成你需要的版本号
perl INSTALL.pl

方法3

## 2.1 首先安装cpanm:http://www.cpan.org/modules/INSTALL.html
cpan App::cpanminus
## Now install any module you can find.
## cpanm Module::Name
## 我的经验是:不要在conda环境中安装,就在普通环境中安装
cpanm Archive::Zip
cpanm DBD::mysql
cpanm DBI
cpanm Bio::SeqFeature::Lite
cpanm Module::Build
cpanm Try::Tiny

## 2.2 下载VEP
## 假设你的安装路径为:/home/user_name/software/ensembl-vep-release-107
curl -L -O https://github.com/Ensembl/ensembl-vep/archive/release/107.zip
unzip 107.zip
cd ensembl-vep-release-107/

## 2.3 新建目录和环境变量
mkdir /home/user_name/software/ensembl-vep-release-107/cache
mkdir /home/user_name/software/ensembl-vep-release-107/plugins

## 1. add /home/user_name/software/ensembl-vep-release-107 to your PERL5LIB environment variable
## 2. add /home/user_name/software/ensembl-vep-release-107/htslib to your PATH environment variable
export PATH=$PATH:/home/user_name/software/ensembl-vep-release-107/htslib
export PERL5LIB=$PERL5LIB:/home/user_name/software/ensembl-vep-release-10

## 2.4 安装VEP

## 必加参数:--DESTDIR

## 运行这个cmd: 
## a (API + Bio::DB::HTS/htslib)     

perl INSTALL.pl --AUTO a --CACHEDIR /home/user_name/software/ensembl-vep-release-107/cache --DESTDIR /home/user_name/software/ensembl-vep-release-107 --SPECIES homo_sapiens --ASSEMBLY GRCh37

## ==== 最后显示:
All tests successful.
Files=42, Tests=1768, 127 wallclock secs ( 0.43 usr  0.14 sys + 118.73 cusr  7.60 csys = 126.90 CPU)
Result: PASS
 - OK!


## 然后运行这个cmd:
## c (cache)

perl INSTALL.pl --AUTO c --CACHEDIR /home/user_name/software/ensembl-vep-release-107/cache --DESTDIR /home/user_name/software/ensembl-vep-release-107 --SPECIES homo_sapiens --ASSEMBLY GRCh37

perl INSTALL.pl --AUTO c --CACHEDIR /home/user_name/software/ensembl-vep-release-107/cache --DESTDIR /home/user_name/software/ensembl-vep-release-107 --SPECIES homo_sapiens --ASSEMBLY GRCh38

## 然后运行这个cmd:
## p (plugins) — Require the use of the --PLUGINS flag to list the plugin(s) to install.

perl INSTALL.pl --ASSEMBLY GRCh37 --PLUGINS AncestralAllele,CADD,ClinPred,Conservation,dbNSFP,LoFtool --PLUGINSDIR /home/user_name/software/ensembl-vep-release-107/plugins --CACHEDIR /home/user_name/software/ensembl-vep-release-107/cache --SPECIES homo_sapiens

下载注释数据库

https://asia.ensembl.org/info/docs/tools/vep/script/vep_cache.html 建议cache 要跟vep版本匹配

VEP can use a variety of annotation sources to retrieve the transcript models used to predict consequence types.

  • Cache - a downloadable file containing all transcript models, regulatory features and variant data for a species
  • GFF or GTF - use transcript models defined in a tabix-indexed GFF or GTF file
  • Database - connect to a MySQL database server hosting Ensembl databases

推荐使用相同版本的Cache: Cache: a downloadable file containing all transcript models, regulatory features and variant data for a species

我的命令:

cd /data2/neoantigen/annotation_data_grch38_ens95/vep_cache2

wget -c https://ftp.ensembl.org/pub/release-105/variation/indexed_vep_cache/homo_sapiens_vep_105_GRCh38.tar.gz
tar xzf homo_sapiens_vep_105_GRCh38.tar.gz

wget -c https://ftp.ensembl.org/pub/release-105/fasta/homo_sapiens/dna/Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz
gzip -d Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz
bgzip Homo_sapiens.GRCh38.dna.primary_assembly.fa

./vep -i input.vcf –offline –hgvs –fasta Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz

其他方法:

方法一:使用vep命令

vep_install -a cf -s homo_sapiens -y GRCh37 -c /your_vepDB_dir/

# /usr/bin/perl /home/sam/project/neoantigen/lib/ensembl-vep/INSTALL.pl --CACHEDIR $BASEDIR/vep_cache --AUTO cf --SPECIES homo_sapiens --ASSEMBLY GRCh38

方法二:使用wget从vep的FTP下载

ftp://ftp.ensembl.org/pub/release-100/variation/indexed_vep_cache/homo_sapiens_vep_100_GRCh37.tar.gz
解压下载的tar.gz文件
tar -zxvf homo_sapiens_vep_100_GRCh37.tar.gz

测试:运行vep

./vep -i examples/homo_sapiens_GRCh38.vcf --cache

三、参数说明

vep -i homo_sapiens_GRCh38.vcf --fork 4 -o homo_sapiens_GRCh38.out.vcf \
--assembly GRCh38 --cache --cache_version 105 \
--dir /path/envs/vep/share/ensembl-vep-101.0-1(path) --offline \
--fasta /path/envs/vep/share/ensembl-vep-101.0-1/homo_sapiens/101_GRCh37/Homo_sapiens.GRCh37.dna.primary_assembly.fa.gz  \
--force_overwrite

必需参数

--input_file / -i 输入文件
--output_file / -o 指定输出文件名称(默认为"variant_effect_output.txt" )
--cache 使用cache数据库进行注释

Cache相关参数

--dir_cache 下载的cache文件所在目录
--cache_version 指定cache版本
--offline 使用本地运行模式

在用参数

--fasta 指明所用的参考基因组所在位置(第一次使用这个参数时,会自动给基因组fasta文件创建index,时间较长)注:使用--hgvs选项时,必须使用--fasta
--everything 输出所有可用的注释条目,启用的参数包括(--sift b, --polyphen b, --ccds, --hgvs, --symbol, --numbers, --domains, --regulatory, --canonical, --protein, --biotype, --af, --af_1kg, --af_esp, --af_gnomade, --af_gnomadg, --max_af, --pubmed, --uniprot, --mane, --tsl, --appris, --variant_class, --gene_phenotype, --mirna)

--sift 用算法预测突变引起的氨基酸变化对蛋白的功能是否有害。预测结果分为"deleterious" or "tolerated"两种。 --sift b表示同时给出预测结果和分值。如果加上-filter "SIFT is deleterious" 则可以筛选出有害的(deleterious)变异
--polyphen 启用PolyPhen工具对氨基酸变异对蛋白结构和功能的影响进行注释。--polyphen b表示同时给出预测结果和分值
--ccds 输出结果加入CCDS列,显示对应的CCDS transcript
--hgvs 输出结果加入HGVS注释(必须与--fasta同时使用)
--symbol 输出结果加入SYMBOL列,显示基因名称
--numbers 加入突变所在外显子/内含子位置(第几号)
--domains DOMAINS列, Adds names of overlapping protein domains to output
--regulatory Look for overlaps with regulatory regions
--canonical 输出结果加入CANONICAL列,这个tag注明所使用的是否是canonical转录本
--protein 输出结果加入ENSP列,显示ENSP编号
--biotype BIOTYPE列,Adds the biotype of the transcript or regulatory feature
--af Add the global allele frequency (AF) from 1000 Genomes Phase 3 data for any known co-located variant to the output
--af_1kg 在注释中加入1000Genome的不同人群频率(必须与--cache同时使用)
--af_esp Include allele frequency from NHLBI-ESP populations(必须与--cache同时使用)
--af_gnomadg Include allele frequency from Genome Aggregation Database (gnomAD) genome populations(必须与--cache同时使用)
-max_af 报告出1000Genome数据库中最高的人群频率
--pubmed Report Pubmed IDs for publications that cite existing variant.
--uniprot 输出UniProt数据库中最匹配的一条记录的accessions
--mane 增加一个tag注明所用的transcript是否在 MANE Select
或MANE Plus Clinical数据库中(只适用于GRCh38基因组)
--tsl Adds the transcript support level for this transcript to the output(只适用于GRCh38基因组)
--appris Adds the APPRIS isoform annotation for this transcript to the output(只适用于GRCh38基因组)

--variant_class Output the Sequence Ontology variant class
--gene_phenotype Indicates if the overlapped gene is associated with a phenotype, disease or trait
--mirna Reports where the variant lies in the miRNA secondary structure

其他参数

--refseq 使用refseq数据库进行注释
--species 说明测序物种(如果不是human,则需下载对应物种的注释数据库)
--vcf 按照VCF标准格式进行输出
--no_stats 不产生统计信息
--fork 使用多个CPU并行计算
--force_overwrite 如果输出文件已经存在,则强制覆盖(简写为--force)
--config 可以把常用的配置写在文件中通过此参数调用
--fields 自定义输出的条目(多个条目间使用 , 分隔)

四、我得案例

/usr/bin/perl /home/sam/project/neoantigen/lib/ensembl-vep/INSTALL.pl –CACHEDIR $BASEDIR/vep_cache –AUTO cf –SPECIES homo_sapiens –ASSEMBLY GRCh38

五、我的报错

报错1:

Can’t locate Module/Build.pm in @INC (you may need to install the Module::Build module) (@INC contains: /usr/local/lib/perl5/x86_64-linux-thread-multi /usr/local/lib/perl5 /usr/local/lib/perl5/x86_64-linux-thread-multi /usr/

解决办法:

cpan App::cpanminus
cpan Module::Build
perl -MCPAN -e 'install Bio::Perl'

cpanm autodie
cpanm Archive::Zip
cpanm DBD::mysql  
cpanm DBI
cpanm Bio::SeqFeature::Lite  # 失败
cpanm Module::Build
cpanm Try::Tiny

报错2

cpanm DBD::mysql 报错: Can‘t exec “mysql_config“: No such file or directory at Makefile.PL

http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz

解决办法:

yum install mysql   # 因为没有装mysql, 所以这个库一直有问题
yum install mariadb-devel # 因为没有装mysql, 所以这个库一直有问题
cpanm DBD::mysql

手动安装 DBD::mysql

cd /data/src/
wget -c https://www.cpan.org/modules/by-module/DBD/DBD-mysql-4.032.tar.gz
 gzip -cd DBD-mysql-4.032.tar.gz | tar xf -
cd DBD-mysql-4.032
 perl Makefile.PL
  make
  make test
(On Windows you may need to replace ``make'' with ``nmake'' or ``dmake''.) If the tests seem to look fine, you may continue with

  make install

https://perl.mines-albi.fr/perl5.6.1/site_perl/5.6.1/sun4-solaris/DBD/mysql/INSTALL.html

手动安装DBI

ERROR: DBI module not found. VEP requires the DBI perl module to function

#下载地址: http://www.cpan.org/modules/by-module/DBD/
wget -c  http://www.cpan.org/modules/by-module/DBD/DBI-1.630.tar.gz 
tar zxvf DBI-1.630.tar.gz 
cd DBI-1.630
perl Makefile.PL
make
make test
make install

原文链接:https://blog.csdn.net/meegle/article/details/26093969

报错3:

./Bio/tmp/Bio-DB-HTS-2.11 - moving files to ./biodbhts
 - making Bio::DB:HTS
/data/software/anaconda3/bin/x86_64-conda_cos6-linux-gnu-ld: unrecognized option '-Wl,-O2'
/data/software/anaconda3/bin/x86_64-conda_cos6-linux-gnu-ld: use the --help option for usage information
Warning: ExtUtils::CBuilder not installed or no compiler detected
Proceeding with configuration, but compilation may fail during Build

Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Bio-DB-HTS' version '2.11'
Building Bio-DB-HTS
Error: no compiler detected to compile 'lib/Bio/DB/HTS.c'.  Aborting
ERROR: Shared Bio::DB:HTS library not found

解决办法:

cpanm Module::Build

cd /data/software
git clone https://github.com/Ensembl/Bio-DB-HTS.git
cd Bio-DB-HTS

#perl -MCPAN -e 'install Bio::Perl'  # 提示么有bioperl 

报错4:

(nextNEOpi) [sam@c01 ensembl-vep]$ conda install -c bioconda ensembl-vep
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package libgcc-ng conflicts for:
conda-forge::python=3.6.10 -> libgcc-ng[version='>=7.3.0']
conda-forge::python=3.6.10 -> libffi[version='>=3.2.1,<3.3.0a0'] -> libgcc-ng[version='>=11.2.0|>=7.2.0|>=7.5.0|>=12|>=9.4.0']

Package zlib conflicts for:
conda-forge::python=3.6.10 -> zlib[version='>=1.2.11,<1.3.0a0']
conda-forge::python=3.6.10 -> sqlite[version='>=3.30.1,<4.0a0'] -> zlib[version='>=1.2.12,<1.3.0a0|>=1.2.13,<1.3.0a0|>=1.2.13,<2.0a0']

Package xz conflicts for:
ensembl-vep=106 -> htslib -> xz[version='5.2.*|>=5.2.3,<5.3.0a0|>=5.2.4,<5.3.0a0|>=5.2.5,<5.3.0a0|>=5.2.6,<5.3.0a0|>=5.2.5,<6.0a0']
conda-forge::python=3.6.10 -> xz[version='>=5.2.5,<5.3.0a0']

Package libstdcxx-ng conflicts for:
conda-forge::python=3.6.10 -> libstdcxx-ng[version='>=7.3.0']
conda-forge::python=3.6.10 -> libffi[version='>=3.2.1,<3.3.0a0'] -> libstdcxx-ng[version='>=7.2.0']The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.28=0
  - feature:|@/linux-64::__glibc==2.28=0

Your installed version is: 2.28

参考资料

药企,独角兽,苏州。团队长期招人,感兴趣的都可以发邮件聊聊:tiehan@sina.cn
个人公众号,比较懒,很少更新,可以在上面提问题,如果回复不及时,可发邮件给我: tiehan@sina.cn