Skip to content

GtfView

Mojo struct 🡭

@memory_only
struct GtfView[O: Origin[mut=O.mut]]

Zero-copy view over one GTF data line.

Lifetime: Valid only until the next parser read. Do not store; call .to_record() when the record must outlive the current iteration. Coordinates are 1-based inclusive.

  • O (Origin[mut=O.mut])
  • start (UInt64)
  • end (UInt64)
  • score (Optional[Float64])
  • strand (Optional[GtfStrand])
  • phase (Optional[UInt8])

AnyType, Deinitable, Movable

fn def __init__(out self, _seqid: Span[UInt8, O], _source: Span[UInt8, O], _type: Span[UInt8, O], start: UInt64, end: UInt64, score: Optional[Float64], strand: Optional[GtfStrand], phase: Optional[UInt8], _attributes: Span[UInt8, O])

Args:

  • _seqid (Span[UInt8, O])
  • _source (Span[UInt8, O])
  • _type (Span[UInt8, O])
  • start (UInt64)
  • end (UInt64)
  • score (Optional[Float64])
  • strand (Optional[GtfStrand])
  • phase (Optional[UInt8])
  • _attributes (Span[UInt8, O])
  • self (Self)

Returns:

Self

fn def seqid(self) -> StringSpan[O]

Args:

  • self (Self)

Returns:

StringSpan[O]

fn def source(self) -> StringSpan[O]

Args:

  • self (Self)

Returns:

StringSpan[O]

fn def feature_type(self) -> StringSpan[O]

Args:

  • self (Self)

Returns:

StringSpan[O]

fn def attributes_span(self) -> Span[UInt8, O]

Args:

  • self (Self)

Returns:

Span[UInt8, O]

fn def start_position(self) -> Position

Args:

  • self (Self)

Returns:

Position

fn def end_position(self) -> Position

Args:

  • self (Self)

Returns:

Position

fn def interval(self) -> Interval

Args:

  • self (Self)

Returns:

Interval

fn def to_record(self) -> GtfRecord

Materialize an owned GtfRecord by parsing attributes from column 9.

Args:

  • self (Self)

Returns:

GtfRecord

Raises: