This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Adding allele frequency to the genotype field of a VCF file

I'm wondering if there is an way to get the allele frequency (AF1) from the INFO field VCF file into the genotype field instead (or as well), that way when I merge these files into a multi-sample VCF I can still easily access this information.

I have managed to isolate the allele frequency values from the INFO column using a sed command based on the flanking strings:

sed -e 's/.*;AF1=\(.*\);AN.*/\1/' file.vcf > output.txt

However, I can't work out how to append this to the genotype field. ie. GT:GQ:PL:AF1

Any help would be greatly appreciated!

sequencing snp next-gen

1 answer

VCFFIXUP in vcflib should do what you want.

https://github.com/vcflib/vcflib

Log in to answer this question.