Entering edit mode
4.8 years ago
curious
▴
820
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?
Thanks I just got it on my end too:
bcftools view -i "%FILTER='PASS' | %FILTER='.'" filename.vcf.gz
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.
Update: This does not work for my case (Use bcftools to filter a VCF with multiple filter flags )
There are many ways to get this done but when an explicit parameter is available (
-f
), it's better to use that.