Locus

class hail.genetics.Locus[source]

An object that represents a location in the genome.

Parameters:
  • contig (str) – Chromosome identifier.

  • position (int) – Chromosomal position (1-indexed).

  • reference_genome (str or ReferenceGenome) – Reference genome to use.

Note

This object refers to the Python value returned by taking or collecting Hail expressions, e.g. mt.locus.take(5). This is rare; it is much more common to manipulate the LocusExpression object, which is constructed using the following functions:

Attributes

contig

Chromosome identifier.

position

Chromosomal position (1-based).

reference_genome

Reference genome.

Methods

parse

Parses a locus object from a CHR:POS string.

property contig

Chromosome identifier. :rtype: str

classmethod parse(string, reference_genome='default')[source]

Parses a locus object from a CHR:POS string.

Examples

>>> l1 = hl.Locus.parse('1:101230')
>>> l2 = hl.Locus.parse('X:4201230')
Parameters:
Return type:

Locus

property position

Chromosomal position (1-based). :rtype: int

property reference_genome

Reference genome.

Returns:

ReferenceGenome