I/O — DataIterator & GFFWriter¶
DataIterator¶
Factory function that returns a streaming iterator over GFF3/GTF input
(file path, URL, raw string with from_string=True, or an iterable of
Feature objects).
gffbase.iterators.DataIterator ¶
DataIterator(data, checklines: int = 10, transform=None, force_dialect_check: bool = False, from_string: bool = False, **kwargs) -> _DataIterator
Legacy factory. Returns an iterator yielding Feature.
Source code in python/gffbase/iterators.py
GFFWriter¶
gffbase.gffwriter.GFFWriter ¶
GFFWriter(out: Union[str, 'os.PathLike', 'io.IOBase'], with_header: bool = True, in_place: bool = False)
Write Feature records back to a GFF/GTF file.
Source code in python/gffbase/gffwriter.py
export_sqlite¶
Serialize a GFFBase DuckDB connection back into a legacy
gffutils-compatible SQLite database.
gffbase.sqlite_export.export_sqlite ¶
Write a legacy SQLite .db from the given DuckDB connection.
Returns the absolute path on success.
Source code in python/gffbase/sqlite_export.py
Low-level parser¶
gffbase.parser.parse_gff ¶
parse_gff(path: str, *, checklines: int = 10, force_dialect_check: bool = False, force_gff: bool = False, strict: bool = True, engine: Optional[str] = 'auto') -> _Iterator
Parse a GFF3/GTF file (plain text or .gz).
Returns an iterator of ParsedFeature plus .dialect(),
.directives(), and (Phase 16) .warnings accessors.
Parameters¶
strict : bool
When True (default), the iterator raises GFFFormatError on
the first malformed line. When False, malformed lines are
skipped silently and recorded in iterator.warnings.
Source code in python/gffbase/parser.py
gffbase.parser.parse_bytes ¶
parse_bytes(data: bytes, *, checklines: int = 10, force_dialect_check: bool = False, force_gff: bool = False, strict: bool = True, engine: Optional[str] = 'auto') -> _Iterator