This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How do I annotate 1000 genomes VCF with superpopulation minor allele frequency?

Hi everyone,

I am working with the 1000 Genomes VCFs from the New York Genome Center (30x on GRCh38). The VCF obviously provides overall and superpopulation-specific alternative allele frequency. A small proportion of alternative allele frequencies are not the minor allele with values such as 0.8/0.9.

For example when I print %CHROM %POS %INFO/AF_EUR I can see this SNP, where the alternative allele frequency is clearly the major allele. (The VCF has already been filtered to keep just biallelic SNPs).

chr21 5245455 0.950237

I need to calculate and then filter on European superpopulation minor allele frequency. As the VCF comes, there is a key within INFO/AF_EUR. For all values in this column above 0.5 (indicating that the alternative allele is not the minor allele), I need to minus the value from 1 and create a new information field for European minor allele frequency. I have no idea how to go about manipulating this within a VCF, any tips? Thank you.

1000genomes vcf annotation

1 answer

I'm not sure I understand what you need but I would go for something like

bcftools query '%CHROM %POS %INFO/AF_EUR\n' in.vcf | awk '{printf("%s\t%s\t%f\n",$1,$2, ($3 > 0.5? 1.0 - $3 : $3 ));}'

Log in to answer this question.