I'm working with gvcf files, containing also non-variant positions. I have noticed some insertions that I'm not able to correctly interpret or handle. An example (selected samples from a huge vcf):
NC_013991.2 1403 . G GAA 176,32 . AC=4;AF=0.014;AN=286;DP=1294;ExcessHet=0.0001;FS=0;InbreedingCoeff=0.5011;MLEAC=3;MLEAF=0.01;MQ=28.09;QD=28.2;SOR=3.912 GT:AD:DP:GQ:PGT:PID:PL:PS 1|1:0,2:2:6:1|1:1403_G_GAA:90,6,0:1403 0/0:2,0:2:6:.:.:0,6,88:. ./.:0,0:1:.:.:.:0,0,0:. ./.:0,0:0:.:.:.:0,0,0:. ./.:1,0:1:.:.:.:0,0,0:. 0/0:2,0:2:3:.:.:0,3,45:. ./.:1,0:1:.:.:.:0,0,0:. ./.:1,0:1:.:.:.:0,0,0:. 1/1:0,3:3:9:.:.:123,9,0:. 0/0:1,0:1:3:.:.:0,3,16:. 0/0:1,0:1:3:.:.:0,3,45:. 0/0:2,0:2:6:.:.:0,6,90:. 0/0:9,0:9:21:.:.:0,21,315:.
NC_013991.2 1404 . A . . . DP=1286 GT:AD:DP:RGQ 0/0:2:2:6 0/0:2:2:6 0/0:2:2:6 ./.:0:0:0 0/0:1:1:3 0/0:2:2:6 0/0:1:1:3 0/0:1:1:3 0/0:3:3:9 0/0:1:1:3 0/0:1:1:3 0/0:2:2:6 0/0:9:9:21
NC_013991.2 1405 . A . . . DP=1282 GT:AD:DP:RGQ 0/0:2:2:6 0/0:2:2:6 0/0:2:2:6 ./.:0:0:0 0/0:1:1:3 0/0:2:2:6 0/0:1:1:3 0/0:1:1:3 0/0:3:3:9 0/0:1:1:3 0/0:1:1:3 0/0:2:2:6 0/0:9:9:21
Here, the reference sequence from position 1403 to 1405 is "GAA". At site 1403, an alternative allele "GAA" is indicated, which I would interpret as an insertion of "AA". Two individuals thus would have genotype "GAAAA" here while the rest has "GAA".
I've seen multiple cases like this, here with longer alternative allele (again, selected samples, not necessarily the same as before):
NC_013991.2 23 . T TAATACTTATGTGTTG 66,98 . AC=2;AF=0.009346;AN=214;DP=314;ExcessHet=0.0105;FS=0;InbreedingCoeff=0.3797;MLEAC=3;MLEAF=0.014;MQ=51.77;QD=33.49;SOR=2.303 GT:AD:DP:GQ:PL 1/1:0,2:2:6:85,6,0 0/0:3,0:3:9:0,9,135 0/0:3,0:3:9:0,9,95 0/0:1,0:1:3:0,3,45 ./.:1,1:2:.:0,0,0 0/0:3,1:4:0:0,0,102
NC_013991.2 24 . A . . . DP=322 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:2:2:6 0/0:4:4:12
NC_013991.2 25 . A . . . DP=339 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:3:3:9 0/0:4:4:12
NC_013991.2 26 . T . . . DP=353 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:3:3:9 ./.:4:5:0
NC_013991.2 27 . A . . . DP=361 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:3:3:9 0/0:5:5:15
NC_013991.2 28 . C . . . DP=368 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:3:3:9 0/0:5:5:15
NC_013991.2 29 . T . . . DP=386 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:3:3:9 ./.:4:5:0
NC_013991.2 30 . T . . . DP=388 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:3:3:9 0/0:5:5:12
NC_013991.2 31 . A . . . DP=398 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:3:3:9 0/0:5:5:12
NC_013991.2 32 . T . . . DP=405 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:3:3:9 0/0:5:5:12
NC_013991.2 33 . G . . . DP=419 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:3:3:9 ./.:4:5:0
NC_013991.2 34 . T . . . DP=427 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:3:3:9 0/0:5:5:12
NC_013991.2 35 . G . 0,09 LowQual BaseQRankSum=-1;DP=433;ExcessHet=3;MLEAC=.;MLEAF=.;MQ=51.42;MQRankSum=1;ReadPosRankSum=0 GT:DP:RGQ 0/0:3:9 0/0:3:9 0/0:3:9 0/0:1:3 0/0:3:9 0/0:5:0
NC_013991.2 36 . T . . . DP=441 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:1:1:3 0/0:3:3:9 0/0:5:5:12
NC_013991.2 37 . T . . . DP=447 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:2:2:6 0/0:3:3:9 0/0:5:5:12
NC_013991.2 38 . G . . . DP=449 GT:AD:DP:RGQ 0/0:3:3:9 0/0:3:3:9 0/0:3:3:9 0/0:2:2:6 0/0:3:3:9 ./.:4:5:0
The alternative allele "TAATACTTATGTGTTG" is exactly the reference. Of course, the sample in question is homozygous. It seems to me these are "false" insertions: they look like insertions, but aren't. I can write a simple awk script trimming the the alternative allele, but there are cases where there are real insertions, and I don't know how to distinguish those.
I've tried the solution mentioned in this answer (double pass through bcftools norm) but it doesn't resolve these issues.
I could spend a few days coding a C++ program to do this, but surely someone with better understanding of vcf, C++, etc, has already done this?
Here's a case I really don't know how to interpret:
NC_013991.2 3321 . A ATTTCATT 638,04 . AC=14;AF=0.044;AN=320;DP=1873;ExcessHet=0;FS=0;InbreedingCoeff=0.5521;MLEAC=10;MLEAF=0.031;MQ=29.5;QD=34.42;SOR=1.739 GT:AD:DP:GQ:PGT:PID:PL:PS 1|1:0,2:2:6:1|1:3321_A_ATTTCATT:90,6,0:3321 1|1:0,4:4:12:1|1:3321_A_ATTTCATT:180,12,0:3321 1|1:0,2:2:6:1|1:3321_A_ATTTCATT:90,6,0:3321 0/0:2,0:2:3:.:.:0,3,45:. 0/0:1,0:1:3:.:.:0,3,45:. 0/0:1,0:1:3:.:.:0,3,45:. 0/0:1,0:1:3:.:.:0,3,16:. 0/0:1,0:1:3:.:.:0,3,25:. 0/0:8,0:8:21:.:.:0,21,315:. 0/0:33,0:33:96:.:.:0,96,1440:. 0/0:15,0:15:39:.:.:0,39,585:.
NC_013991.2 3322 . T . . . DP=1870 GT:AD:DP:RGQ 0/0:2:2:6 0/0:4:4:12 0/0:2:2:6 0/0:2:2:3 0/0:1:1:3 0/0:1:1:3 0/0:1:1:3 0/0:1:1:3 0/0:8:8:21 0/0:33:33:96 0/0:14:14:36
NC_013991.2 3323 . T . . . DP=1859 GT:AD:DP:RGQ 0/0:2:2:6 0/0:4:4:12 0/0:2:2:6 ./.:1:2:0 0/0:1:1:3 0/0:1:1:3 0/0:1:1:3 0/0:1:1:3 0/0:8:8:21 0/0:34:34:99 0/0:14:14:36
NC_013991.2 3324 . T . . . DP=1849 GT:AD:DP:RGQ 0/0:2:2:6 0/0:4:4:12 0/0:2:2:6 0/0:1:1:3 0/0:1:1:3 0/0:1:1:3 0/0:1:1:3 0/0:1:1:3 0/0:8:8:21 0/0:34:34:99 0/0:14:14:33
NC_013991.2 3325 . TGG T 639,64 . AC=14;AF=0.044;AN=318;DP=1843;ExcessHet=0;FS=0;InbreedingCoeff=0.5416;MLEAC=11;MLEAF=0.035;MQ=29.53;QD=28.53;SOR=1.739 GT:AD:DP:GQ:PGT:PID:PL:PS 1|1:0,2:2:6:1|1:3321_A_ATTTCATT:90,6,0:3321 1|1:0,4:4:12:1|1:3321_A_ATTTCATT:180,12,0:3321 1|1:0,2:2:6:1|1:3321_A_ATTTCATT:90,6,0:3321 0/0:1,0:1:3:.:.:0,3,45:. 0/0:1,0:1:3:.:.:0,3,45:. 0/0:1,0:1:3:.:.:0,3,45:. 0/0:1,0:1:3:.:.:0,3,45:. 0/0:1,0:1:3:.:.:0,3,25:. 0/0:8,0:8:21:.:.:0,21,315:. 0/0:34,0:34:99:.:.:0,99,1485:. 0/0:14,0:14:33:.:.:0,33,495:.
NC_013991.2 3326 . G T 1294,06 . AC=15;AF=0.055;AN=274;BaseQRankSum=0;DP=1833;ExcessHet=0;FS=2.451;InbreedingCoeff=0.5364;MLEAC=17;MLEAF=0.062;MQ=56.66;MQRankSum=0;QD=16.38;ReadPosRankSum=0;SOR=0.828 GT:AD:DP:GQ:PGT:PID:PL:PS ./.:0,2:2:.:.:.:0,0,0:. ./.:0,4:4:.:.:.:0,0,0:. ./.:0,2:2:.:.:.:0,0,0:. ./.:0,1:1:.:.:.:0,0,0:. ./.:0,1:1:.:.:.:0,0,0:. ./.:0,1:1:.:.:.:0,0,0:. ./.:0,1:1:.:.:.:0,0,0:. 1|1:0,1:1:3:1|1:3309_G_A:45,3,0:3309 1/1:0,4:4:12:.:.:145,12,0:. 0/0:34,0:34:99:.:.:0,99,1485:. 0/0:14,0:14:33:.:.:0,33,495:.
NC_013991.2 3327 . G . 0,02 LowQual DP=1832;ExcessHet=3;MLEAC=.;MLEAF=.;MQ=29 GT:DP:RGQ 0/0:2:0 0/0:4:0 0/0:2:0 0/0:1:0 0/0:1:0 0/0:1:0 0/0:1:0 0/0:1:3 0/0:8:18 0/0:34:99 0/0:14:33
NC_013991.2 3328 . G A 650,66 . AC=15;AF=0.048;AN=312;BaseQRankSum=0;DP=1826;ExcessHet=0;FS=3.31;InbreedingCoeff=0.5371;MLEAC=12;MLEAF=0.038;MQ=34.34;MQRankSum=0;QD=27.23;ReadPosRankSum=0;SOR=0.324 GT:AD:DP:GQ:PGT:PID:PL:PS 1|1:0,2:2:6:1|1:3321_A_ATTTCATT:90,6,0:3321 1|1:0,4:4:12:1|1:3321_A_ATTTCATT:180,12,0:3321 1|1:0,2:2:6:1|1:3321_A_ATTTCATT:90,6,0:3321 ./.:0,1:1:.:.:.:0,0,0:. ./.:0,1:1:.:.:.:0,0,0:. ./.:0,1:1:.:.:.:0,0,0:. 0/0:1,0:1:3:.:.:0,3,45:. 0/0:1,0:1:3:.:.:0,3,25:. 0/0:8,0:8:18:.:.:0,18,270:. 0/0:34,0:34:99:.:.:0,99,1485:. 0/0:14,0:14:33:.:.:0,33,495:.
NC_013991.2 3329 . G . 18,49 LowQual BaseQRankSum=-1;DP=1818;ExcessHet=3;MLEAC=.;MLEAF=.;MQ=57.63;MQRankSum=0;ReadPosRankSum=1 GT:DP:RGQ 0/0:2:6 0/0:4:12 0/0:2:6 0/0:1:3 0/0:1:3 0/0:1:3 0/0:1:3 0/0:1:3 0/0:7:18 0/0:35:99 0/0:13:33
It seems like only the "CATT" part of the alternative allele is really inserted...
The mapping was done either with bwa aln or bwa mem, and we've observed this behaviour both when using GATK4 and bcftools for genotyping.