GATK Germline Best Practice学习

数据是sporadic的慢病case-control的组合。想用GATK germline best practice的方法进行突变的分析。这里主要参考GATK Germline best practice的教程。1 这里用的是GATK3.7的版本,目前已经出到GATK3.8。最近4.0也发布了。
部分步骤后续补完。。。


Map to Reference

bwa mem -t 8 -M -R '@RG\tID:${name}\tLB:${name}\tPL:ILLUMINA\tPM:X10\tSM:${name}' ${INDEX} ${RAW_DATA}/${name}_1.fastq ${RAW_DATA}/${name}_2.fastq > ${WORKING_DIR}/2018rerun/processed_bam/${name}.sam
$java -Xmx20g -jar $PICARD SortSam SORT_ORDER=coordinate INPUT=${WORKING_DIR}/2018rerun/processed_bam/${name}.sam OUTPUT=${WORKING_DIR}/2018rerun/processed_bam/${name}.bam

Basic Statistics

samtools flagstat ${WORKING_DIR}/2018rerun/processed_bam/${name}.bam > ${WORKING_DIR}/2018rerun/processed_bam/${name}.flagstat &
samtools stats ${WORKING_DIR}/2018rerun/processed_bam/${name}.bam > ${WORKING_DIR}/2018rerun/processed_bam/${name}.stats &

Mark Duplicates

$java -Xmx20g -jar $PICARD MarkDuplicates INPUT=${WORKING_DIR}/2018rerun/processed_bam/${name}.bam OUTPUT=${WORKING_DIR}/2018rerun/processed_bam/${name}_marked.bam METRICS_FILE=${WORKING_DIR}/2018rerun/processed_bam/${name}.metrics
samtools index ${WORKING_DIR}/2018rerun/processed_bam/${name}_marked.bam

Base Recalibration

$java -Xmx10g -jar $gatk_jar -T BaseRecalibrator -R $INDEX -I ${WORKING_DIR}/2018rerun/processed_bam/${name}_marked.bam -knownSites $DBSNP -knownSites $mills_and_1000G_gold_standard_indel -knownSites $G1000_phase1_indel -o ${WORKING_DIR}/2018rerun/processed_bam/${name}.before.table
$java -Xmx10g -jar $gatk_jar -T BaseRecalibrator -R $INDEX -I ${WORKING_DIR}/2018rerun/processed_bam/${name}_marked.bam -knownSites $DBSNP -knownSites $mills_and_1000G_gold_standard_indel -knownSites $G1000_phase1_indel -BQSR ${WORKING_DIR}/2018rerun/processed_bam/${name}.before.table -o ${WORKING_DIR}/2018rerun/processed_bam/${name}.after.table
$java -Xmx10g -jar $gatk_jar -T AnalyzeCovariates -R $INDEX -before ${WORKING_DIR}/2018rerun/processed_bam/${name}.before.table -after ${WORKING_DIR}/2018rerun/processed_bam/${name}.after.table -plots ${WORKING_DIR}/2018rerun/processed_bam/${name}.recalibration_plots.pdf
$java -Xmx10g -jar $gatk_jar -T PrintReads -R $INDEX -I ${WORKING_DIR}/2018rerun/processed_bam/${name}_marked.bam -BQSR ${WORKING_DIR}/2018rerun/processed_bam/${name}.after.table -o ${WORKING_DIR}/2018rerun/processed_bam/${name}.recalibrated.bam

Haplotypecaller

java -Xmx10g -jar GenomeAnalysisTK.jar\
 -T HaplotypeCaller \
 -R GATK_boundle/hg19/genome.fa \
  -I bam/${i}.recalibrated.bam \
  --emitRefConfidence GVCF \
  -o GVCF/${i}.raw_variants.g.vcf

Joint-Call Cohort

工具:GenotypeGVCFs
在这步,会mege所有的单样本GVCF,通过GenotypeGVCFs实现。这会生成一组joint-called SNP和indel,准备后续的筛选。这种队列的分析使得突变检测更为灵敏,即使是那些比较难检测的位点。同时也会提供基因型的矩阵,包含在所有样本里所有感兴趣的位点。
这一步跑的比较快,也可以重跑如果有新的样本进来,因此可以解决N+1问题。

/work/share/software/jre1.8.0_111/bin/java -Xmx30g -jar GenomeAnalysisTK.jar -T GenotypeGVCFs -R GATK_boundle/hg19/genome.fa --variant input.list -o GenotypeGVCF.vcf

分别提取SNV和Indel.

工具:SelectVariants

