## Manager.database_management.BaseDatabaseManagement


Usage

``` python
Manager.database_management.BaseDatabaseManagement(
    email,
    driver,
    project=None,
    project_path=None,
    proj_mana=None,
    blast=False,
    ftp_flag=True
)
```


## Methods

| Name | Description |
|----|----|
| [__init__()](#__init__) | This is the base class for managing various databases. It provides functionality for downloading and creating |
| [copy_biosql_taxonomy_template()](#copy_biosql_taxonomy_template) | Copy a BioSQL template database loaded with NCBI's taxonomy data. |
| [create_biosql_taxonomy_template()](#create_biosql_taxonomy_template) | Creates a template database by uploading SQLite schema and NCBI taxonomy. |
| [download_blast_database()](#download_blast_database) | Download the blast database files for using NCBI's BLAST+ command line. |
| [download_ete3_taxonomy_database()](#download_ete3_taxonomy_database) | Update ETE3's taxonomy database with ETE3's API. |
| [download_ncbi_taxonomy_dump_files()](#download_ncbi_taxonomy_dump_files) | Download and extract the NCBI taxonomy dump files via a GET request. |
| [download_refseq_release_files()](#download_refseq_release_files) | Download NCBI Refseq Release files from NCBI. The collection subtype is a species group |
| [download_windowmasker_files()](#download_windowmasker_files) | Download the WindowMasker files used in the BLAST database. |
| [get_project_genbank_database()](#get_project_genbank_database) |  |
| [upload_refseq_release_files()](#upload_refseq_release_files) | Upload NCBI's Refseq Release files to a BioSQL database. |

------------------------------------------------------------------------


#### \_\_init\_\_()


This is the base class for managing various databases. It provides functionality for downloading and creating


Usage

``` python
__init__(
    email,
    driver,
    project=None,
    project_path=None,
    proj_mana=None,
    blast=False,
    ftp_flag=True
)
```


various databases for your pipeline. There are functions available for downloading files from NCBI (BLAST, windowmasker, taxonomy, refseq release), downloading ITIS taxonomy tables, and creating BioSQL databases. This class currently REQUIRES an instance of ProjectManagement to be used with the proj_mana parameter.


##### Parameters


`email: str`  
The email of the user for using during the FTP.

`driver: str`  
The driver used for creating the BioSQL databases.

`project: str | None = None`  
The name of the project.

`project_path: str | Path | None = None`  
A path used for standalone/basic project configuration.

`proj_mana: ProjectManagement | None = None`  
A configuration variable for connecting projects.

`blast: bool = ``False`  
Flag for BLAST-related database operations.

`ftp_flag: bool = ``True`  
A flag used if FTP connection is available or not.


------------------------------------------------------------------------


#### copy_biosql_taxonomy_template()


Copy a BioSQL template database loaded with NCBI's taxonomy data.


Usage

``` python
copy_biosql_taxonomy_template(destination, database_name)
```


##### Parameters


`destination: str.`  
Where the template will be copied to.

`database_name: str.`  
The name of the copied database.


------------------------------------------------------------------------


#### create_biosql_taxonomy_template()


Creates a template database by uploading SQLite schema and NCBI taxonomy.


Usage

``` python
create_biosql_taxonomy_template()
```


------------------------------------------------------------------------


#### download_blast_database()


Download the blast database files for using NCBI's BLAST+ command line.


Usage

``` python
download_blast_database(database_name="refseq_rna", v5=True, set_blastdb=True)
```


For other types of blast data, please see the NCBIREADME.md file.


##### Parameters


`database_name: (str, optional) = ``"refseq_rna"`  
A string that represents a pattern in the files of interest, defaults to "refseq_rna"

`v5: (bool, optional) = ``True`  
A flag that determines which version of blastdb to use, defaults to True

`set_blastdb: (bool, optional) = ``True`  
A flag that determines whether the BLASTDB environment variable is automatically set.


------------------------------------------------------------------------


#### download_ete3_taxonomy_database()


Update ETE3's taxonomy database with ETE3's API.


Usage

``` python
download_ete3_taxonomy_database()
```


------------------------------------------------------------------------


#### download_ncbi_taxonomy_dump_files()


Download and extract the NCBI taxonomy dump files via a GET request.


Usage

``` python
download_ncbi_taxonomy_dump_files(
    url="ftp://ftp.ncbi.nlm.nih.gov/pub/taxonomy/taxdump.tar.gz"
)
```


##### Parameters


`url: str. = ``"ftp://ftp.ncbi.nlm.nih.gov/pub/taxonomy/taxdump.tar.gz"`  
A ftp link to the NCBI taxdump\*.tar.gz file of interest.


------------------------------------------------------------------------


#### download_refseq_release_files()


Download NCBI Refseq Release files from NCBI. The collection subtype is a species group


Usage

``` python
download_refseq_release_files(collection_subset, seqtype, seqformat)
```


(e.g. vertebrate_mammalian) of interest.


##### Parameters


`collection_subset: str.`  
The collection subset of interest.

`seqtype: str.`  
The type of sequence (RNA, protein, genomic).

`seqformat: str.`  
The format of the sequence file (usually 'gbff' for GenBank Flat File).


##### Returns


`list.`  
A list of files to download from NCBI via FTP.


------------------------------------------------------------------------


#### download_windowmasker_files()


Download the WindowMasker files used in the BLAST database.


Usage

``` python
download_windowmasker_files(taxonomy_ids)
```


##### Parameters


`taxonomy_ids: list.`  
Taxonomy ids for the organisms of interest.


------------------------------------------------------------------------


#### get_project_genbank_database()


Usage

``` python
get_project_genbank_database()
```


------------------------------------------------------------------------


#### upload_refseq_release_files()


Upload NCBI's Refseq Release files to a BioSQL database.


Usage

``` python
upload_refseq_release_files(
    collection_subset,
    seqtype,
    seqformat,
    upload_list=None,
    database_name=None,
    add_to_default=None
)
```


##### Parameters


`collection_subset: str.`  
The collection subset of interest.

`seqtype: str.`  
The type of sequence (RNA, protein, genomic).

`seqformat: str.`  
The format of the sequence file (usually 'gbff' for GenBank Flat File).

`upload_list: list. = None`  
A list of files to upload.

`database_name: str. = None`  
The name of the database to create. The default name is usually best.

`add_to_default: str. = None`  
A string to add to the default name.
