NGS DNA-seq pipeline: GATK Best Practice Code – Part2. Bam to Vcf

지난 글에 이어서, 생성된 Bam 파일로부터 변이들을 읽어 들이고, haplotype call을 하는 두번째 파트의 code를 정리해보겠습니다. 아래 코드는 GATK 4.1.3 버젼을 기반으로 작성되었습니다. GATK 버젼에 따라서 조금씩 Tool과 명령어에 차이가 있습니다. 전반적인 흐름은 아래와 같습니다.

관련 포스팅 보기>

NGS DNA-seq pipeline: GATK Best Practice Code – Part1. Fastq to Bam

NGS 분석 파이프 라인의 이해: GATK Best Practice

[계속 Update 예정] 자주 쓰는 linux 명령어 및 프로그램 관련 자료

1.jpg

III. Germline short variant discovery : Bam to Vcf

1. HaplotypeCaller

https://software.broadinstitute.org/gatk/documentation/tooldocs/current/org_broadinstitute_hellbender_tools_walkers_haplotypecaller_HaplotypeCaller.php

해당 위치의 변이와 read 갯수등을 바탕으로 하여, haplotype을 생성해주는 과정입니다. 일반적으로 우리가 heterozygote인지 homozygote인지에 해당하는 변이의 zygosity를 이 과정에서 생성한다고 볼 수 있습니다. 앞선 과정에서 BQSR을 통해 최종적으로 생성된 Bam 파일을 이용하여, haplotype call을 진행합니다.

gatk -- java-options 'Xmx16g' 'Xms8g' HaplotypeCaller -R [hg19_reference.fa] -I [sample01.final.bam] -ERC GVCF [-L targets.interval_list] \ -O [sample01.vcf] --genotyping-mode DISCOVERY --standard-min-confidence-threshold-for-calling 30 -ploidy 2 --output-mode EMIT_VARIANTS_ONLY

-L option에는 타겟 영역에 해당하는 BED 파일을 넣어주면 해당 위치에서만 Call이 일어나게 됩니다. Whole genome이 아닌 Target panel이나 Exome panel의 경우, 타겟 유전자들로 구성된 BED 파일을 지정해줍니다.

2. GenomicsDBImport

https://github.com/GenomicsDB/GenomicsDB/wiki

이전의 GATK와 달라진 부분입니다. 예전에 여러개의 샘플로 구성된 VCF를 Genotype GVCF로 합쳤는데, 추후의 편의성 및 연산 속도를 고려하여 GenomicDB를 구축하는 과정이 추가되었습니다. 이 단계를 건너 뛰어도 좋지만, 일반적으로 이렇게 DB를 구축하고 나면 여러모로 좋다고 소개하고 있네요. 여러개의 샘플로 구성된 환자 코호트의 경우는 이렇게 DB를 구축하고 하나로 합쳐주는 과정이 있는게 좋을 것 같고, Single sample이라면 이 과정은 건너뛰어도 좋을 것 같습니다.

gatk -- java-options 'Xmx16g' 'Xms8g' GenomicsDBImport -V [vcf file_list] \ [-L targets.interval_list] --genomicsdb-workspace-path \ [/genomicDB] --merge-input-intervals true --tmp-dir=/tmp 

[vcf file_list] 부분에는 -V sample01.vcf -V sample02.vcf -V sample03.vcf 와 같이 하나의 cohort로 구성하고자 하는 여러개의 샘플을 하나로 쭉 나열해주면 됩니다.

3. GenotypeGVCFs

위에서 GenomicDB를 구축하고, 여러 개의 샘플로 구성된 VCF가 있었다면, 이들을 Cohort 단위로 묶어서 하나의 VCF로 만들어 주는 과정입니다.

gatk -- java-options 'Xmx16g' 'Xms8g' GenotypeGVCFs -R [hg19_reference.fa] -V gendb://genomicDB --tmp-dir=/tmp -O [cohort.vcf]

4. VariantRecalibrator, ApplyRecalibration

https://software.broadinstitute.org/gatk/documentation/tooldocs/current/org_broadinstitute_hellbender_tools_walkers_vqsr_VariantRecalibrator.php

https://software.broadinstitute.org/gatk/documentation/tooldocs/current/org_broadinstitute_hellbender_tools_walkers_vqsr_ApplyVQSR.php

Bam을 구성할 때, 각 염기별로 recalibration을 진행했던 것과 비슷하게 call된 변이들에서도 recalibration을 진행해서 QC를 하는 부분입니다. 머신러닝을 이용하여, 기존 DB로 부터 변이들을 학습 시키고 걸러내는 방법이라고 하는데, 이를 위해서 hapmap, omni, 100G, dbsnp database를 다운 받아야합니다. 최근에는 CNN (convolutional neural network)에 기반한 모델을 수립하여, 테스트 중이라고 하는데 아직까지는 Beta 버젼에 머물고 있어 기존 코드를 이용합니다. 추후 이 부분은 CNN 기반 Recalibration code로 바뀔 가능성이 있습니다.

gatk -- java-options 'Xmx16g' 'Xms8g' VariantRecalibrator -R [hg19_reference.fa] -V [cohort.vcf] \
--resource:hapmap,known=false,training=true,truth=trueprior=15.0 hapmap_3.3.hg19.sites.vcf.gz \
--resource:omni,known=false,training=true,truth=false,prior=12.0 1000G_omni2.5.hg19.sites.vcf.gz \
--resource:1000G,known=false,training=true,truth=false,prior=10.0 1000G_phase1.snps.high_confidence.hg19.vcf.gz \
--resource:dbsnp,known=true,training=false,truth=false,prior=2.0 Homo_sapiens_assembly19.dbsnp138.vcf.gz \
-an QD -an MQ -an MQRankSum -an ReadPosRankSum -an FS -an SOR \
-mode SNP -O [cohort.recal.vcf] --tranches-file [output.tranches] --rscript-file [output.plots.R]

gatk ApplyVQSR -R [hg19_reference.fa] -V [cohort.vcf] -O [cohort.final.vcf] \
--truth-sensitivity-filter-level 99.0 --tranches-file [output.tranches] --recal-file [cohort.recal.vcf] -mode SNP 

위의 과정을 거치면, 최종적으로 변이들이 call 되어 분석이 가능해집니다. 마지막 파트는 Annotation 과정인데, 해당 코드는 마지막 Part 3 포스팅에서 다루도록 하겠습니다.

[Reference]

GATK Best Practice for Germline short variant discovery (SNPs + Indels)

: https://software.broadinstitute.org/gatk/best-practices/workflow?id=11145

How to run VQSR from GATK

https://software.broadinstitute.org/gatk/documentation/article?id=2805

“NGS DNA-seq pipeline: GATK Best Practice Code – Part2. Bam to Vcf”의 5개의 생각

  1. 안녕하세요 -L option interval list에서 궁금한점이 있습니다. 해당 target의 interval list는 reference gene에 대한 interval list를 넣는건가요?? 아니면 sample bam file에서 interval list를 가져오는 건가요??ㅠㅠ

    좋아요

  2. 안녕하세요 블로그에서 많은 정보를 얻어가 항상 감사 드립니다.
    궁굼한점이 있습니다. 앞에과정까지는 Reference를 hg19로 사용했는데 VariantRecalibrator를 이용할때는 hg38을 사용하는 이유가 있을까요?

    좋아요

답글 남기기

아래 항목을 채우거나 오른쪽 아이콘 중 하나를 클릭하여 로그 인 하세요:

WordPress.com 로고

WordPress.com의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Twitter 사진

Twitter의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Facebook 사진

Facebook의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

%s에 연결하는 중