Genome Analysis Toolkit

Variant Discovery in High-Throughput Sequencing Data

GATK process banner

Need Help?

Search our documentation

Community Forum

Hi, How can we help?

Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools with a primary focus on variant discovery and genotyping. Its powerful processing engine and high-performance computing features make it capable of taking on projects of any size. Learn more

JEXL filtering expressions Follow

4 comments

  • Avatar
    Yangyxt
    gatk SelectVariants \
        -R reference.fasta \
        -V variants.vcf \
        -select "isHet == 1" \
    -O output.vcf

    The command above failed and returned an empty vcf file. 

    Here is the screenshot of input vcf file

    0
    Comment actions Permalink
  • Avatar
    Yangyxt

    I also tried :

    gatk SelectVariants \
        -R reference.fasta \
        -V variants.vcf \
        -select "vc.getGenotype('<sampleID>').isHet()" \
    -O output.vcf

    Which failed either. 

    BTW, I'm trying on GATK 4.1.8.1

    0
    Comment actions Permalink
  • Avatar
    ProxyRaven

    Hi, I could not make it work with SelectVariants using JEXL expression. However I managed to filter my VCF files for a specified VAF (AD of the altered allele / DP) using VariantFiltration as shown below with GATK 4.1.9

    --genotype-filter-expression 'vc.getGenotype("samplename").getAD().1*1.0 / (vc.getGenotype("samplename").getDP()*1.0) > 0.40' \ --genotype-filter-name "VAF04" \

    It writes the filter name within the genotype infos and I used then:

    gatk SelectVariants \
    -V filtered.vcf \
    --set-filtered-gt-to-nocall \
    -O filtered_NoCall.vcf
    0
    Comment actions Permalink
  • Avatar
    Ruqian Lyu

    I believe I was having the same issue with Yangyxt, but I figured it out by changing the expression from 

    --genotype-filter-expression "isHet==1"
     
    to 
     
    --genotype-filter-expression isHet==1 
     
     
    So removing the double quotes when using `isHet`.
     
    Hope this helps.
     
    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk