🧬 BEAGLE to VCF Converter (bgl2vcf.py)
This Python script converts phased BEAGLE v3.1 genotype files (.bgl) to the standardized VCF (Variant Call Format), using variant annotations from a corresponding PLINK .bim file.
BEAGLE v3.1 file (.bgl): Phased genotype data in BEAGLE format. PLINK .bim file (.bim): Contains SNP metadata (Chromosome, RSID, Position, Alleles) 🧾 Output
A .vcf file compatible with downstream tools and pipelines. Phased genotypes represented using VCF-style genotype encoding (0|0, 0|1, etc.). Any SNPs not found in the .bim file or with inconsistent allele encoding will be skipped or marked as missing (./.).
Usage
python bgl2vcf.py <input.bgl> <input.bim> <output.vcf>
Example
python bgl2vcf.py example.bgl example.bim output.vcf
🔧 Requirements
Python 3.x No external dependencies (uses only built-in libraries: sys, re)