AltAllele

class hail.representation.AltAllele(ref, alt)[source]

An object that represents an allele in a polymorphism deviating from the reference allele.

Parameters:
  • ref (str) – reference allele
  • alt (str) – alternate allele

Attributes

alt Alternate allele.
ref Reference allele.

Methods

__init__ x.__init__(…) initializes x; see help(type(x)) for signature
category Returns the type of alt, i.e one of SNP, Insertion, Deletion, Star, MNP, Complex
is_MNP True if this alternate allele is a multiple nucleotide polymorphism (MNP)
is_SNP True if this alternate allele is a single nucleotide polymorphism (SNP)
is_complex True if this alternate allele does not fit into the categories of SNP, MNP, Insertion, or Deletion
is_deletion True if this alternate allele is a deletion of one or more bases
is_indel True if this alternate allele is either an insertion or deletion of one or more bases
is_insertion True if this alternate allele is an insertion of one or more bases
is_transition True if this alternate allele is a transition SNP.
is_transversion True if this alternate allele is a transversion SNP.
num_mismatch Returns the number of mismatched bases in this alternate allele.
stripped_snp Returns the one-character reduced SNP.
alt

Alternate allele.

Return type:str
category()[source]
Returns the type of alt, i.e one of
SNP, Insertion, Deletion, Star, MNP, Complex
Return type:str
is_MNP()[source]

True if this alternate allele is a multiple nucleotide polymorphism (MNP)

Return type:bool
is_SNP()[source]

True if this alternate allele is a single nucleotide polymorphism (SNP)

Return type:bool
is_complex()[source]

True if this alternate allele does not fit into the categories of SNP, MNP, Insertion, or Deletion

Return type:bool
is_deletion()[source]

True if this alternate allele is a deletion of one or more bases

Return type:bool
is_indel()[source]

True if this alternate allele is either an insertion or deletion of one or more bases

Return type:bool
is_insertion()[source]

True if this alternate allele is an insertion of one or more bases

Return type:bool
is_transition()[source]

True if this alternate allele is a transition SNP.

This is true if the reference and alternate bases are both purine (A/G) or both pyrimidine (C/T). This method raises an exception if the polymorphism is not a SNP.

Return type:bool
is_transversion()[source]

True if this alternate allele is a transversion SNP.

This is true if the reference and alternate bases contain one purine (A/G) and one pyrimidine (C/T). This method raises an exception if the polymorphism is not a SNP.

Return type:bool
num_mismatch()[source]

Returns the number of mismatched bases in this alternate allele.

Fails if the ref and alt alleles are not the same length.

Return type:int
ref

Reference allele.

Return type:str
stripped_snp()[source]

Returns the one-character reduced SNP.

Fails if called on an alternate allele that is not a SNP.

Return type:str, str