Biostar Beta. Not for public use.
Using BCFtools to intersect multiple VCF files
Entering edit mode
15 months ago
Hadi M • 10

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 • 383 views
Entering edit mode
2 days ago
RamRS 21k
Houston, TX

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

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.1