cogent3.core.annotation_db.BasicAnnotationDb#

class BasicAnnotationDb(*args: Any, **kwargs: Any)#

Provides a user table for annotations. This can be merged with either the Gff or Genbank versions.

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

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_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

write(path)

writes db as bytes to path

add_records

from_dict

get_features_matching

to_json

Notes

This is the default db on Sequence, SequenceCollection and Alignment