This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bcftools isec: weird number of output file

Hi all :) !

I need help: I want to intersect 2 vcf file (fileA and fileB) in order to have three file:

1) common variants fileA and fileB

2) variants in fileA that are not present in fileB

3) variants in fileB that are not present in fileA

I tried with this command:

bcftools isec fileA fileB -p directoryOutput

In my directoryOuput, I found 4 file: 0000.vcf, 0001.vcf, 0002.vcf, 0003.vcf , README.txt and sites.txt.

README.txt reported:

Using the following file names:

0000.vcf for records private to fileA.vcf.gz

0001.vcf for records private to fileB.vcf.gz

0002.vcf for records from fileA.vcf.gz shared by both fileA.vcf.gz fileB.vcf.gz

0003.vcf for records from fileB.vcf.gz shared by both fileA.vcf.gz fileB.vcf.gz

I was exspecting to have three file:

1) for records private to fileA,

2) for records private to fileB

3) for records shared by both fileA and fileB

what did I do wrong?

Thank you in advance

Best

bcftools intersection result vcf

1 answer

Your last two files should basically contain the identical set, but depending on your VCF files they could conceivably have different annotations or names. In the case of SVs the individual records could have differing lengths but still intersect with one another. So the program outputs two files for the intersection based on the source record it is outputting.

Log in to answer this question.