Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing usage documentation on gtfilter #88

Open
IdoBar opened this issue Jun 17, 2024 · 1 comment
Open

Missing usage documentation on gtfilter #88

IdoBar opened this issue Jun 17, 2024 · 1 comment

Comments

@IdoBar
Copy link

IdoBar commented Jun 17, 2024

Hi,
I'm trying to use gtfilter (or Filter GT) module to set individual genotype calls to missing (".") if they match a certain criteria.
I managed to do so when filtering based on a minimum depth with:

SnpSift gtfilter -gv './.' "( DP<5 )" file.vcf

However, when I try to also check if the individual genotype is Heterozygote then it fails with an error:

SnpSift gtfilter -gv './.' "( DP<$IND_DP & isHet())"

java.lang.NullPointerException
        at org.snpsift.lang.LangFactory.functionBoolGenotypeFactory(LangFactory.java:369)
        at org.snpsift.lang.LangFactory.functionFactory(LangFactory.java:397)
        at org.snpsift.lang.LangFactory.expressionFactory(LangFactory.java:252)
        at org.snpsift.lang.LangFactory.expressionFactory(LangFactory.java:159)
        at org.snpsift.lang.LangFactory.expressionFactory(LangFactory.java:166)
        at org.snpsift.lang.LangFactory.expressionFactory(LangFactory.java:157)
        at org.snpsift.lang.LangFactory.compile(LangFactory.java:134)
        at org.snpsift.SnpSiftCmdFilterGt.parseExpression(SnpSiftCmdFilterGt.java:256)
        at org.snpsift.SnpSiftCmdFilterGt.run(SnpSiftCmdFilterGt.java:284)
        at org.snpsift.SnpSiftCmdFilterGt.run(SnpSiftCmdFilterGt.java:269)
        at org.snpsift.SnpSift.run(SnpSift.java:579)
        at org.snpsift.SnpSift.main(SnpSift.java:75)
SnpSift FilterGt -gv ./. ( DP<7 ) & (isHet())

How do I tell gtfilter to check the genotype?

Thanks, Ido

@IdoBar
Copy link
Author

IdoBar commented Jun 25, 2024

If anyone ends up here looking for the same issue, I managed to get it to perform the task with

SnpSift FilterGt -gv ./. " DP<10  | isHet(GEN[0])"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant