Skip to content

Gff3Attributes

Mojo struct 🡭

@memory_only
struct Gff3Attributes

Parsed GFF3 attributes: list of (key, list of values).

Provides typed accessors for GFF3 reserved attributes (ID, Name, Parent, Alias, Note, Derives_from, Dbxref, Ontology_term, Is_circular) in addition to generic get() / get_all() access.

AnyType, Copyable, ImplicitlyDestructible, Movable, Sized, Writable

def __init__(out self)

Args:

  • self (Self)

Returns:

Self

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

Args:

  • copy (Self)
  • self (Self)

Returns:

Self

def add(mut self, key: BString, value: BString)

Append a key-value pair.

Args:

  • self (Self)
  • key (BString)
  • value (BString)
def add_multi(mut self, key: BString, values: List[BString])

Append a key with multiple values (GFF3 comma-separated).

Args:

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

Return first value for key, if any.

Args:

  • self (Self)
  • key (String)

Returns:

Optional

def get_all(ref self, key: String) -> List[BString]

Return all values for key (GFF3 multi-value attributes).

Args:

  • self (Self)
  • key (String)

Returns:

List

def __len__(self) -> Int

Args:

  • self (Self)

Returns:

Int

def id(ref self) -> Optional[BString]

ID attribute — unique feature identifier.

Args:

  • self (Self)

Returns:

Optional

def name(ref self) -> Optional[BString]

Name attribute — display name of the feature.

Args:

  • self (Self)

Returns:

Optional

def parent(ref self) -> List[BString]

Parent attribute — part-of relationships (multi-value).

Args:

  • self (Self)

Returns:

List

def aliases(ref self) -> List[BString]

Alias attribute — secondary names (multi-value).

Args:

  • self (Self)

Returns:

List

def note(ref self) -> Optional[BString]

Note attribute — free-text description.

Args:

  • self (Self)

Returns:

Optional

def derives_from(ref self) -> Optional[BString]

Derives_from attribute — processed from relationship.

Args:

  • self (Self)

Returns:

Optional

def dbxref(ref self) -> List[BString]

Dbxref attribute — database cross-references (multi-value).

Args:

  • self (Self)

Returns:

List

def ontology_term(ref self) -> List[BString]

Ontology_term attribute — controlled vocabulary terms (multi-value).

Args:

  • self (Self)

Returns:

List

def is_circular(ref self) -> Bool

Is_circular attribute — True if the feature is circular.

Args:

  • self (Self)

Returns:

Bool

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

Emit attributes in GFF3 format: key=value;key=val1,val2

Parameters:

  • w (Writer)

Args:

  • self (Self)
  • writer (w)