Feature¶
gffbase.feature.Feature ¶
Feature(seqid: str = '.', source: str = '.', featuretype: str = '.', start='.', end='.', score: str = '.', strand: str = '.', frame: str = '.', attributes=None, extra=None, bin: Optional[int] = None, id: Optional[str] = None, dialect: Optional[dict] = None, file_order: Optional[int] = None, keep_order: bool = False, sort_attribute_values: bool = False)
Backward-compatible public Feature object.
Mirrors the legacy gffutils.Feature constructor and observable
behavior: 1-based inclusive coordinates, list-wrapped multi-value
attributes, dialect-faithful __str__ round-trip.
Source code in python/gffbase/feature.py
astuple ¶
Legacy 12-tuple shape used by the SQLite export path:
(id, seqid, source, featuretype, start, end, score, strand, frame,
attributes_json, extra_json, bin).
Source code in python/gffbase/feature.py
sequence ¶
Extract sequence from a FASTA path or a pyfaidx-style mapping.
Source code in python/gffbase/feature.py
ParsedFeature (parser-internal record)¶
The slotted dataclass the Rust+Python parser emits before features land in the database.
gffbase.feature.ParsedFeature
dataclass
¶
ParsedFeature(seqid: str, source: str, featuretype: str, start: Optional[int], end: Optional[int], score: str, strand: str, frame: str, attributes_blob: bytes, attributes_pairs: List[Tuple[str, str, int]] = list(), extra: List[str] = list())
attributes_dict ¶
Materialize attributes as {key: [values...]}. Preserves first-seen
key order and multi-value ordering. Defers to attributes_pairs so the
Rust and Python parsers remain trivially comparable.
Source code in python/gffbase/feature.py
from_tuple
classmethod
¶
Build from the 11-tuple shape that the Rust extension yields.