COmparing two SNV vcf files using bedtools
2
0
Entering edit mode
8.5 years ago
panbar ▴ 20

I have two SNV vcf files A.vcf and B.vcf I would like to find the

  • common SNVs between A and B
  • SNVs unique for A
  • SNVs unique for B

I tried bedtools intersect option for finding common between A and B.

bedtools intersect -a A.vcf -b B.vcf > ABcommon.vcf

Can anyone suggest how to find - SNVs unique for A SNVs unique for B

vcf bedtools intersect • 3.5k views
ADD COMMENT
0
Entering edit mode
8.5 years ago
DG 7.3k

The example is right in the documentation, you want to use the -v flag which gives you those features in A that are not in B. For the reverse, just flip your A and B files.

ADD COMMENT
0
Entering edit mode
8.5 years ago
jasper1918 ▴ 10

Please be aware that bedtools does not verify that the allele is common between both samples when doing intersection. It is looking only at positions. This will inflate your concordance. Rather, I would use bcftools isec

ADD COMMENT

Login before adding your answer.

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