Hello Fin, thank you very much for your answer. Now I see that by default, bedtools filters out only variants with 100% overlap with bed file, so if I have a long variant covering 2 regions in bed file and I don't have -A option (which filters out variants with at least 1bp overlap), bedtools "touch" the variant 2x - at first while comparison with first bed region (and reports it in output because overlap is not 100%) and at second while comparison with second bed region (and reports because overlap is not 100%). I checked the file and there is a lot of long variants.
So I tried both possibilities (bedtools subtract -A and bcftools view -T) and the output is a bit different:
$ bedtools subtract -A -a test.vcf -b ../../../external/homopolymer_5bp_chr01tochrY.bed|wc
94026 1034286 41177623
$ bcftools view -T ^../../../external/homopolymer_5bp_chr01tochrY.bed test.vcf|wc
97258 1069023 43390082
so I think I will finally keep bedtools subtract -A output, because it was able to filter out more variants.
Thank you really a lot, you pushed me to right way. Next time I promise, I will read better :)
Have a nice day, Martina
Please use the formatting bar (especially the
codeoption) to present your post better. You can use backticks for inline code (`text` becomestext), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.Ok, thank you, next time I will focuse on it
You can try running the diff command on the original and subtracted VCF file to see what the changes were. It may help figure out what is going on.