To celebrate the release of GATK 4.0, we are giving away free credits for running the GATK4 Best Practices pipelines in FireCloud, our secure online analysis portal. It’s first come first serve, so sign up now to claim your free credits worth $250. Sponsored by Google Cloud. Learn more at

SelectVariant JEXL expression to select private variants from multisample VCF

Dear all,

I hava multi-sample VCF file from which i need to extract shared private variants(variants shared only a specific group) . I have used the below command to find shared variants.

java -Xmx4g -jar GenomeAnalysisTK.jar -T SelectVariants -R ref.fa --variant -select 'vc.getGenotype("LJ1A2").isHomVar() && vc.getGenotype("LJA3").isHomVar()' > shared.vcf

This gives the shared variants in LJ1A2 and LJA3. And I can use the below expression to find shared private variants

'vc.getGenotype("LJ1A2").isHomVar() && vc.getGenotype("LJA3").isHomVar() && vc.getGenotype("JLA4").isHomRef()'

this gives the shared hom varaints in LJ1A2, LJA3 and REF in JLA4. i.e. shared private hom variants with respect to one control (JLA4).

How can specify all the other samples (100's) in the vcf file to have '.isHomRef()' except those specified to have '.isHomVar' ?

It would be complex to specify each and every sample manually when there are >200 samples. COuld someone suggest a smoother way of doing this by using any wild cards?

Issue · Github
by Sheila

Issue Number
Last Updated
Closed By

Best Answer


Sign In or Register to comment.