This is a test version of Biostars. For the public version, visit https://www.biostars.org.
phasing genotype

How can I "translate" the genotype of my vcf file in alleles? For example: 0|1 vs A|T

genotype

3 answers

bcftools query -f'%REF|%ALT\n' in.vcf > output.txt
G|A
T|A
C|T
G|A
C|T
C|T
A|G
T|C
T|C
T|C
G|A

If you want to reconstruct the haplotypes having a VCF with phased genotypes in place, I can recommend haplosaurus, developed by Ensembl.

bcftools query -f '%CHROM %POS %ID[ %TGT]\n' in.vcf

Log in to answer this question.