This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merge phased SNP variants to haplotypes? And is vcfallelicprimitives reversible?

Is is possible to create a VCF file were phased variants are merged to haplotypes?

Say I have a reference genome that exists only of T nucleotides and I have the following 2 phased variants.

Chr_01  18  T   G   GT  0|1 0|1
Chr_01  20  T   G   GT  0|1 0|0

Is there then a tool that can create a VCF file were all phased variants are merged to haplotypes? For the above case that would create this variant I think?

Chr_01  18  TTT GTT,GTG GT  0/2 0/1

If there is a tool that can do the above, does that mean that the conversion of haplotypes to allelic primivites with GATK VariantsToAllelicPrimitives and vcflib vcfallelicprimitives is always reversible given the SNP phasing information?

vcf

Hi William, your post just popped up at the side under 'similar posts'. Have you tried bcftools norm, specifically the following option:

-m, --multiallelics -|+[snps|indels|both|any] split multiallelic sites into biallelic records (-) or join biallelic sites into multiallelic records (+). An optional type string can follow which controls variant types which should be split or merged together: If only SNP records should be split or merged, specify snps; if both SNPs and indels should be merged separately into two records, specify both; if SNPs and indels should be merged into a single record, specify any.

0 answers

No answers yet.

Log in to answer this question.