Finding shared genotypes between multiple VCF files
1
0
Entering edit mode
4.4 years ago
ccagg ▴ 60

I have several VCF files generated from WES. Some share a condition, and others could be considered controls. I want to know which SNPs are shared between the files with the condition, and not in the controls. By "shared" I mean for a given SNP, I want to know whether they share the same genotype at that location. Many of the tools that I have tried, like bcftools isec seem to intersect by position, not by the actual genotype. Other tools like bcftools stats seem to only compare 2 files at once. Is there any way to do this for multiple files at once?

vcf SNP exome • 1.1k views
ADD COMMENT
0
Entering edit mode
4.4 years ago

merge your VCF files with bcftools merge and the select the variants with vcffilterjdk http://lindenb.github.io/jvarkit/VcfFilterJdk.html

e.g:

java -jar vcffilterjdk.jar -e 'return variant.getGenotype("sample1").sameGenotype(variant.getGenotype("sample2")) && variant.getGenotype("sample2").sameGenotype(variant.getGenotype("sample3"));'
ADD COMMENT

Login before adding your answer.

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