The current GATK version is 3.6-0
Examples: Monday, today, last week, Mar 26, 3/26/04

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Powered by Vanilla. Made with Bootstrap.
Last chance to register for the GATK workshop next week in Basel, Switzerland! http://www.sib.swiss/training/upcoming-training-events/training/gatk-workshop-lecture

JEXL and SelectVariants

golharamgolharam Posts: 28Member ✭✭
edited March 2013 in Ask the GATK team

I'm trying to use JEXL to filter variants but something isn't working and I can't figure it out. I'm hoping someone can point me in the right direction. My VCF file contains an INFO field 1000g2012Apr_ALL. Some of the variants in my VCF have an entry for this field, some don't. I want to filter my VCF file for entries that are below a certain value or are NULL (empty).

Here's what my command looks like:

java -Xmx4G -jar GenomeAnalysisTK.jar
-T SelectVariants
-R hg19.fa
-V my.vcf
-o my.1kgfiltered.vcf
-select 'vc.getAttribute("1000g2012Apr_ALL") < 0.01'
-select '!vc.hasAttribute("1000g2012Apr_ALL")'

The problem is the 2nd select statement. I can't seem to get a JEXL select statement to give me the entries where 1000g2012Apr_ALL are empty. How do I accomplish this?

Best Answer

Answers

  • golharamgolharam Posts: 28Member ✭✭

    -select '(!vc.hasAttribute("1000g2012Apr_ALL")) || vc.getAttribute("1000g2012Apr_ALL") < 0.01'

  • Geraldine_VdAuweraGeraldine_VdAuwera Posts: 10,468Administrator, Dev admin

    Not sure about the proper syntax, but have you tried something like -select '!(vc.hasAttribute("1000g2012Apr_ALL"))' or -select '! vc.hasAttribute("1000g2012Apr_ALL")'?

    Geraldine Van der Auwera, PhD

  • Geraldine_VdAuweraGeraldine_VdAuwera Posts: 10,468Administrator, Dev admin

    Oh, well there you go, ignore my feeble attempt! (I hate JEXL)

    Geraldine Van der Auwera, PhD

  • golharamgolharam Posts: 28Member ✭✭

    Its odd that I had to combine the two select statements to get it to work. Or perhaps maybe it was the addition of the parentheses.

Sign In or Register to comment.