This is a test version of Biostars. For the public version, visit https://www.biostars.org.
SNP numbers don't add up to the number of record in a vcf

Hello,

I called variants using bcftools to obtain a two-sample vcf from which I excluded everything except biallelic SNPs using bcftools view -m2 -M2 -v snps. Then, using gatk VariantFiltration and SelectVariants I obtained subset VCFs with different SNP classes. Surprisingly, the number of SNPs in different classes does not add up to the number of SNPs in my master biallelic VCF, and is lower by a few dozens. Assuming I considered all the possible SNP classes (like het in both samples, homo ref in one het variant in the other etc.), why could those numbers differ?

bcftools gatk

extract the the SNP from file 1:

bcftools query -f '%CROM:%POS:%REF:%ALT\n' f1.vcf.gz | sort | uniq > a

extract the the SNP from the other files:

bcftools query -f '%CROM:%POS:%REF:%ALT\n' f2.vcf.gz > b
bcftools query -f '%CROM:%POS:%REF:%ALT\n' f3.vcf.gz >> b
bcftools query -f '%CROM:%POS:%REF:%ALT\n' f4.vcf.gz >> b
sort b > c

show us the difference(s):

comm -3 a c

Thanks! Hmm this did not work for me for some reason, will try to invesigate why

0 answers

No answers yet.

Log in to answer this question.