This is a test version of Biostars. For the public version, visit https://www.biostars.org.
correct way to determine unique sites in VCF files

Hi there,

I have the following situation. There are two VCF files B and C called with different approaches, they both represent a subset of variants of a truth file A.vcf and, to some extent, share some sites.

B and C have calls categorized in true positives (TP), false positives (FP), and false negatives (FN) which is not the case for A. So, my question is:


how can I determine the global number of TP/extra-sites in A aside from those present and shared between B and C, which I already computed, as well as the private ones in B and C, which are present in A but differ between the two files?


My first attempt has been to remove TP from both B and C and use bedtools intersect as follow:

bedtools intersect -v -a A.vcf.gz -b B_no-tp.vcf.gz C_no-tp.vcf.gz | bgzip -@32 > output.vcf.gz

However, the results is odd... my feeling is that this way I'm missing all the private sites which I wish to include without overlap. Another way I thought about it is to do bedtools intersect without the full B and C files, which gives me only extra-sites, then add back to the shared TP this number along with the private ones.

Any help is much appreciated, thanks!

P. S. I should then do the same for FP

bedtools vcf bcftools

Sorry I'm lazy, I don't really understand the whole idea of your project but I would use bcftools isec for such "SQL" task.

0 answers

No answers yet.

Log in to answer this question.