Intersection of 3 multi-sampled vcf files
0
0
Entering edit mode
7.7 years ago

Hi,

I have 3 vcf files from different samples and would like to get a file with an intersection of common SNPs found in all 3 samples.

I have used bcftools isec for 2 samples first, took the intersection (either 0002.vcf or 0003.vcf generated from this) and then did another bcftools isec with the 3rd sample. However, I realised that only the samples present only belonged to the last sample group.

Could anyone advise on a way where I could receive an intersection of common SNPs found in all 3 samples with all samples present in the file?

Thank you very much!

vcf bcftools • 2.2k views
ADD COMMENT
0
Entering edit mode

Are your VCF files single-sample files? Your phrasing makes it sound that way.

ADD REPLY
0
Entering edit mode

You could take the file that you got after your intersections and then use BEDtools intersect:

bedtools intersect -a your.intersections -b *.vcf -wb | cut -f11-

-wb will make BEDtools print the intersection and the entire entry of the vcf in which the isec was found. *.vcf are the three original VCF files. The cut should then print the output of -wb, so the entries from B that isec with -A.

EDIT: Not sure if -f11-, so check the output from which column on the B entries start.

ADD REPLY

Login before adding your answer.

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