參考文章:
http://annovar.openbioinformatics.org/en/latest/
https://cloud.tencent.com/developer/article/1054541
1.下載ANNOVAR軟件包
需要使用.edu郵箱進行注冊,然后作者會發最新的軟件包到你郵箱
解壓之后是有6個perl腳本,和兩個文件夾humandb/, example/
drwxr-xr-x 3 1001 fqq1024 4.0K Jun 19 18:32 humandb
drwxr-xr-x 2 1001 fqq1024 4.0K Apr 17 2018 example
-rwxr-xr-x 1 1001 fqq1024 217K Apr 17 2018 annotate_variation.pl
-rwxr-xr-x 1 1001 fqq1024 27K Apr 17 2018 coding_change.pl
-rwxr-xr-x 1 1001 fqq1024 167K Apr 17 2018 convert2annovar.pl
-rwxr-xr-x 1 1001 fqq1024 19K Apr 17 2018 retrieve_seq_from_fasta.pl
-rwxr-xr-x 1 1001 fqq1024 39K Apr 17 2018 table_annovar.pl
-rwxr-xr-x 1 1001 fqq1024 22K Apr 17 2018 variants_reduction.pl
2.獲取wegene 測序得到的SNP
cat wegene/20190615wegene_core_results.txt |less -SN
1 # This data file generated by WeGene at: Sat, 15 Jun 2019 12:04:02
2 #
3 # This file contains the genotype called by WeGene with our
4 # internal quality control pipeline. The low quality sites
5 # were discarded. If we could not determine the genotypes,
6 # it will be —-. As such, the call rate and accuracy may not
7 # be one hundred percent. So this data is suitable only for
8 # research, educational, and informational use and not for
9 # medical or other use.
10
11 # This text file is a list of your data which are TAB-
12 # separated. Each line corresponds to a single SNP or short
13 # InDel (insertion or deletion).
14 # For each SNP or short InDel, we provide its identifier (an
15 # rsid or an internal id), its location on the reference human
16 # genome (human assembly build 37, GRCh37) and the genotype
17 # call oriented with respect to the plus strand on the human
18 # reference sequence. For consistency, the genotypes are always
19 # two base pairs, including hemizygous calls.
20
21 # Please note, as our ability to call genotypes improves, it is
22 # possible that your data may be slightly different at different
23 # times.
24
25 # rsid chromosome position genotype
26 rs9701055 1 565433 CC
27 rs9651229 1 567667 CC
提取SNP信息,也就是把空格和#開頭的刪除
cat wegene/20190615wegene_core_results.txt |grep -v "#"|grep -v "^$"|less -SN
1 rs9701055 1 565433 CC
2 rs9651229 1 567667 CC
3 rs9701872 1 568208 TT
4 rs11497407 1 568527 GG
cat wegene/20190615wegene_core_results.txt |grep -v "#"|grep -v "^$" > mysnpID.txt
3. 將SNP文件轉換為ANNOVAR的輸入文件.avinput
perl convert2annovar.pl -format rsid example/snplist.txt -dbsnpfile humandb/hg19_snp138.txt > snplist.avinput
這個時候你可能需要下載hg19_snp138數據至本地的humandb/
參考http://annovar.openbioinformatics.org/en/latest/user-guide/download/
#約12G大小
perl annotate_variation.pl -buildver hg19 -downdb -webfrom annovar snp138 humandb/
4. 基于GWAS對SNP進行注釋(Identify variants reported in previously published GWAS)
#下載GWAS數據60M
perl annotate_variation.pl -build hg19 -downdb gwasCatalog humandb/
#注釋
perl annotate_variation.pl -regionanno -build hg19 -out ex1 -dbtype gwasCatalog snplist.avinput humandb/
##注釋很快3min之內完成
ls -lht annovar
-rw-r--r-- 1 root root 3.0M Jun 20 07:45 ex1.hg19_gwasCatalog
-rw-r--r-- 1 root root 45M Jun 20 07:34 snp.avinput
drwxr-xr-x 3 1001 fqq1024 4.0K Jun 19 18:32 humandb
drwxr-xr-x 2 1001 fqq1024 4.0K Apr 17 2018 example
-rwxr-xr-x 1 1001 fqq1024 217K Apr 17 2018 annotate_variation.pl
-rwxr-xr-x 1 1001 fqq1024 27K Apr 17 2018 coding_change.pl
-rwxr-xr-x 1 1001 fqq1024 167K Apr 17 2018 convert2annovar.pl
-rwxr-xr-x 1 1001 fqq1024 19K Apr 17 2018 retrieve_seq_from_fasta.pl
-rwxr-xr-x 1 1001 fqq1024 39K Apr 17 2018 table_annovar.pl
-rwxr-xr-x 1 1001 fqq1024 22K Apr 17 2018 variants_reduction.pl
5. 查看GWAS注釋結果
cat annovar/ex1.hg19_gwasCatalog |less -SN
1 gwasCatalog Name=Pancreatic cancer chr1 894573 894573 G A rs13303010
2 gwasCatalog Name=Body mass index chr1 1005806 1005806 C T rs3934834
3 gwasCatalog Name=IgG glycosylation chr1 1079198 1079198 T C rs11260603
4 gwasCatalog Name=Blood protein levels chr1 1162435 1162435 C A rs3766186
5 gwasCatalog Name=Inflammatory bowel disease,Ulcerative colitis chr1 1247494 1247494 T C rs12103
或者
6. 基于基因對SNP進行注釋
#ANNOVAR壓縮包里已經自帶,太好了
perl annotate_variation.pl -downdb -buildver hg19 -webfrom annovar refGene humandb/
#基于hg19基因進行注釋,注釋很快2min之內完成
perl annotate_variation.pl -out ex1 -build hg19 snp.avinput humandb/
ls -lht annovar
-rw-r--r-- 1 root root 1.1K Jun 20 13:18 ex1.log
-rw-r--r-- 1 root root 11M Jun 20 13:18 ex1.exonic_variant_function
-rw-r--r-- 1 root root 16K Jun 20 13:18 ex1.invalid_input
-rw-r--r-- 1 root root 85M Jun 20 13:18 ex1.variant_function
7.查看基因的注釋結果
有兩種注釋結果,具體可參考http://annovar.openbioinformatics.org/en/latest/user-guide/gene/
#全部的gene variant
cat annovar/ex1.variant_function |less -SN
#外顯子上的gene variant
cat annovar/ex1.exonic_variant_function |less -SN
#查看多少種gene variant
cat ex1.exonic_variant_function |cut -f2|cut -d" " -f1|sort |uniq -c |sort -nr
49585 nonsynonymous
12001 synonymous
2743 stopgain
541 unknown
385 frameshift
46 stoploss
26 nonframeshift