If you happen to see a question you know the answer to, please do chime in and help your fellow community members. 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.

Using VariantContext

Hi there,

I am running GATK 3.6 on Linux.
I am trying to build my own filters using VariantContext and JEXL.
I don't know Java language that much and I obviously make wrong queries but I miss the logic behind it.
As far as I understand, I can build queries using/combining the methods that have been developed and that are accessible here:

But sometimes I do well, while sometimes I mess up my query.
For example, using GenomeAnalysisTK.jar -T SelectVariants on a vcf containing two sample :
--select 'vc.getGenotype("sample1").getAlleles() != vc.getGenotype("sample2").getAlleles()' works fine
but --'vc.getGenotype("sample1").getAlternateAlleles() != vc.getGenotype("sample2").getAlternateAlleles()' does not work and generates this error message:
Invalid JEXL expression detected for select-2 with message ![24,45]: 'vc.getGenotype('sample1').getAlternateAlleles() != vc.getGenotype('sample2').getAlternateAlleles();' unknown, ambiguous or inaccessible method getAlternateAlleles

In this example, I am trying to select Het of sample1 that have a shared allele with sample2 (some positions have two ALT alleles, one for sample1, another for sample2: I want to get rid of those). Selecting Het works fine but my problem is that the method .getAlleles() includes the Reference allele in the output. So the method .getAlternateAlleles() is realy the one I need.

Could you explain me why my second query is not working?
In case it is not a problem of syntax, would you think to a trick that would get me the variant I am looking for (sample1 Het for an allele shared with sample2)



Sign In or Register to comment.