This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Split genotypes in VCF file

I have a VCF file from dipcall. I used two samples, so I have two genotypes compared to the reference. I would like to split my VCF file into individual genotypes. For example, in the first case in the image below, there is G in the reference, but GT as allele 1 and GTT as allele 2. However, if I only want to have file with the first sample, I would only have reference allele G and allele 1 GT. For the second sample, I would have G in the reference, and GTT as allele 1.

How to do this, please?

I need this split because I want to apply the variants back to the reference and build a new consensus. Thank you!

enter image description here

vcf genotype dipcall

1 answer

vt decompose or bcftools norm

vt decompose did the trick for me, followed by the filtering for 10th and 11th column. Thanks!

Log in to answer this question.