core.annotation_db.load_annotations

core.annotation_db.load_annotations(
    path,
    seqids=None,
    db=None,
    write_path=':memory:',
    lines_per_block=500000,
    show_progress=False,
    format_name=None,
    storage_backend=None,
)

loads annotations from flatfile into a db

Parameters

Name Type Description Default
path PathType path to a plain text file containing annotations, or a json file of a serialised cogent3 annotation db object required
seqids str | Iterable[str] | None only features whose seqid matches a provided identifier are returned, the default is all features. None
db AnnotationDbABC | None an existing feature db to add these records to. Must be of a compatible type. None
write_path PathType where the constructed database should be written, defaults to memory only ':memory:'
lines_per_block int | None number of lines to insert into the db per iteration. This can help with memory usage. Only applies to gff files. 500000
show_progress bool | Progress | dict[str, Any] applied only if loading features from multiple files False
format_name str | None explicitly specify annotation format (‘gff’, ‘genbank’, ‘json’). If not provided, format is auto-detected from file suffix. None
storage_backend str | None storage backend to use for the annotation database (e.g., ‘c3anndb’). If not provided, selects first compatible third-party plugin, falling back to cogent3 built-in SQLite loaders. None

Notes

We DO NOT check if a provided db already contains records from a flatfile.