Selecting homozygote calls using SelectVariants

sagipolanisagipolani Member Posts: 41

Hi,

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.

Thanks!

Sagi

Tagged:

Answers

  • pdexheimerpdexheimer Member, Dev Posts: 534 ✭✭✭✭

    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()'

  • sagipolanisagipolani Member Posts: 41

    Sorry - No go...

  • sagipolanisagipolani Member Posts: 41

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

    Thanks,

    Sagi

  • pdexheimerpdexheimer Member, Dev Posts: 534 ✭✭✭✭

    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

  • sagipolanisagipolani Member Posts: 41

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

  • sagipolanisagipolani Member Posts: 41

    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.

    Thanks!

    Sagi

  • pdexheimerpdexheimer Member, Dev Posts: 534 ✭✭✭✭

    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.

  • sagipolanisagipolani Member Posts: 41

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

    Thanks!

    Sagi

  • pdexheimerpdexheimer Member, Dev Posts: 534 ✭✭✭✭

    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.

  • sagipolanisagipolani Member Posts: 41

    Well thanks anyway :)

    Best,

    Sagi

Sign In or Register to comment.