This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Gatk: How To Filter Variant Based On Genotype Quality (Gq)

Hi, I would like to extract variants for on sample only if its genotype quality (GQ) is above cutoff.

I have tried this:

$pathToGATK \ 
  -T SelectVariants \ 
  -R ref \ 
  --variant inVCF \ 
  -sn mylib \ 
  -select "vc.getGenotype('mylib').GQ > 10.0" \ 
  --selectTypeToInclude SNP \ 
  --out outVCF

Unfortunately, this command outputs absolutely no variant (the VCF header is ok). No error message occured. Is some one could help me?

Fred

gatk

1 answer

As far as I understand, the GATK function getGenotype returns a java object 'Genotype':

https://github.com/broadgsa/gatk/blob/139c6b84a15d4318fd59f4c4c7922c628e4cc336/public/java/src/org/broadinstitute/sting/utils/variantcontext/Genotype.java

The class contains a function: getPhredScaledQual()

can you try

-select "vc.getGenotype('mylib').getPhredScaledQual() > 10.0" \

Thanks a lot Pierre,

It works fine now !

Reading the source code can help obvously...

FB

Pierre, I don't find the way to flag your answer.

on the left side of my answer, under the number of votes. You must be logged. :-)

Log in to answer this question.