Call
- class hail.genetics.Call[source]
An object that represents an individual’s call at a genomic locus.
- Parameters:
Note
This object refers to the Python value returned by taking or collecting Hail expressions, e.g.
mt.GT.take(5`)
. This is rare; it is much more common to manipulate theCallExpression
object, which is constructed using the following functions:Attributes
Get the alleles of this call.
True if the call is phased.
The number of alleles for this call.
Methods
True if the ploidy == 2.
True if the ploidy == 1.
True if the call contains two different alleles.
True if the call contains two different alternate alleles.
True if the call contains one reference and one alternate allele.
True if the call has no alternate alleles.
True if the call contains identical alternate alleles.
True if the call contains any non-reference alleles.
Returns the count of non-reference alleles.
Returns a list containing the one-hot encoded representation of the called alleles.
Return the genotype index for unphased, diploid calls.
- is_het_ref()[source]
True if the call contains one reference and one alternate allele.
- Return type:
- one_hot_alleles(n_alleles)[source]
Returns a list containing the one-hot encoded representation of the called alleles.
Examples
>>> n_alleles = 2 >>> hom_ref = hl.Call([0, 0]) >>> het = hl.Call([0, 1]) >>> hom_var = hl.Call([1, 1])
>>> het.one_hot_alleles(n_alleles) [1, 1]
>>> hom_var.one_hot_alleles(n_alleles) [0, 2]
Notes
This one-hot representation is the positional sum of the one-hot encoding for each called allele. For a biallelic variant, the one-hot encoding for a reference allele is [1, 0] and the one-hot encoding for an alternate allele is [0, 1].