Heads up:
We’re moving the GATK website, docs and forum to a new platform. Read the full story and breakdown of key changes on this blog.
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra

Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.

Filter raw.vcf (post GenotypeGVCF) with the PASS variants (post VQSR)

manolismanolis Member ✭✭
edited October 2018 in Ask the GATK team



after VQSR steps I went to exctract the PASS variants from the raw VCF (post GenotypeGVCF)

#Raw vcf after GenotypeGVCF: raw.vcf
grep -v "^#" raw.vcf | wc -l #994879 variants

#Output file from the VQSR steps: vqsr.vcf
grep -v "^#" vqsr.vcf | wc -l #994879 variants

#Get only the "PASS" variants from the vqsr.vcf
${GATK4} SelectVariants -R ${GENOME} -V vqsr.vcf -O passVQSR.vcf -select "vc.getFilters().size() == 0" #904406 variants

#Get genome coordinates of the PASS variants
grep -v "^#" passVQSR.vcf | awk '{print $1":"$2"-"$2}' > passVQSRcoord.list #904406 sites

#Extract from the raw vcf only the PASS variants in the VQSR step
${GATK4} SelectVariants -R ${GENOME} -V raw.vcf -O RAWpassVQSR.vcf -L passVQSRcoord.list #904504 variants

As you can see the number of the PASS variants after VQSR is 904406, while the number of the raw variants after filtering with the coordinates of the PASS VQSR variants is higher, 904504... they have to be the same, no?

Any advice is welcome!


Issue · Github
by shlee

Issue Number
Last Updated
Closed By

Best Answers


Sign In or Register to comment.