TransWikia.com

Find common SNPs in multiple VCF files

Bioinformatics Asked on May 9, 2021

I have 3 VCF files.

A1.vcf
A2.vcf
A3.vcf

I want to get the common SNPs that are present in all these three files. And output must be in vcf format.

output:

common_A.vcf

One Answer

A potential solution is to compress and index the files using bgzip and tabix, then use bcftools isec to find SNPs common to all three files, e.g.

for files in A1.vcf A2.vcf A3.vcf
  do
  bgzip "$files"
  tabix "$files"
done

bcftools isec -n=3 -c all -o all_common_SNPs.vcf A1.vcf.gz A2.vcf.gz A3.vcf.gz
```

Answered by jared_mamrot on May 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP