How to set variant FILTER in a VCF file based on overlap with regions in a BED file?
I guess this should be possible using e.g. bcftools
But the bcftools filter command can't do this annotation direct.
http://samtools.github.io/bcftools/bcftools.html#filter
Seems like I first need to annotate the overlap in an INFO field.
http://samtools.github.io/bcftools/bcftools.html#annotate
Is there a way to set the FILTER status of a variant in 1 single command (without adding an INFO field) based on overlap of the variant with a region in a BED file?
Using bcftools or any other tool?
I tested and I think the last filtering should be:
In order to remove the
BAD_REGION
annotated SNPs.I wanted to keep the
BAD_REGION
SNPs, but just tabel these SNPs.If you just want to remove these SNPs, than it's much more straightforward to do something like
bedtools subtract -a input.vcf -b bad_region.bed