text: user6504: 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
  
  
  user9098: 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
  ```
  
  
original_text: 6504: <p>I have 3 VCF files.</p>
  <pre><code>A1.vcf
  A2.vcf
  A3.vcf
  </code></pre>
  <p>I want to get the common SNPs that are present in all these three files. And output must be in vcf format.</p>
  <p>output:</p>
  <pre><code>common_A.vcf
  </code></pre>
   9098: <p>A potential solution is to compress and index the files using <a href="http://www.htslib.org/doc/bgzip.html" rel="nofollow noreferrer">bgzip</a> and <a href="http://www.htslib.org/doc/tabix.html" rel="nofollow noreferrer">tabix</a>, then use <a href="https://samtools.github.io/bcftools/bcftools.html#isec" rel="nofollow noreferrer">bcftools isec</a> to find SNPs common to all three files, e.g.</p>
  <pre><code>for files in A1.vcf A2.vcf A3.vcf
    do
    bgzip &quot;<span class="math-container">$files"
    tabix "$</span>files&quot;
  done
  
  bcftools isec -n=3 -c all -o all_common_SNPs.vcf A1.vcf.gz A2.vcf.gz A3.vcf.gz
  <span class="math-container">```</span>
  </code></pre>
  