I am trying to filter a VCF based on the allele frequency as given by ANNOVAR annotation, which has annotations in the info column. I am doing this because I only want the rare variants for analysis. I have been trying bcf query but it is not acting well behaved....
$ bcftools view -i 'INFO/controls_AF_popmax < 0.05' File_Name.vcf.gz | bgzip > output.vcf.gz
$ bcftools query File_Name.vcf.gz -f '%ID\t %INFO/Gene.ensGene\t %INFO/controls_AF_popmax\n' -i 'INFO/controls_AF_popmax < 0.05' > output.vcf
I get output but not wat expected in terms of the filter.
I want a vcf in the end so I can make ped, map, bed, bim, fam from it using PLINK (I know how to do that part).
UPDATE: I thoguht maybe it was because of the format of the INFO/controls_AF_popmax field in the header. I tried to change the designation to the same designation AF is but that did not work either.
UPDATE: It works for 'INFO/AF > 0.05' but not for 'INFO/controls_AF_popmax > 0.05' do not know why