Using BCFtools to intersect multiple VCF files
1
0
Entering edit mode
5.2 years ago
Hadi M ▴ 50

Hi all,

I have 5 VCF files (A, B, C, D, and E) and I want to obtain all the variants shared by A and B only (not found in C, D, and E). I used BCFtools to do this and output all the positions. When I examined the variants using IGV, I still find variants that are not shared exclusively between A and B. This is the command I used:

bcftools isec -c none -n=2 -p isec A.vcf.gz B.vcf.gz C.vcf.gz D.vcf.gz E.vcf.gz

I would appreciate if you can help me find the fault in my command. Cheers :)

bcftools isec • 5.5k views
ADD COMMENT
3
Entering edit mode
5.2 years ago
Ram 43k

The command you're using translates to "pick variants found in any two files". You should change it so it follows a pattern similar to the fifth example in the manual:

Print a list of records which are present in A and B but not in C and D

bcftools isec -n~1100 -c all A.vcf.gz B.vcf.gz C.vcf.gz D.vcf.gz
  
ADD COMMENT

Login before adding your answer.

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