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

Using COUNT with bcftools filter across all samples #2363

Open
mhoban opened this issue Feb 1, 2025 · 0 comments
Open

Using COUNT with bcftools filter across all samples #2363

mhoban opened this issue Feb 1, 2025 · 0 comments

Comments

@mhoban
Copy link

mhoban commented Feb 1, 2025

Is there a way to use bcftools filter with COUNT to return only positions with a certain number of values for a given FORMAT entry across all samples?

For example, I'd like to filter out positions where the number of all AD values is exactly two. I can do this for one sample, like this:

bcftools filter -i 'COUNT(AD[0:*]) == 2' input.vcf.gz > filtered.vcf

Is there a way to do this for all samples? Or do I have to enter each position manually? I've tried various permutations of the indexing syntax but it doesn't quite seem to do what I need.

thanks!

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