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

Problem with specifying filtering expression v1.21 #2322

Closed
reshu23 opened this issue Nov 20, 2024 · 6 comments
Closed

Problem with specifying filtering expression v1.21 #2322

reshu23 opened this issue Nov 20, 2024 · 6 comments

Comments

@reshu23
Copy link

reshu23 commented Nov 20, 2024

Dear Team,
I am using bcftools 1.21. I have noticed, in this version, I can not use space between filtering expression. For example: when I tried bcftools stats -i 'QUAL>8 && DP>=10', It was not working. When I removed space between QUAL && and DP, It worked. Here is the screen shot: Is it the expected behavior of 1.21.? Thank you.
Screenshot (274)

@pd3
Copy link
Member

pd3 commented Dec 2, 2024

I suspect you forgot to put the filtering expression in quotes, therefore the program never saw the expression you intended it to execute. The arguments are passed to the program by the shell, so you must make sure the correct things is passed by putting it in quotes

# this works
-i 'DP>10 && QUAL>10'

# this cannot work
-i DP>10 && QUAL>10

@pd3 pd3 closed this as completed Dec 2, 2024
@reshu23
Copy link
Author

reshu23 commented Dec 2, 2024

I used with quote like this -i 'DP>10 && QUAL>10' . But it is not working until I am not going to remove space between "0 && Q". And use it like -i 'DP>10&&QUAL>10'. Is it because of this change?: Support multiple semicolon-separated strings when filtering by ID using -i/-e (#2190). For example, -i 'ID="rs123"' now correctly matches rs123;rs456

@pd3 pd3 reopened this Dec 3, 2024
@pd3
Copy link
Member

pd3 commented Dec 3, 2024

The spaces are not required. It must be down to a problem of how you are running the program. Are you executing it directly from a command line, or wrapping in a script, or how do you run it? This functionality has been in bcftools for a long time and there was no breaking change. I am unable to reproduce the problem, with any version.

@reshu23
Copy link
Author

reshu23 commented Dec 3, 2024

I am using singularity image from here: https://depot.galaxyproject.org/singularity/

And I just use singularity exec image bcftools stats -i .......

@pd3
Copy link
Member

pd3 commented Dec 17, 2024

I don't have much experience with singularity myself, but likely the arguments must be escaped somehow. Can you try to create a wrapper script and escape the arguments like this

#!/bin/bash
singularity exec singularity.sif bcftools "$@";

@reshu23
Copy link
Author

reshu23 commented Dec 17, 2024

Thank you. Yes, it is working now in wrapper script as suggested by you.

@pd3 pd3 closed this as completed Jan 2, 2025
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

2 participants