samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
649 stars 240 forks source link

`bcftools filter --exlude FILTER~"multiallelic"` causes `No such INFO field: multiallelic` #2034

Closed monagai closed 10 months ago

monagai commented 10 months ago

bcftools 1.13 Using htslib 1.13

bcftools filter --exclude FILTER~"multiallelic" xxx.vcf causes No such INFO field: multiallelic

Why does this command cause error? Why INFO field??? Of course, there are multiallelics in the FILTER field in xxx.vcf. bcftools view causes the same error.

pd3 commented 10 months ago

The entire expression needs to be quoted, otherwise what the program is passed to by the shell is FILTER~multiallelic rather than FILTER~"multiallelic". So the correct command is

bcftools filter --exclude 'FILTER~"multiallelic"' 

More recent versions give an error message which is hopefully more informative:

Could not parse the expression, an unquoted string value perhaps? FILTER~multiallelic
monagai commented 10 months ago

Hi @pd3 I really thank you quick and proper reply. It works.

I'm really sorry for my lack of attention. Though I had tried "FILTER~multiallelic", I hadn't thought of it.

Thank you!

pd3 commented 10 months ago

No worries. It's an easy mistake to make, shell expansions are sometimes tricky