Skip to content

GtfAttributes

Mojo struct 🡭

@memory_only
struct GtfAttributes

Parsed GTF column 9 attributes.

gene_id and transcript_id are mandatory GTF2.2 fields stored directly. All other attributes are in _extras as single-value key-value pairs.

  • gene_id (BString)
  • transcript_id (BString)

AnyType, Copyable, ImplicitlyDestructible, Movable, Sized, Writable

def __init__(out self, var gene_id: BString, var transcript_id: BString)

Args:

  • gene_id (BString)
  • transcript_id (BString)
  • self (Self)

Returns:

Self

def __init__(out self, *, copy: Self)

Args:

  • copy (Self)
  • self (Self)

Returns:

Self

def get(ref self, key: String) -> Optional[BString]

Return the value for the given attribute key, if any.

Args:

  • self (Self)
  • key (String)

Returns:

Optional

def __len__(self) -> Int

Args:

  • self (Self)

Returns:

Int

def write_to[w: Writer](ref self, mut writer: w)

Emit attributes in GTF format: gene_id ”…”; transcript_id ”…”; …

Parameters:

  • w (Writer)

Args:

  • self (Self)
  • writer (w)