This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Udpate the FILTER field in VCF to PASS if the variants is represented as true in another set of VCF?

I have a VCF files called from several samples (Say Vcf01), and also have a VCF files with sites that are true variants (Say Vcf02). So, what I want to do is update the FILTER field for the sites in Vcf01 to PASS if the variants is represented in Vcf02.

I have checked several VCF tools and also GATK but this functionality is lacking.

Any ideas?

Thanks,

vcf pass snp

1 answer

gatk variant annotator https://software.broadinstitute.org/gatk/gatkdocs/3.8-0/org_broadinstitute_gatk_tools_walkers_annotator_VariantAnnotator.php

and peek any INFO from the second vcf:

   --resource:foo resource.vcf \
   -E foo.AF \

followed by

gatk variant filtration: https://software.broadinstitute.org/gatk/documentation/tooldocs/current/org_broadinstitute_gatk_tools_walkers_filters_VariantFiltration.php

where you test for the presence of foo.AF.

On my side, I've written http://lindenb.github.io/jvarkit/VcfIn.html

with options:

-A, --allalt
  ALL user ALT must be found in VCF-database ALT
  Default: false
-fi, --filterin
  Do not discard variant but add this FILTER if the variant is found in 
  the database
  Default: <empty string>
-fo, --filterout
  Do not discard variant but add this FILTER if the variant is NOT found 
  in the database
  Default: <empty string>

Log in to answer this question.