bcftools selest sites with FILTER "PASS" or "."
1
1
Entering edit mode
4.1 years ago
curious ▴ 750

Trying to get site that have a FILTER value of "PASS" or "."

I know of:

bcftools view -f PASS filename.vcf.gz

and

bcftools view -f . filename.vcf.gz

I tried:

bcftools view -f 'PASS | .' filename.vcf.gz

but no dice.

Is it possible to get what I am looking for or do I have to filter separately then concat?

bcftools • 9.9k views
ADD COMMENT
8
Entering edit mode
4.1 years ago
bcftools view -f 'PASS,.' filename.vcf.gz
ADD COMMENT
1
Entering edit mode

Thanks I just got it on my end too:

bcftools view -i "%FILTER='PASS' | %FILTER='.'" filename.vcf.gz

ADD REPLY
1
Entering edit mode

I'm revisiting this comment now that I have a similar question, and your solution helps me more than the "explicit parameter" solution. Thank you for finding this solution.

ADD REPLY
0
Entering edit mode

Update: This does not work for my case (Use bcftools to filter a VCF with multiple filter flags )

ADD REPLY
0
Entering edit mode

There are many ways to get this done but when an explicit parameter is available (-f), it's better to use that.

ADD REPLY

Login before adding your answer.

Traffic: 3031 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6