Skip to main content
`Ctrl`+`K`

# cogent3.core.annotation_db.GffAnnotationDb

class GffAnnotationDb(*args: Any, **kwargs: Any)

  Support for annotations from gff files. Records that span multiple rows in the gff are merged into a single record.

  Attributes:
    db
    `describe`

      top level description of the annotation db

    `schema_version`

      Return the schema version of this database.

    table_names

  Methods

  `add_feature`(*, seqid, biotype, name, spans) | adds a record to user table
  `add_records`(reduced, **kwargs) |
  `biotype_counts`() | return counts of biological types across all tables and seqids
  `close`() | closes the db
  `compatible`(other_db[, symmetric]) | checks whether table_names are compatible
  `count_distinct`(*[, seqid, biotype, name]) | return table of counts of distinct values
  `from_file`(path) | Load an annotation database from a file.
  `get_feature_children`(name[, biotype]) | yields children of name
  `get_feature_parent`(name, **kwargs) | yields parents of name
  `get_features_matching`(*[, biotype, seqid, ...]) | yield essential values to create a Feature for matching records
  `get_records_matching`(*[, biotype, seqid, ...]) | return all fields for matching records
  `make_indexes`() | adds db indexes for core attributes
  `num_matches`(*[, seqid, biotype, name, ...]) | return the number of records matching condition
  `subset`(*[, source, biotype, seqid, name, ...]) | returns a new db instance with records matching the provided conditions
  `to_rich_dict`() | returns a dict suitable for json serialisation
  `union`(annot_db) | returns a new instance with merged records with other
  `update`(annot_db[, seqids]) | update records with those from an instance of the same type
  `update_record_spans`(*, name, spans) | updates spans attribute of a gff table record if present
  `write`(path) | writes db as bytes to path

  from_dict |
  to_json |