BCFTOOLS MERGE

Combine multiple VCF/BCF files into a single multi-sample dataset

Upload at least 2 files

BCFTOOLS MERGE

Function

bcftools merge combines multiple VCF/BCF files into a single multi-sample dataset, aligning variants across samples into one unified file.


Input Format

  • Multiple VCF files (.vcf, .vcf.gz)
  • Multiple BCF files (.bcf)
  • Coordinate-sorted and indexed files required

Output Format

  • Multi-sample VCF (.vcf.gz)
  • Multi-sample BCF (.bcf)

Applications

  • Combine per-sample variant calls
  • Create cohort-level VCFs
  • Population genetics studies
  • Multi-sample comparison analysis
  • Preprocessing for joint genotyping

Example Usage

bcftools merge sample1.vcf.gz sample2.vcf.gz -Oz -o merged.vcf.gz
bcftools merge --force-samples file1.vcf.gz file2.vcf.gz -Oz -o merged.vcf.gz
bcftools merge -l vcf_list.txt -Oz -o cohort.vcf.gz

Important Notes:
  • Input files must be sorted and indexed.
  • Use --force-samples if sample names overlap.
  • Missing genotypes appear as ./..
  • BCF format is faster for large datasets.