GATK是一款用于基因組數(shù)據(jù)分析的軟件,其強大的處理引擎和高性能計算功能使其能夠承擔(dān)任何規(guī)模的項目。
GATK的功能非常強大,這里不詳細(xì)介紹,大家可以根據(jù)自己的要求,從首頁進入對應(yīng)的模塊,說明書還是很詳細(xì)的。
官網(wǎng):
https://gatk.broadinstitute.org/hc/en-us
GATK 4.2.1.0 命令說明:
https://gatk.broadinstitute.org/hc/en-us/sections/4404575821339-4-2-1-0?page=10#articles
1. 下載安裝
1.1下載
下載鏈接:
https://github.com/broadinstitute/gatk/releases
1.2 安裝
解壓:
$ unzip gatk-4.2.4.1.zip
查看幫助:
$ cd /your/path/gatk-4.2.4.1
$ ./gatk --help
查看工具列表:
$ ./gatk --list
查看指定工具幫助:
$ ./gatk ToolName --help
2.獲取短變異(SNP+indel)
說明書:
https://gatk.broadinstitute.org/hc/en-us/articles/360035535932-Germline-short-variant-discovery-SNPs-Indels-
主要流程如下:
2.1 準(zhǔn)備數(shù)據(jù)
這里使用在之前已經(jīng)比對好并排序去重后的bam文件(.bam),詳情參見以下鏈接:
測序質(zhì)量分析 —— FastQC - 簡書 (jianshu.com)
gff格式與gtf格式轉(zhuǎn)換——NBISweden / AGAT - 簡書 (jianshu.com)
序列比對 —— Hisat2 - 簡書 (jianshu.com)
sam文件轉(zhuǎn)換為bam文件——SAMtools - 簡書 (jianshu.com)
SAMtools——bam文件排序 - 簡書 (jianshu.com)
SAMtools——bam文件去重 - 簡書 (jianshu.com)bam文件索引(.bai)
$ samtools index LPF1_R1_MP.sort.dup.bam
- 參考基因組(.fa)
- 參考基因組索引(.fai)
$ samtools faidx Mparg_v2.0.fa
$ less Mparg_v2.0.fa.fai
Mpar_chr1 41449654 11 100 101
Mpar_chr2 50537509 41864173 100 101
Mpar_chr3 46570116 92907069 100 101
Mpar_chr4 46692298 139942898 100 101
Mpar_chr5 50691827 187102130 100 101
Mpar_chr6 65498417 238300887 100 101
Mpar_chr7 34026340 304454300 100 101
Mpar_chr8 48943667 338820915 100 101
五列分別對應(yīng),序列名、序列長度、第一個堿基的偏移量、行的堿基數(shù)、行寬。
- 參考基因組索引(.dict)
$ gatk CreateSequenceDictionary -R Mparg_v2.0.fa -O Mparg_v2.0.dict
2.2 HaplotypeCaller
HaplotypeCaller是GATK4中的核心工具,可以利用單倍型區(qū)域的局部從頭組裝同時調(diào)用種系snv和小indel。詳細(xì)原理參見說明書。
https://gatk.broadinstitute.org/hc/en-us/articles/360050814612-HaplotypeCaller#--sample-name
$ ./gatk HaplotypeCaller --help
Required Arguments:
--input,-I <GATKPath> BAM/SAM/CRAM file containing reads This argument must be specified at least once.
Required.
--output,-O <GATKPath> File to which variants should be written Required.
--reference,-R <GATKPath> Reference sequence file Required.
示例:
$ gatk --java-options "-Xmx100g -XX:ParallelGCThreads=4" HaplotypeCaller \
-I ~/LPF1_R1_MP.sort.dup.bam \
-R ~/Mparg_v2.0.fa \
-ERC GVCF \
-O ~/vcf/LPF1_R1_MP.g.vcf.gz
報錯:A USER ERROR has occurred: Argument emit-ref-confidence has a bad value: Can only be used in single sample mode currently. Use the --sample-name argument to run on a single sample out of a multi-sample BAM file.
解決辦法:
picard——修改BAM文件的Read Group - 簡書 (jianshu.com)
更改命令:
$ samtools index LPF1_R1_MP.rg.sort.bam
$ gatk --java-options "-Xmx100g -XX:ParallelGCThreads=4" HaplotypeCaller \
-I ~/LPF1_R1_MP.rg.sort.bam \
-R ~/Mparg_v2.0.fa \
-ERC GVCF \
-O ~/LPF1_R1_MP.g.vcf.gz
gatk好像最多只支持4個線程,如果我我理解有錯誤的話,還請大佬指正。
這里注意HaplotypeCaller只能處理單樣本文件,當(dāng)有多樣本時,官方建議使用HaplotypeCaller對單bam文件分別進行變異檢測,生成GVCF文件,GVCF會記錄每一個位點到情況,包括有無突變,VCF只記錄突變位點情況,之后在下一步對GVCF文件進行合并。
VCF文件和GVCF文件的格式的詳細(xì)說明參見下鏈接:
VCF和GVCF格式說明 - 青萍,你好 - 博客園 (cnblogs.com)
3.GVCF文件合并
官方說明書:https://gatk.broadinstitute.org/hc/en-us/articles/4404604801947-CombineGVCFs
gatk --java-options "-Xmx100g -XX:ParallelGCThreads=4" CombineGVCFs \
-R ~/ref/Mparg_v2.0.fa \
-V LPF1_R1_MP.g.vcf.gz \
-V LPF1_R2_MP.g.vcf.gz \
-V LPF1_R3_MP.g.vcf.gz \
-O LPF1_MP.g.vcf.gz