This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filtering VCF file by INFO flag

Hi I'm new to bioinformatics and I get an empty file everytime I am trying to filter variants with HapMap3 "HMR". In my VCF file this information is contained in INFO column like this:

INFO=<ID=HM3,Number=0,Type=Flag,Description="HapMap3 membership"

and header

#CHROM  POS ID  REF ALT QUAL    FILTER  INFO
1   1110294 rs1320571   G   A   .   PASS    AA=A;AC=67;AN=166;DP=5401;HM2;HM3

According to vcftools documentation there is option to filter sites with specific INFO flag (--keep-INFO). I've tried to use this:

vcftools --vcf file.vcf --out output --keep-INFO ID=HM3,Number=0,Type=Flag,Description="HapMap3 membership"

and the warning msg

   VCFtools - 0.1.16
(C) Adam Auton and Anthony Marcketta 2009
Parameters as interpreted:
        --vcf pilot.vcf
        --out try
        --keep-INFO ID=HM3,Number=0,Type=Flag,Description=HapMap3 membership

Warning: Expected at least 2 parts in INFO entry: ID=AA,Number=1,Type=String,Description="Ancestral Allele, ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/pilot_data/technical/reference/ancestral_alignments/README">
After filtering, kept 0 out of 0 Individuals
Error: Using INFO flag filtering on non flag type ID=HM3,Number=0,Type=Flag,Description=HapMap3 membership will not work correctly.

how properly should I use this function?

vcftools vcf

1 answer

don't use vcftools. It's deprecated.

see Testing for absence of tag from info field with bcftools

Log in to answer this question.