This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Removing common SNPs from a set of VCF files

Hi all,

I am looking to generate a list of SNPs that are unique to different samples.

To that end, I used bcftools to generate a list of common SNPs for each sample as follows:

# for 9 samples
bcftools isec -p intersection -n =9 *vcf.gz

Now I am trying to subtract the common SNPs from the original VCF files to get the SNPs that are unique to each sample. I assume this should also be possible using bcftools but I could not find a "subtract" command.

Any advice is appreciated!

snp vcf filtering

1 answer

Have a look at the --complement option within isec. It prints all entries but the ones that you supply in B.

Great, thanks for pointing me in the right direction!

Log in to answer this question.