bcftools select sites with multiple combinations of FILTER column
1
0
Entering edit mode
8 months ago
User000 ▴ 710

Hello

I would like to keep the rows that have the combinations of these expressions

bcftools query -i "%FILTER='PASS' | %FILTER='haplotype' | %FILTER='germline' | %FILTER='clustered_events'" -f '%CHROM\t%POS\t%REF\t%ALT[\t%AF]\n' invcf > outvcf

ie. `germline;clustered_events` ------> should be kept
but `germline;some_other_filter_not_listed` -------> should be eliminated

Is there a way to do this with bcftools?

bcftools • 648 views
ADD COMMENT
1
Entering edit mode
8 months ago

exclude/include:

 bcftools view -e 'FILTER ~ "FILTER1"'  -O u in.vcf |  bcftools view -i 'FILTER ~ "FILTER2"'     > out.vcf
ADD COMMENT
0
Entering edit mode

sorry, this is not very clear...

ADD REPLY
0
Entering edit mode

use a first bcftools to exclude variants having filter FILTER1 and pipe into another bcftools to only include variants having FILTER2

ADD REPLY
0
Entering edit mode

so what should I put in filter1? some_other_filter_not_listed?

ADD REPLY

Login before adding your answer.

Traffic: 1771 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