Manager.database_management.DatabaseManagement

Usage

Source

Manager.database_management.DatabaseManagement(
    config_file, proj_mana=ProjectManagement, **kwargs
)

Methods

Name Description
NCBI() A strategy that implements all of the databases relevant to NCBI.
NCBI_blast() A strategy that implements all of the data relevant to NCBI’s blast databases.
NCBI_pub_taxonomy() A strategy that sets up windowmasker files used with the blast+ command line utilities.
NCBI_refseq_release() Build RefSeq download, taxonomy, and archive actions.
__init__() This class creates higher level functionality for configuring various databases. It uses a YAML configuration
full() The most generalized strategy available. This configures everything. The 3 primary flags (configure, archive,
get_strategy_dispatcher() Loop through a dictionary of strategies with nested configurations, and return a list of functions, and a
ncbi_blast_db() A strategy that implements NCBI’s blast database that’s used with the blast+ command line utilities.
ncbi_blast_windowmasker_files() A strategy that sets up windowmasker files used with the blast+ command line utilities.

NCBI()

A strategy that implements all of the databases relevant to NCBI.

Usage

Source

NCBI(
    NCBI_blast,
    NCBI_pub_taxonomy,
    NCBI_refseq_release,
    configure_flag=None,
    archive_flag=None,
    delete_flag=None,
    database_path=None,
    archive_path=None,
    _path=None
)
Parameters
NCBI_blast: dict[str, Any]

Keyword arguments for the generalized NCBI_blast strategy.

NCBI_pub_taxonomy: dict[str, Any]

Keyword arguments for the specific NCBI_pub_taxonomy strategy.

NCBI_refseq_release: dict[str, Any]

Keyword arguments for the specific NCBI_refseq_release strategy.

configure_flag: bool | None = None

A generalized flag that is passed to the NCBI strategies in order to implement their configuration process.

archive_flag: bool | None = None

A generalized flag that is passed to to the NCBI strategies in order to implement their archiving process.

delete_flag: bool | None = None

A generalized flag that is passed to the NCBI strategies in order to implement their deletion process.

database_path: str | Path | None = None

User supplied relative path to the databases.

archive_path: str | Path | None = None
User supplied relative path to the archived databases.
Returns
tuple.
A tuple containing 2 objects: a list of function (NCBI_blast, NCBI_pub_taxonomy, and NCBI_refseq_release), and a list of dictionaries containing kwargs for each function.

NCBI_blast()

A strategy that implements all of the data relevant to NCBI’s blast databases.

Usage

Source

NCBI_blast(
    NCBI_blast_db,
    NCBI_blast_windowmasker_files,
    configure_flag=None,
    archive_flag=None,
    delete_flag=None,
    database_path=None,
    archive_path=None,
    _path=None
)
Parameters
NCBI_blast_db: dict[str, Any]

Keyword arguments for the generalized NCBI_blast_db strategy.

NCBI_blast_windowmasker_files: dict[str, Any]

Keyword arguments for the generalized NCBI_blast_windowmasker_files strategy.

configure_flag: bool | None = None

A flag that is passed to the NCBI strategies in order to implement their configuration process.

archive_flag: bool | None = None

A flag that is passed to to the NCBI strategies in order to implement their archiving process.

delete_flag: bool | None = None

A flag that is passed to the NCBI strategies in order to implement their deletion process.

database_path: str | Path | None = None

User supplied relative path to the databases.

archive_path: str | Path | None = None
User supplied relative path to the archived databases.
Returns
tuple.
A tuple containing 2 objects: a list of function (NCBI_blast_db, and NCBI_blast_windowmasker_files), and a list of dictionaries containing kwargs for each function.

NCBI_pub_taxonomy()

A strategy that sets up windowmasker files used with the blast+ command line utilities.

Usage

Source

NCBI_pub_taxonomy(
    configure_flag=None,
    archive_flag=None,
    delete_flag=None,
    archive_path=None,
    database_path=None,
    _path=None
)
Parameters
configure_flag: bool | None = None

A flag that updates NCBI’s taxonomy dump files.

archive_flag: bool | None = None

A flag that archives NCBI’s taxonomy dump files.

delete_flag: bool | None = None

A flag that deletes NCBI’s taxonomy dump files.

database_path: str | Path | None = None

User supplied relative path to the databases.

archive_path: str | Path | None = None
User supplied relative path to the archived databases.
Returns
tuple.
A tuple containing 2 objects: a list of functions for downloading NCBI’s taxdum.tar.gz, and a list of dictionaries containing kwargs for each function.

NCBI_refseq_release()

Build RefSeq download, taxonomy, and archive actions.

Usage

Source

NCBI_refseq_release(
    configure_flag=None,
    archive_flag=None,
    delete_flag=None,
    upload_flag=None,
    archive_path=None,
    database_path=None,
    collection_subset=None,
    seqtype=None,
    seqformat=None,
    file_list=None,
    upload_number=8,
    _path=None,
    activate=None,
    template_flag=None,
    download_flag=None,
    pbs_dict=None
)

The scheduler-backed BioSQL upload workflow has been retired. Its legacy arguments remain temporarily so existing configurations receive an explicit deprecation error instead of failing during argument parsing.

Parameters
configure_flag: bool | None = None

A flag that downloads refseq release files from NCBI.

archive_flag: bool | None = None

A flag that archives refseq release files from NCBI.

delete_flag: bool | None = None

A flag that deletes refseq release files from NCBI.

upload_flag: bool | None = None

A retired flag that now raises a deprecation error.

database_path: str | Path | None = None

User-supplied relative path to the databases.

archive_path: str | Path | None = None

User-supplied relative path to the archived databases.

collection_subset: str | None = None

The collection subset of interest.

seqtype: str | None = None

The type of sequence (rna, protein, genomic).

seqformat: str | None = None

The sequence format, usually gbff for GenBank Flat File.

file_list: list[str] | None = None

A deprecated upload argument retained for compatibility.

upload_number: int = 8

A deprecated upload argument retained for compatibility.

activate: str | Path | None = None

A deprecated upload argument retained for compatibility.

template_flag: bool | None = None

A flag that loads a BioSQL database with NCBI taxonomy data.

download_flag: bool | None = None

A flag that downloads RefSeq release files from NCBI’s FTP site.

pbs_dict: dict[str, Any] | None = None
A deprecated upload argument retained for compatibility.
Returns
tuple.
Paired action and configuration mappings for RefSeq data.

__init__()

This class creates higher level functionality for configuring various databases. It uses a YAML configuration

Usage

Source

__init__(config_file, proj_mana=ProjectManagement, **kwargs)

file to parse various database setup “strategies” and dispatches or serializes the setup functions in the proper order. The strategies range from very general (“Full”, “NCBI”, etc.) to very specific (“NCBI_blast_db”, “NCBI_refseq_release”, etc.). Each strategy has 3 separate flags (configure, archive, and delete). Specific strategies may also have other flags or parameters that control their behavior.

Parameters
config_file: str.

The path to a YAML configuration file. See databases.yml in the package config folder.

proj_mana: ProjectManagement. = ProjectManagement

A configuration variable for connecting projects.

kwargs: dict. = {}
Key-word arguments.

full()

The most generalized strategy available. This configures everything. The 3 primary flags (configure, archive,

Usage

Source

full(
    NCBI,
    ITIS,
    Projects=None,
    configure_flag=None,
    archive_flag=None,
    delete_flag=None,
    project_flag=None,
    _path=None
)

and delete) will be passed down to the more specific strategies, which will inherit these values unless expressly overridden.

Parameters
NCBI: dict.

Keyword arguments for the generalized NCBI strategy.

ITIS: dict.

Keyword arguments for the generalized ITIS strategy.

configure_flag: bool. = None

A generalized flag that is passed to all of the strategies in order to implement their configuration process.

archive_flag: bool. = None

A generalized flag that is passed to all of the strategies in order to implement their archiving process.

delete_flag: bool. = None

A generalized flag that is passed to all of the strategies in order to implement their deletion process.

_path=None
Returns
tuple.
A tuple containing 2 objects: a list of function (NCBI and ITIS), and a list of dictionaries containing kwargs for each function. In the future Projects will also be returned.

get_strategy_dispatcher()

Loop through a dictionary of strategies with nested configurations, and return a list of functions, and a

Usage

Source

get_strategy_dispatcher(db_config_strategy)

list of matching key-word arguments (dictionaries). The functions can then be dispatched using the kwargs. Higher level more generalized workflows will have lists nested within dictionaries.

Parameters
db_config_strategy: dict[str, dict[str, Any]]
A dictionary usually generated from a YAML configuration file.
Returns
tuple.
A tuple containing 2 objects: a list of functions, and a list of dictionaries containing kwargs for each function.

ncbi_blast_db()

A strategy that implements NCBI’s blast database that’s used with the blast+ command line utilities.

Usage

Source

ncbi_blast_db(
    configure_flag=None,
    archive_flag=None,
    delete_flag=None,
    archive_path=None,
    database_path=None,
    _path=None
)
Parameters
configure_flag: bool | None = None

A flag for configuring the blast database for NCBI’s blast+ tool.

archive_flag: bool | None = None

A flag for archiving the blast database for NCBI’s blast+ tool.

delete_flag: bool | None = None

A flag for deleting the blast database for NCBI’s blast+ tool.

database_path: str | Path | None = None

User supplied relative path to the databases.

archive_path: str | Path | None = None
User supplied relative path to the archived databases.
Returns
tuple.
A tuple containing 2 objects: a list of functions for dealing with NCBI’s blast database, and a list of dictionaries containing kwargs for each function.

ncbi_blast_windowmasker_files()

A strategy that sets up windowmasker files used with the blast+ command line utilities.

Usage

Source

ncbi_blast_windowmasker_files(
    taxonomy_ids,
    configure_flag=None,
    archive_flag=None,
    delete_flag=None,
    archive_path=None,
    database_path=None,
    _path=None
)
Parameters
configure_flag: bool | None = None

A flag for configuring the windowmasker files for blast+.

archive_flag: bool | None = None

A flag for archiving the windowmasker files for blast+.

delete_flag: bool | None = None

A flag for deleting the windowmasker files for blast+.

database_path: str | Path | None = None

User supplied relative path to the databases.

archive_path: str | Path | None = None
User supplied relative path to the archived databases.
Returns
tuple.
A tuple containing 2 objects: a list of functions for dealing with windowmasker files, and a list of dictionaries containing kwargs for each function.