cogent3.core.annotation_db.GenbankAnnotationDb#
- class GenbankAnnotationDb(*args: Any, **kwargs: Any)#
Support for annotations from Genbank files.
- Attributes:
- db
describetop level description of the annotation db
schema_versionReturn 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[, exclude_biotype, ...])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
Extended attributes are stored as json in the gb, attributes column.