/work/share/software/jre1.8.0_111/bin/java -Xmx30g -jar GenomeAnalysisTK.jar -T SelectVariants -R GATK_boundle/hg19/genome.fa --variant GenotypeGVCF.vcf -o GenotypeGVCF.snp.vcf --selectTypeToInclude SNP
/work/share/software/jre1.8.0_111/bin/java -Xmx30g -jar GenomeAnalysisTK.jar -T SelectVariants -R GATK_boundle/hg19/genome.fa --variant GenotypeGVCF.vcf -o GenotypeGVCF.indel.vcf --selectTypeToInclude INDEL

Filter Variants by Variant (Quality Score) Recalibration 2

工具:VariantRecalibrator 3, ApplyRecalibration 4
这一步可以尽量不失去真的variants,同时也意味着要对raw callset进行筛选。Variant quality score recalibration(VQSR)主要用了机器学习方法,根据突变的annotation profile去找真的突变,并赋一个VQSLOD值给每个突变(比QUAL准)。方法共有2步,第一步基于training variants建立一个模型,然后基于模型给每个variant call一个well-calibrated probability。第二步基于这个variant quality score去筛raw call set,得到a subset of calls with desired level of quality, fine-tuned to balance specificity and sensitivity.
Resource Datasets Used in two steps of VQSR:
基于human genomes,依照GATK Best Pracitce。人类的training, truth和known resource datasets都在GATK resource bundle可以下到。对于非人类,需要自己去生成包括至少truth和training resource datasets(方法在2)。
SNP的resources:
-true sites traning resource: HapMap
-True sites training resource: Omni
-Non-true sites training resource: 1000G
-Known sites resource, not used in training: dbSNP
Indel的resources:
-True sites training resource: Mills
-Known sites resource, not used in training: dbSNP

SNP
step1 VariantRecalibrator
java -Xmx30g -jar GenomeAnalysisTK.jar \
-T VariantRecalibrator \
-R GATK_boundle/hg19/genome.fa \
-input ../GenotypeGVCF.snp.vcf \
-resource:hapmap,known=false,training=true,truth=true,prior=15.0 ~/tools/GATK/GATK_bundle/hapmap_3.3_hg19_pop_stratified_af.vcf \
-resource:omni,known=false,training=true,truth=false,prior=12.0 ~/tools/GATK/GATK_bundle/1000G_omni2.5.hg19.sites.vcf \
-resource:1000G,known=false,training=true,truth=false,prior=10.0 ~/tools/GATK/GATK_bundle/1000G_phase1.snps.high_confidence.hg19.sites.vcf \
-resource:dbsnp,known=true,training=false,truth=false,prior=2.0 ~/tools/GATK/GATK_bundle/dbsnp_138.hg19.vcf \
-an QD -an MQ -an MQRankSum -an ReadPosRankSum -an FS -an SOR -an InbreedingCoeff \
-mode SNP \
-recalFile output.recal \
-tranchesFile output.tranches \
-rscriptFile output.plots.R
step2 ApplyRecalibration
java -Xmx30g -jar GenomeAnalysisTK.jar \
-T ApplyRecalibration \
-R GATK_boundle/hg19/genome.fa \
-input ../GenotypeGVCF.snp.vcf \
-tranchesFile output.tranches \
-recalFile output.recal \
-o snp.filtered.vcf \
--ts_filter_level 99.5 \
-mode SNP
Indel
step1 VariantRecalibrator
java -Xmx30g -jar GenomeAnalysisTK.jar \
-T VariantRecalibrator \
-R GATK_boundle/hg19/genome.fa \
-input ../GenotypeGVCF.indel.vcf \
-resource:mills,known=false,training=true,truth=true,prior=12.0 ~/tools/GATK/GATK_bundle/Mills_and_1000G_gold_standard.indels.hg19.sites.vcf \
-resource:dbsnp,known=true,training=false,truth=false,prior=2.0 ~/tools/GATK/GATK_bundle/dbsnp_138.hg19.vcf \
-an QD -an DP -an FS -an SOR -an ReadPosRankSum -an MQRankSum -an InbreedingCoeff \
-mode INDEL \
-recalFile output.recal \
-tranchesFile output.tranches \
-rscriptFile output.plots.R
step2 ApplyRecalibration
java -Xmx30g -jar GenomeAnalysisTK.jar \
-T ApplyRecalibration \
-R GATK_boundle/hg19/genome.fa \
-input ../GenotypeGVCF.indel.vcf \
-tranchesFile output.tranches \
-recalFile output.recal \
-o indel.filtered.vcf \
--ts_filter_level 99.0 \
-mode INDEL

过滤recalibrated VCF

5, 6

你可能感兴趣的:(WES,whole-exome,sequencing)