Skip to content

parse gtf attributes

Mojo function 🡭

fn def parse_gtf_attributes(span: Span[UInt8]) -> GtfAttributes

Parse GTF column 9: semicolon-separated ‘tag “value”’ pairs.

Extracts gene_id and transcript_id as first-class fields. All other attributes go into _extras. Supports:

  • Quoted values with backslash escapes (Issue 5)
  • Unquoted values such as exon_number 3 (Issue 3)
  • Duplicate keys (all values stored; use get_all() to retrieve them)

Args:

  • span (Span[UInt8])

Returns:

GtfAttributes

Raises: