taxadb API reference¶
-
class
taxadb.taxadb.
TaxaDB
(**kwargs)[source]¶ Main TaxaDB package class
Parent class of the Taxadb application. Use this class to create inheriting classes.
Parameters: **kwargs – Arbitrary arguments. Supported (username, password, port, hostname, config, dbtype, dbname) Raises: AttributeError
– If cannot instantiate taxadb.schema.DatabaseFactory.-
MAX_LIST
¶ Maximum number of bind variables to pass to request methods. Due to SQLite limit of passed arguments to a statement, we limit number of accession and taxid to request to 999 (https://www.sqlite.org/c3ref/bind_blob.html)
Type: int
-
__weakref__
¶ list of weak references to the object (if defined)
-
_unmapped_taxid
(acc, do_exit=False)[source]¶ Prints error message to stderr if an accession number is not mapped with a taxid
Source ftp://ftp.ncbi.nlm.nih.gov/pub/taxonomy/accession2taxid/README >> If for some reason the source organism cannot be mapped to the taxonomy database, the column will contain 0.<<
Parameters: - acc (
str
) – Accession number not mapped with taxid - do_exit (
bool
) – Exit with code 1. Default False
- acc (
-
static
check_list_ids
(ids)[source]¶ Check the list of ids is not longer that MAX_LIST
Parameters: ids ( list
) – List of bind valuesReturns: True Raises: SystemExit
– If len of the list of greater than MAX_LIST.
-
check_table_exists
(table)[source]¶ Check a table exists in the database
Parameters: table ( str
) – Database table name to check.Returns: True Raises: SystemExit
– if table does not exist
-