cogent3.core.annotation_db.BasicAnnotationDb#
- class BasicAnnotationDb(*args, **kwargs)#
Provides a user table for annotations. This can be merged with either the Gff or Genbank versions.
Notes
This is the default db on Sequence, SequenceCollection and Alignment
- Attributes:
- db
describe
top level description of the annotation db
- 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
compatible
(other_db[, symmetric])checks whether table_names are compatible
count_distinct
(*[, seqid, biotype, name])return table of counts of distinct values
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
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
StrOrBool
add_records
from_dict
get_features_matching
to_json