-
Notifications
You must be signed in to change notification settings - Fork 240
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
-i and -e are not complement when I use query subcommand #1783
Comments
Can you provide a specific example to demonstrate the behavior please? |
I explain the issue by using this example vcf file named
I ran
However, I think the outputs should be like this.
In addition, if I add DP tag in my query, the outputs is like this. The number of rows are changed even though I don't change the filtering option.
Thank you for your consideration. |
I see. It's probably an older version of bcftools, there were some bugs fixed over the time. The latest gives the expected output:
|
Thank you for your help.
|
I was able to reproduce the problem now
|
I believe the bug is now fixed by f4dee4b |
I noticed the result of
bcftools query -i 'FMT/DP>=20' -f '[%CHROM %POS %SAMPLE\n]' input.vcf
and
bcftools query -e 'FMT/DP<20' -f '[%CHROM %POS %SAMPLE\n]' input.vcf
are not complement.
This occur if only I specified %SAMPLE but %FORMAT tags, so I can avoid it by specifying other %FORMAT tags but it is a little inconvenient and confusing.
I think this is because the process is skipped by the code shown below when I use
-e
and the condition is met in some samples.If only %SAMPLE is specified, not %FMT/DP, etc., the flag BCF_UN_FMT is not set. When I use
-i
, this checking and skipping do not occur.bcftools/vcfquery.c
Line 146 in 12088c0
The simple solutions I think is to omit the above code or to change the code below to set the flag.
bcftools/convert.c
Line 1304 in 12088c0
However, I'm not sure how this change will affect the rest of the code.
Thank you,
The text was updated successfully, but these errors were encountered: