This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract species-specific SNPs from VCF files

Hi All,

I have polymorphic sites for each species from different accessions in separate vcf files. ~4-5 million SNPs for each of the 5 closely related species. I need to extract species-specific SNPs from this data and was wondering if there are any tools that can be used to do this?

Thanks, RT

vcf snps

1 answer

If I'm interpreting you correctly, you want to compare the VCF files, ignore SNPs shared by two (or more) species, and instead retain only those SNPs specific to each species. This sounds like a job for bcftools isec.

Based on the --help information:

   # Extract records private to A or B comparing by position only
   bcftools isec A.vcf.gz B.vcf.gz -p dir -n -1 -c all

Log in to answer this question.