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

Error: Cannot compare (>) objects of dissimilar types #245

Open
yifangt opened this issue Sep 27, 2018 · 5 comments
Open

Error: Cannot compare (>) objects of dissimilar types #245

yifangt opened this issue Sep 27, 2018 · 5 comments
Labels
bug Genuine bug

Comments

@yifangt
Copy link

yifangt commented Sep 27, 2018

Hello,
I was trying to filter my vcf file with:

vcffilter -f "DP > 10 & MQ > 30 & QD > 20" all_samples-raw.vcf

I always got an error and only had the header without any result:

cannot compare (>) objects of dissimilar types
3 4

Any clue to a possible fix of the problem?

@janxkoci
Copy link

I had this issue in the past, i think i solved it by using brackets like this:
... -f "( DP > 10 & MQ > 30 & QD > 20 )" ...

It also worked if i used only one annotation for filtering, that was the hint - you can try that to see if the error goes away..

@yifangt
Copy link
Author

yifangt commented Nov 13, 2018

No, the same error stayed!

@janxkoci
Copy link

I use this filter syntax in the genotype field (-g parameter), but i would assume it works the same for -f too..

@tseemann tseemann added the bug Genuine bug label Oct 1, 2019
@tseemann
Copy link
Contributor

tseemann commented Oct 1, 2019

I think I found the problem here.

cannot compare (>) objects of dissimilar types gets printed if one of the tags you are referring to does not exist in the VCF line.

Using the sample.vcf on github which has no NX tag:

 vcffilter -f 'DP > 10 & AF > 0.3 & NS > 2' sample.vcf # OK
 vcffilter -f 'DP > 10 & AF > 0.3 & NX > 2' sample.vcf # cannot compare (>)

@pjotrp
Copy link
Contributor

pjotrp commented Jan 20, 2021

I think the error message can be a little clearer

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

No branches or pull requests

4 participants