Variant calling
Gabrièle Adam - INRAE
École de bioinformatique AVIESAN-IFB-INSERM 2023
Workflow
2
Fastq Quality Control
-- FastQC --
Mapping
-- BWA --
Reads (Fastq)
Reference genome (Fasta)
Processing Post Alignement
-- GATK/samtools --
Small variant calling
Annotation
Variant analysis
Shell
R/Rstudio
Détection automatisée des variants (SNVs, Indels de petite taille) à partir d’un fichier contenant des données de séquençage alignées (BAM)
.fastq
.bam /.sam
.bcf /.vcf
3
Qu’appelle t-on “Variant Calling”
.bam /.sam
.vcf
4
https://jchoigt.wordpress.com/2012/07/18/working-with-23andme-exome-data-my-cf-allele-and-the-need-for-verification/
Qu’appelle t-on “Variant Calling”
→ Aucun outil n’est parfait : la qualité du calling dépend de l’ensemble du pipeline, des données analysées, et des paramètres utilisés pour filtrer les résultats
5
Variant callers
6
Hwang et al., “Systematic comparison of variant calling pipelines using gold standard personal exome variants” Scientific Reports, vol. 5, pp. 17875, 2015.
Concordance entre variant callers
/!\ Existence de variants qui sont spécifiques aux différents callers /!\
7
Difficultés - Limitations
8
En conclusion
9
Partie TP
10
$ gatk HaplotypeCaller # affiche l’aide d’HaplotypeCaller
Required Arguments:
--input,-I:String BAM/SAM/CRAM file containing reads. This argument must be specified at least once.
--output,-O:String File to which variants should be written Required.
--reference,-R:String Reference sequence file Required.
--min-base-quality-score,-mbq:Byte
Minimum base quality required to consider a base for calling Default value: 10.
...
--emit-ref-confidence,-ERC:ReferenceConfidenceMode
Mode for emitting reference confidence scores …
Default value: NONE. Possible values: {NONE, BP_RESOLUTION, GVCF}
GATK HaplotypeCaller
$ module load gatk4/4.2.3.0 # si vous ne l’avez pas déjà fait
11
1/GATK HaplotypeCaller avec sortie VCF
Single-sample variant calling
# Création d’un répertoire pour l’appel des variants
$ mkdir -p ~/tp_variant/GATK/vcf
$ cd ~/tp_variant/GATK/
tp_variant
genome
alignment_bwa
additionnal_data
GATK
logs
vcf
12
# Création d’un répertoire pour l’appel des variants
$ mkdir -p ~/tp_variant/GATK/vcf
$ cd ~/tp_variant/GATK/
# Détection de variant GATK avec sortie VCF
module load samtools/1.13
samtools index ~/tp_variant/SRR1262731_extract.sort.md.filt.bam
$ gatk HaplotypeCaller --java-options '-Xmx8G' \
--input ~/tp_variant/SRR1262731_extract.sort.md.filt.bam \
--reference ~/tp_variant/genome/Bos_taurus.UMD3.1.dna.toplevel.6.fa \
--min-base-quality-score 18 \
--minimum-mapping-quality 30 \
--emit-ref-confidence "NONE" \
--output vcf/SRR1262731_extract_GATK.vcf \
--intervals ~/tp_variant/additionnal_data/QTL_BT6.bed
$ ls -ltrh vcf/
$ less -S vcf/SRR1262731_extract_GATK.vcf
1/GATK HaplotypeCaller avec sortie VCF
Single-sample variant calling
13
##fileformat=VCFv4.2
##FILTER=<ID=LowQual,Description="Low quality">
##FORMAT=<ID=AD,Number=R,Type=Integer,Description="Allelic depths for the ref and alt alleles in the order listed">
##FORMAT=<ID=DP,Number=1,Type=Integer,Description="Approximate read depth (reads with MQ=255 or with bad mates are filtered)">
##FORMAT=<ID=GQ,Number=1,Type=Integer,Description="Genotype Quality">
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
##FORMAT=<ID=PL,Number=G,Type=Integer,Description="Normalized, Phred-scaled likelihoods for genotypes as defined in the VCF specification">
##GATKCommandLine=<ID=HaplotypeCaller,CommandLine="HaplotypeCaller --min-base-quality-score 18 --emit-ref-confidence NONE --output vcf/SRR126...
##INFO=<ID=AF,Number=A,Type=Float,Description="Allele Frequency, for each ALT allele, in the same order as listed">
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles in called genotypes">
##INFO=<ID=BaseQRankSum,Number=1,Type=Float,Description="Z-score from Wilcoxon rank sum test of Alt Vs. Ref base qualities">
##INFO=<ID=DP,Number=1,Type=Integer,Description="Approximate read depth; some reads may have been filtered">
##INFO=<ID=ExcessHet,Number=1,Type=Float,Description="Phred-scaled p-value for exact test of excess heterozygosity">
##INFO=<ID=FS,Number=1,Type=Float,Description="Phred-scaled p-value using Fisher's exact test to detect strand bias">
##INFO=<ID=InbreedingCoeff,Number=1,Type=Float,Description="Inbreeding coefficient as estimated from the genotype likelihoods per-sample when compared against the Hardy-Weinberg expectation">
##INFO=<ID=MLEAC,Number=A,Type=Integer,Description="Maximum likelihood expectation (MLE) for the allele counts (not necessarily the same as the AC), for each ALT allele, in the same order as listed">
##INFO=<ID=MLEAF,Number=A,Type=Float,Description="Maximum likelihood expectation (MLE) for the allele frequency (not necessarily the same as the AF), for each ALT allele, in the same order as listed">
##INFO=<ID=MQ,Number=1,Type=Float,Description="RMS Mapping Quality">
##INFO=<ID=MQRankSum,Number=1,Type=Float,Description="Z-score From Wilcoxon rank sum test of Alt vs. Ref read mapping qualities">
##INFO=<ID=QD,Number=1,Type=Float,Description="Variant Confidence/Quality by Depth">
##INFO=<ID=ReadPosRankSum,Number=1,Type=Float,Description="Z-score from Wilcoxon rank sum test of Alt vs. Ref read position bias">
##INFO=<ID=SOR,Number=1,Type=Float,Description="Symmetric Odds Ratio of 2x2 contingency table to detect strand bias">
##contig=<ID=6,length=119458736>
##source=HaplotypeCaller
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SRR1262731
6 37913396 . T A 67.64 . AC=1;AF=0.500;... GT:AD:DP:GQ:PL 0/1:3,2:5:75:75,0,105
6 37916445 . GT G 58.60 . AC=1;AF=0.500;... GT:AD:DP:GQ:PL 0/1:1,2:3:28:66,0,28
6 37921683 . C CA 55.60 . AC=1;AF=0.500;... GT:AD:DP:GQ:PL 0/1:7,2:9:63:63,0,279
VCF header
Body
Deletion
SNP
Insertion
VCF (variant call format)
CombineGVCFs
GenotypeGVCFs
HaplotypeCaller
14
Combiner les sorties gvcf en 1 sortie gvcf
Variant-calling avec sortie gvcf / par échantillon
Identifier les variants simultanément sur tous les échantillons
1/GATK HaplotypeCaller en mode GVCF
Multi-sample variant calling
GATK
15
# Création d’un répertoire pour l’appel des variants
$ mkdir -p ~/tp_variant/GATK/gvcf
1/GATK HaplotypeCaller en mode GVCF
Multi-sample variant calling
tp_variant
genome
alignment_bwa
additionnal_data
GATK
logs
vcf
gvcf
CombineGVCFs
GenotypeGVCFs
HaplotypeCaller
16
16
# 1.Détection de variants GATK avec sortie gVCF
$ mkdir -p ~/tp_variant/GATK/gvcf
$ gatk HaplotypeCaller --java-options '-Xmx8G' \
--input ~/tp_variant/SRR1262731_extract.sort.md.filt.bam \
--reference ~/tp_variant/genome/Bos_taurus.UMD3.1.dna.toplevel.6.fa \
--min-base-quality-score 18 \
--minimum-mapping-quality 30 \
--emit-ref-confidence "GVCF" \
--output gvcf/SRR1262731_extract_GATK.g.vcf \
--intervals ~/tp_variant/additionnal_data/QTL_BT6.bed
$ ls -ltrh gvcf/
$ less -S gvcf/SRR1262731_extract_GATK.g.vcf
1/GATK HaplotypeCaller en mode GVCF
Multi-sample variant calling
17
Sorties VCF vs. gVCF (option -ERC)
18
Sorties VCF vs. gVCF (option -ERC)
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SRR1262731
6 37913111 . G <NON_REF> . . END=37913131 GT:DP:GQ:MIN_DP:PL 0/0:3:9:3:0,9,114
6 37913132 . A <NON_REF> . . END=37913133 GT:DP:GQ:MIN_DP:PL 0/0:4:12:4:0,12,170
...
6 37913394 . T <NON_REF> . . END=37913395 GT:DP:GQ:MIN_DP:PL 0/0:5:12:5:0,12,180
6 37913396 . T A,<NON_REF> 67.64 . BaseQRankSum... GT:AD:DP:GQ:PL:SB 0/1:3,2,0:5:75:75,..
6 37913397 . A <NON_REF> . . END=37913400 GT:DP:GQ:MIN_DP:PL 0/0:5:12:5:0,12,180
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SRR1262731
6 37913396 . T A 67.64 . AC=1;AF=0.500;... GT:AD:DP:GQ:PL 0/1:3,2:5:75:75,0,105
6 37916445 . GT G 58.60 . AC=1;AF=0.500;... GT:AD:DP:GQ:PL 0/1:1,2:3:28:66,0,28
6 37921683 . C CA 55.60 . AC=1;AF=0.500;... GT:AD:DP:GQ:PL 0/1:7,2:9:63:63,0,279
VCF
gVCF
CombineGVCFs
GenotypeGVCFs
HaplotypeCaller
19
# 2.Fusion des fichiers gVCFs en un seul gVCF
$ gatk CombineGVCFs --java-options '-Xmx8G' \
--variant gvcf/SRR1262731_extract_GATK.g.vcf \
--variant ~/tp_variant/additionnal_data/SRR1205992_extract_GATK.g.vcf \
--variant ~/tp_variant/additionnal_data/SRR1205973_extract_GATK.g.vcf \
--reference ~/tp_variant/genome/Bos_taurus.UMD3.1.dna.toplevel.6.fa \
--intervals ~/tp_variant/additionnal_data/QTL_BT6.bed \
--output gvcf/pool_GATK.g.vcf
1/GATK HaplotypeCaller en mode GVCF
Multi-sample variant calling
CombineGVCFs
GenotypeGVCFs
HaplotypeCaller
20
20
# 3.Détection de variants simultanée sur les 3 échantillons du gVCF
$ gatk GenotypeGVCFs --java-options '-Xmx8G' \
--variant gvcf/pool_GATK.g.vcf \
--reference ~/tp_variant/genome/Bos_taurus.UMD3.1.dna.toplevel.6.fa \
--output vcf/pool_GATK.vcf
$ less -S vcf/pool_GATK.vcf
1/GATK HaplotypeCaller en mode GVCF
Multi-sample variant calling
21
https://petridishtalk.com/2013/02/01/variant-discovery-annotation-filtering-with-samtools-the-gatk/
VCF Multi-échantillons
Workflow
22
Fastq Quality Control
-- FastQC --
Mapping
-- Bowtie --
Reads (Fastq)
Reference genome (Fasta)
Processing Post Alignement
-- GATK/samtools --
Small variant calling
Annotation
Variant analysis
Shell
R/Rstudio
Annotation des variants
→ Est-ce que mes variants sont connus ?
→ Où se positionnent mes variants ?
→ Quel est l’effet d’une mutation sur le CDS qui le contient ?
23
Annotation des variants
→ Mon variant se trouve-t-il dans un intron, un exon ?
→ Informations sur la région ? Exemple : CDS codant pour une protéine
→ Dans le cas d’un CDS, protéine produite tronquée, allongée, décalée… ou silencieuse (redondance du code génétique)
24
Annotation des variants
→ SnpEff
→ VEP
→ Annovar
→ SIFT, POLYPHEN2, CADD…
→ dbNSFP,
25
SnpEff
Création de la base de données SnpEff
26
# Création de la base de données SnpEff
$ module load snpeff/4.3.1t
$ echo BosTaurus.genome > snpeff.config # <genome_name>.genome
$ mkdir -p BosTaurus
$
$ cp ~/tp_variant/genome/Bos_taurus.UMD3.1.dna.toplevel.6.fa BosTaurus/sequences.fa
$ cp ~/tp_variant/genome/Bos_taurus.UMD3.1.93.chromosome.6.gff3 BosTaurus/genes.gff
$
$ echo -e "BosTaurus\nSnpEff4.3t" > BosTaurus.db
$
$ snpEff build -c snpeff.config -gff3 -v BosTaurus -dataDir .
SnpEff
Annotation des variants
27
# Annotation avec notre base de données
$ snpEff eff -c snpeff.config -dataDir . BosTaurus -s snpeff_res.html \
~/tp_variant/GATK/vcf/pool_GATK.vcf > GATK.annot.vcf
$ less -S GATK.annot.vcf