Entering edit mode
4.6 years ago
roalva1
▴
90
Hello, If I execute this in bcftools 1.10.2
clinvar.vcf.gz is https://ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh37/clinvar.vcf.gz
bcftools query -i "CLNREVSTAT='criteria_provided,_conflicting_interpretations'" -f '%CLNREVSTAT\n' clinvar.vcf.gz | sort -uI get this results:
criteria_provided,_conflicting_interpretations criteria_provided,_multiple_submitters,_no_conflicts criteria_provided,_single_submitter
I was expecting to get only criteria_provided,_conflicting_interpretations. Is there anything that I don't understand.
Many thanks
see the "Notes" section here https://samtools.github.io/bcftools/bcftools.html#expressions
Seems like this applies to both the value used in the expression and to the contents of the field you are querying.
In one of my cases, I wanted to filter on an INFO tag like
TAG=val1,val3,val4
(a field with comma-separated string values), and include variants with certain values but exclude variants with other values. Since you cannot use both-i
and-e
simultaneously I ended up just|
piping the output of the first into the second one ;bcfools filter -i 'TAG="val1,val2"' input.vcf | bcftools filter -e 'TAG="val3,val4"'
Yes it seems so,
also I execute this:
The result isI think it is applying the OR also to the results. This is not my desire behavior :(
Thanks for the answer