MakeDb Class API
MakeDb
Source code in src/AnnSQL/MakeDb.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
__init__(adata=None, db_name=None, db_path='db/', create_all_indexes=False, create_basic_indexes=False, convenience_view=True, chunk_size=5000, make_buffer_file=False, layers=['X', 'obs', 'var', 'var_names', 'obsm', 'varm', 'obsp', 'uns'], print_output=True)
Initializes the MakeDb object. This object is used to create a database from an AnnData object by using the BuildDb method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata
|
AnnData
|
The AnnData object to be used for creating the database. |
None
|
db_name
|
str
|
The name of the database. |
None
|
db_path
|
str
|
The path where the database will be created. Must have a trailing slash. |
'db/'
|
create_all_indexes
|
bool
|
Whether to create indexes for all layers in the database. |
False
|
create_basic_indexes
|
bool
|
Whether to create indexes for basic layers in the database. |
False
|
convenience_view
|
bool
|
Whether to create a convenience view for the database. |
True
|
chunk_size
|
int
|
The number of cells to be processed in each chunk. |
5000
|
make_buffer_file
|
bool
|
Whether to create a buffer file for storing intermediate data. Necessary for low memory systems (<=12Gb). |
False
|
layers
|
list of str
|
The layers to be included in the database. |
['X', 'obs', 'var', 'var_names', 'obsm', 'varm', 'obsp', 'uns']
|
print_output
|
bool
|
Whether to print output messages. |
True
|
Returns:
Type | Description |
---|---|
None |
Source code in src/AnnSQL/MakeDb.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
build_db()
Builds the database by creating it, executing the necessary SQL statements, and closing the connection.
Returns: None
Source code in src/AnnSQL/MakeDb.py
76 77 78 79 80 81 82 83 84 85 86 87 |
|
create_db()
Creates a new database if it does not already exist.
Raises:
Type | Description |
---|---|
ValueError
|
If the database already exists. |
Returns: None
Source code in src/AnnSQL/MakeDb.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
validate_params()
Validates the parameters required for creating a database.
Raises:
Type | Description |
---|---|
ValueError
|
If |
ValueError
|
If |
ValueError
|
If |
Source code in src/AnnSQL/MakeDb.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|