Question: How to apply vcftools --diff to identify vcf-specific variants/records
gravatar for Shicheng Guo
11 months ago by
Shicheng Guo8.2k
Shicheng Guo8.2k wrote:

HI All,

Apply vcftools --diff, it is easy to find command/shared variants between two VCF files.

vcftools --vcf  A.vcf --diff B.vcf --diff-site

However, Is there any easy to identify A specific or B specific variants?

Here is what I noticed:

Parameters as interpreted:
        --vcf gnomad.exomes.r2.1.sites.chr21.rec.ExomeStop.vcf
        --diff gnomad.exomes.r2.1.sites.chr21.rec.ExomeStop.vcf.vat

After filtering, kept 0 out of 0 Individuals
First Header entry should be #CHROM: #OM
Outputting Discordance By Site...
Found 1696 sites common to both files.
Found 57 sites only in main file.
Found 0 sites only in second file.
After filtering, kept 1753 out of a possible 1753 Sites
Run Time = 0.00 seconds

I want to extract these 57 sites which only belong to main file (the first file)


Sorry. It looks I find the solution:

 awk '$3==1' out.diff.sites | wc -l
vcftools --diff-site --diff • 769 views
ADD COMMENTlink modified 11 months ago • written 11 months ago by Shicheng Guo8.2k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 982 users visited in the last hour