DatabaseStorageManager¶
- class DatabaseStorageManager(hdf5_filepath, storage_name, force_new=False)[source]¶
Database hdf5 storage manager.
Constructor for storage manager.
- Parameters
Attributes
active_elementsActive storage elements that can be used.
element_stateCached states per storage element.
has_accsTrue if database storage contains sequence accessions, False otherwise.
has_alignTrue if database storage contains alignments, False otherwise.
has_repseqTrue if database storage contains reference sequences, False otherwise.
has_taxTrue if database storage contains reference taxonomy, False otherwise.
has_treeTrue if database storage contains reference phylogeny, False otherwise.
hdf5_filepathPath to hdf5 file.
repseq_idsThe rids present in the storage.
stateState of the storage manager.
storage_nameStorage database name/label.
summaryCached storage database summary table.
taxon_idsThe tids present in the storage.
Methods
commit_to_storage(element_key, product_generator)This is a primary function that commit changes to the storage.
compress_storage([complevel, complib, overwrite])Compresses the storage file using the required parameters.
get_element_data_by_ids(element_key, ids)Get partial data from storage element by ids.
get_index_by_element(element_key[, condition])Get index of target storage element.
imprint_database(stamp_dict)This is the final function that _local constructor must call.
initiate_memory_cache([level])Load various elements based on level from storage to the memory for rapid data access.
retrieve_data_by_element(element_key[, …])Retrieves data from storage element as whole or in chunks.
shutdown()Shutdown the database and mark cache clean for garbage collector.
validate_storage(hdf5_filepath, storage_name)Validates storage hdf5 file.