Skip to content

Position

Mojo struct 🡭

@register_passable_trivial
struct Position

1-based genomic coordinate (aligned with noodles_core::Position).

Valid positions are >= 1. Position 0 is invalid. BED stores 0-based half-open; convert when exposing via start_position/interval.

  • MIN_VALUE = 1
  • MAX_VALUE = UInt64.MAX
  • UNSET = 0

AnyType, Comparable, Copyable, Equatable, Hashable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, RegisterPassable, TrivialRegisterPassable

def __init__(out self, value: UInt64)

Args:

  • value (UInt64)
  • self (Self)

Returns:

Self

Raises:

def __init__(value: UInt64, _unsafe: Bool) -> Self

Internal: use when value is already known to be >= 1 (e.g. from conversion).

Args:

  • value (UInt64)
  • _unsafe (Bool)

Returns:

Self

def __lt__(self, other: Self) -> Bool

Args:

  • self (Self)
  • other (Self)

Returns:

Bool

def __eq__(self, other: Self) -> Bool

Args:

  • self (Self)
  • other (Self)

Returns:

Bool

def get(self) -> UInt64

Return the raw 1-based coordinate.

Args:

  • self (Self)

Returns:

UInt64