This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Counting the number of major and minor alleles

In a multi-sample VCF file, How can we count the number of major and minor alleles for an SNP in all samples? Should we use the "AF" to identify major or minor alleles? Is the number of each allele given in the "AD" under the FORMAT field?

vcf allele snp

Can you post an example of the vcf file you're working on?

In a vcf file, you should have the genotype which you can use to filter/count the alleles.

This is an example of my main file (two SNP)

Ch1 625 .   A   T   11325.5 PASS    AC=41;AF=0.932;AN=44;BaseQRankSum=0.16;C
lippingRankSum=0;DP=295;ExcessHet=3.3244;FS=1.583;InbreedingCoeff=-0.0794;MLEAC=41;MLEAF=0.932;MQ=53.4;M
QRankSum=-2.655;QD=32.42;ReadPosRankSum=0.572;SOR=0.543 GT:AD:DP:GQ:PGT:PID:PL  1/1:0,6:6:18:.:.:269,18,
0   1/1:0,15:15:48:1|1:625_A_T:717,48,0 1/1:0,13:13:39:.:.:574,39,0 1/1:0,20:20:60:.:.:843,6
0,0 1/1:0,21:21:63:.:.:865,63,0 1/1:0,14:14:42:.:.:608,42,0 1/1:0,9:9:27:.:.:394,27,0   
1/1:0,17:17:51:.:.:744,51,0 1/1:0,4:4:12:.:.:177,12,0   1/1:0,13:13:39:.:.:540,39,0 1/1:0,11
:11:33:.:.:495,33,0 1/1:0,7:7:21:.:.:305,21,0   1/1:0,17:17:51:.:.:724,51,0 1/1:0,18:18:54:.
:.:771,54,0 0/1:10,10:20:99:.:.:381,0,368   0/1:10,16:26:99:.:.:586,0,344
Ch1 637 .   C   T   10016.6 PASS    AC=38;AF=0.864;AN=44;BaseQRankSum=0.145;
ClippingRankSum=0;DP=285;ExcessHet=0.8318;FS=4.721;InbreedingCoeff=0.2021;MLEAC=38;MLEAF=0.864;MQ=51.5;M
QRankSum=-1.976;QD=37.76;ReadPosRankSum=0.638;SOR=0.38  GT:AD:DP:GQ:PGT:PID:PL  1/1:0,6:6:18:.:.:263,18,
0   1/1:0,18:18:54:1|1:625_A_T:810,54,0 1/1:0,10:10:30:.:.:449,30,0 1/1:0,20:20:60:.:.:816,6
0,0 1/1:0,18:18:54:.:.:721,54,0 1/1:0,15:15:45:.:.:652,45,0 1/1:0,9:9:27:.:.:397,27,0   
1/1:0,20:20:60:.:.:857,60,0 1/1:0,4:4:12:.:.:180,12,0   1/1:0,12:12:36:.:.:528,36,0 1/1:0,9:
9:27:.:.:405,27,0   1/1:0,8:8:24:.:.:353,24,0   1/1:0,18:18:54:.:.:778,54,0 1/1:0,13:13:39:.
:.:558,39,0 0/1:9,10:19:99:.:.:381,0,328    0/1:9,15:24:99:.:.:552,0,306

0 answers

No answers yet.

Log in to answer this question.