rotifer.db.ncbi#

Access NCBI sequence, genome and taxonomy data.

This package is the main entry point for retrieving data from the National Center for Biotechnology Information (NCBI). The cursors defined here are delegators: each one combines several backends (Entrez E-utilities, the NCBI FTP site, local genome mirrors, local indexed FASTA files, the ETE toolkit taxonomy database and SQLite3 stores) and tries them in order until every requested identifier is resolved.

Network, authentication and rate limits#

Entrez based backends send the user email registered in the configuration and honor the NCBI_API_KEY environment variable. Without an API key, NCBI limits clients to 3 requests per second and the Entrez backends restrict themselves to 3 simultaneous threads; with a key, up to 10 threads are used. FTP backends download files to the rotifer cache directory (rotifer.config['cache']).

Configuration#

The module level config dictionary is loaded from ~/.rotifer/etc/db/ncbi.yml when that file exists. Its keys include the Entrez email and API key, the FTP server address, the path of a local genome mirror and the mapping of backend names to reader and writer modules.

Functions

assemblies([baseurl, targets, taxonomy, ...])

Load a table documenting all NCBI genome assemblies.

Classes

FastaCursor([readers, writers, ...])

Fetch sequences from local FASTA files or NCBI, without annotations.

GeneNeighborhoodCursor([readers, writers, ...])

Fetch gene neighborhoods as dataframes.

GenomeCursor([readers, writers, progress, ...])

Fetch annotated genome sequences.

GenomeFeaturesCursor([readers, writers, ...])

Fetch genome annotation as feature tables.

IPGCursor([readers, writers, ...])

Fetch identical protein group (IPG) reports.

SequenceCursor([readers, writers, database, ...])

Fetch annotated sequences from NCBI.

TaxonomyCursor([readers, writers, progress, ...])

Fetch NCBI Taxonomy data as dataframes.