The current GATK version is 3.7-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!

Get notifications!

You can opt in to receive email notifications, for example when your questions get answered or when there are new announcements, by following the instructions given here.

Got a problem?

1. Search using the upper-right search box, e.g. using the error message.
2. Try the latest version of tools.
3. Include tool and Java versions.
4. Tell us whether you are following GATK Best Practices.
5. Include relevant details, e.g. platform, DNA- or RNA-Seq, WES (+capture kit) or WGS (PCR-free or PCR+), paired- or single-end, read length, expected average coverage, somatic data, etc.
6. For tool errors, include the error stacktrace as well as the exact command.
7. For format issues, include the result of running ValidateSamFile for BAMs or ValidateVariants for VCFs.
8. For weird results, include an illustrative example, e.g. attach IGV screenshots according to Article#5484.
9. For a seeming variant that is uncalled, include results of following Article#1235.

Did we ask for a bug report?

Then follow instructions in Article#1894.

Formatting tip!

Wrap blocks of code, error messages and BAM/VCF snippets--especially content with hashes (#)--with lines with three backticks ( ``` ) each to make a code block as demonstrated here.

Jump to another community
Picard 2.10.2 is now available at
GATK version 4.beta.2 (i.e. the second beta release) is out. See the GATK4 BETA page for download and details.

Selecting homozygote calls using SelectVariants


Is there a way to select ONLY homozygote calls from a vcf file using SelectVariants?

I understand that the GT for homozygotes is 1/1, whereas the genotype for heterozygotes is 0/1. But when I ude the following command, I get an empty vcf file (i.e. only with a header):

$ java -Xmx4g -jar GenomeAnalysisTK.jar -SelectVariants -R reference.fasta --variant input.vcf -select 'GT == "1/1";' -o output.vcf

I'd appreciate your help on this matter.





  • pdexheimerpdexheimer Member, Dev

    That's because GT is a FORMAT-level field (per-sample), not an INFO-level field (per-variant). You want something like -select 'vc.getGenotype("Sample_ID").isHomVar()'

  • And if I would like to select for homozygotes regardless of sample ID?



  • pdexheimerpdexheimer Member, Dev

    I don't understand how you select "regardless of sample ID"? Do you mean variants that are homozygous in all samples? Homozygous in any sample? Some threshold percentage?

    If you want the case where they're homozygous in all, you should just be able to select on AF. Otherwise, you'll probably need to write your own code - although you should be able to get the "any" case by ORing together a bunch of the sample-specific checks

  • So if I want all homozygous variant I should simply use "AF ==1.00"?

  • The problem with such an approach (i.e., if I use -select 'AF == "1.00";') is that in the following SNPs:

    chrI 288367 . ATT AT,A 5.07 PASS AC=2,0;AC1=2;AF=1.00,0.00;AF1=1;AN=2;DP=0;DP4=0,0,12,12;FQ=-94.5;INDEL;MQ=60;VDB=0.0708 GT:GQ:PL 1/1:50:44,60,0,39,15,27
    chrI 933806 . C T 42 PASS AC=2;AC1=2;AF=1.00;AF1=1;AN=2;DP=0;DP4=8,695,8,1038;FQ=-52;MQ=13;PV4=0.45,0,1,1;VDB=0.0220 GT:GQ:PL 1/1:47:75,25,0

    Only the second will be selected, while the first will be excluded even though both are designated as homozygotes (i.e. GT = 1/1)

    So I'm a little lost with this. I'd appreciate your thoughts.



  • pdexheimerpdexheimer Member, Dev

    Ahh, yes. The first line would I think be chucked by a validator because one of the alt alleles is not in any of the calls, but the larger point of multi-allelic sites is a good one

    There's no easy answer to this that I'm aware of. What was wrong with isHomVar()? If you don't have too many samples, you could generate a big AND statement. I think that's the only way to do this with SelectVariants.

  • My vcf files don't include data pertaining to sample ID. That's why I would like to call homozygotes regardless of sample IDs...



  • pdexheimerpdexheimer Member, Dev

    They have to include a sample name if they include genotypes. On the header line (the one that starts with '#CHROM'), the sample names start in column... I don't remember. Right after FORMAT. GATK enforces this, you shouldn't be able to run SelectVariants if your VCF is so badly malformed.

  • Well thanks anyway :)



Sign In or Register to comment.