VCF.Genotype (VCF v1.0.0)
View SourceA typed VCF genotype with arbitrary ploidy and per-allele phasing.
Each phasing entry is the optional separator prefix for the allele at the same position. This losslessly represents ordinary and VCF 4.4 partial phasing.
iex> {:ok, genotype} = VCF.Genotype.parse("0|1/2")
iex> genotype.alleles
[0, 1, 2]
iex> genotype.phasing
[nil, :phased, :unphased]
iex> VCF.Genotype.encode(genotype)
{:ok, "0|1/2"}
Summary
Functions
Encodes a genotype to canonical GT text.
Parses a GT value, including VCF 4.4 partial-phasing prefix notation.
Types
Functions
@spec encode(t()) :: {:ok, String.t()} | {:error, VCF.Error.t()}
Encodes a genotype to canonical GT text.
@spec parse(String.t()) :: {:ok, t()} | {:error, VCF.Error.t()}
Parses a GT value, including VCF 4.4 partial-phasing prefix notation.