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, Deinitable, Movable, Sized, Writable

fn def __init__(out self)

Args:

  • self (Self)

Returns:

Self

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

Append a key-value pair.

Args:

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

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

Args:

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

Return first value for key, if any.

Args:

  • self (Self)
  • key (String)

Returns:

Optional[BString]

fn 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[BString]

fn def __len__(self) -> Int

Args:

  • self (Self)

Returns:

Int

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

ID attribute — unique feature identifier.

Args:

  • self (Self)

Returns:

Optional[BString]

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

Name attribute — display name of the feature.

Args:

  • self (Self)

Returns:

Optional[BString]

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

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

Args:

  • self (Self)

Returns:

List[BString]

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

Alias attribute — secondary names (multi-value).

Args:

  • self (Self)

Returns:

List[BString]

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

Note attribute — free-text description.

Args:

  • self (Self)

Returns:

Optional[BString]

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

Derives_from attribute — processed from relationship.

Args:

  • self (Self)

Returns:

Optional[BString]

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

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

Args:

  • self (Self)

Returns:

List[BString]

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

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

Args:

  • self (Self)

Returns:

List[BString]

fn def is_circular(ref self) -> Bool

Is_circular attribute — True if the feature is circular.

Args:

  • self (Self)

Returns:

Bool

fn 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)