This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bcftools selest sites with FILTER "PASS" or "."

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

1 answer

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

Thanks I just got it on my end too:

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

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

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.

Log in to answer this question.