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

script lobSTR_filter_vcf.py failure #78

Open
aakrosh opened this issue Nov 15, 2016 · 4 comments
Open

script lobSTR_filter_vcf.py failure #78

aakrosh opened this issue Nov 15, 2016 · 4 comments

Comments

@aakrosh
Copy link

aakrosh commented Nov 15, 2016

The script lobSTR_filter_vcf.py to filter variants fails on cases where the called genotype is "./.", and the subsequent values for "Q", "DISTENDS" are None. For example, the script failed at a location where the sample call was :

Call(sample=xxx, CallData(GT=./., ALLREADS=None, AML=None, DISTENDS=None, DP=None, DPA=None, GB=None, PL=None, PQ=None, Q=None, SB=None, STITCH=None))

A possible solution could be to add a check for ./. in the sample["GT"] values on the two lines that already check to see if sample["GT"] is empty/valid, unless that would have some unintended consequences.

@gymreklab
Copy link

Thanks for the comment. When you say fail, do you mean the script crashes, or that the output is not as expected?

Lines 175-178 were intended to deal with this case, and add "NOCALL" to the filter field of the entry. If GT is ./., it means we didn't observe any reads at the locus, and thus values for the other fields don't make any sense anyway. Did you expect a different behavior?

@aakrosh
Copy link
Author

aakrosh commented Nov 15, 2016

The script crashes with the following traceback:
"""
Traceback (most recent call last):
File "lobSTR-bin-Linux-x86_64-4.0.6/share/lobSTR/scripts/lobSTR_filter_vcf.py", line 165, in
if LogScore(sample["Q"]) < args.call_log_score:
File "lobSTR-bin-Linux-x86_64-4.0.6/share/lobSTR/scripts/lobSTR_filter_vcf.py", line 32, in LogScore
return -1*math.log10(1-score+SMALLNUM)
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
"""

I think the issue is that the on line 157 of the script is not sufficient to ignore cases where GT is ./. . I am using python 2.7.11 with PyVCF (0.6.8).

@wlfan
Copy link

wlfan commented Jul 18, 2017

I have troubled by the same problem for a whole day! So, could you provide any solution.

@aakrosh
Copy link
Author

aakrosh commented Jul 24, 2017

I believe changing line 157, and line 175 of lobSTR_filter_vcf.py to

if sample["GT"] and sample["GT"] != "./.":

should be sufficient to get rid of this issue. However, I would wait on confirmation from the author.

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

3 participants