Notice:
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.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.
Attention:
We will be out of the office on October 14, 2019, due to the U.S. holiday. We will return to monitoring the forum on October 15.

Filtering for Homozygous Variants

AmandaAmanda North CarolinaMember

Hello,

I am trying to use an or statement to select for homozygous opposite genotypes between two samples in select variants. I have tried some variations but never been able to get what I am looking for in the outcome. Can you please advise what is going wrong here.

Options in use are:
-env -noTrim --selectTypeToExclude INDEL -select 'vc.getGenotype("SampleA").isHomVar() || vc.getGenotype("SampleA").isHomRef()' --selectexpressions "AF==0.500" --restrictAllelesTo BIALLELIC

If I can select for either HomVar or HomRef for that sample, then the AF should take care of ensuring the second sample is homozygous for the opposite genotype with the AF.

Thank you,
Amanda

Best Answer

Answers

  • AmandaAmanda North CarolinaMember

    PS - I know that I can do this in two steps and combine then sort the resulting output, but I would like to understand why and perhaps it's a bug that will not allow both filters to occur at the same time.
    Thank you!

  • SheilaSheila admin Broad InstituteMember, Broadie, Moderator admin

    @Amanda
    Hi Amanda,

    I'm a little confused about what you are trying to do. Can you post an example of what exactly you would like?

    For example, do you want to select sites where sample A has 0/0 and sample B has 1/1. And, you also want to select sites where sample A has 1/1 and sample B has 0/0?

    Thanks,
    Sheila

  • AmandaAmanda North CarolinaMember

    Hi Sheila,

    Since I'm back on for another question, I just saw this response.

    Yes that is exactly what I was trying to do, but I obviously solved it and not sure how I did since it has been some time. If you have a suggestion I can try that if I need to do it again.

    Best,
    Amanda

  • SheilaSheila admin Broad InstituteMember, Broadie, Moderator admin

    @Amanda
    Hi Amanda,

    I think you were on the right track in your first post. Instead of using 'vc.getGenotype("SampleA").isHomVar() || vc.getGenotype("SampleA").isHomRef()' together, you would use 'vc.getGenotype("SampleA").isHomVar() && vc.getGenotype("SampleB").isHomRef()' || 'vc.getGenotype("SampleB").isHomVar() && vc.getGenotype("SampleA").isHomRef()'

    So, you would get the two combinations you want (A hom var and B hom ref or B hom var and A hom ref).

    I hope that helps.

    -Sheila

  • SheilaSheila admin Broad InstituteMember, Broadie, Moderator admin

    @mmats010
    Hi,

    Yes, that is correct. You can do it in two lines instead of an "or" statement :smile:

    Thanks,
    Sheila

Sign In or Register to comment.