rotifer.db.ncbi.FastaCursor#
- class rotifer.db.ncbi.FastaCursor(readers=['easel', 'entrez'], writers=[], local_database_path=['/databases/fadb/nr/nr'], entrez_database='protein', progress=True, tries=3, sleep_between_tries=1, batch_size=None, threads=None, *args, **kwargs)[source]#
Bases:
SequenceCursor,SequentialDelegatorCursorFetch sequences from local FASTA files or NCBI, without annotations.
Sequences are retrieved as FASTA data, which is much faster than GenBank format but carries no annotation. By default a local
esl-sfetchindexed database is tried before NCBI Entrez.- Parameters:
- readerslist of str, default
['easel', 'entrez'] Backend reader modules, tried in order.
- writerslist of str, default []
Backend writer modules.
- local_database_pathlist of str, optional
Paths to local FASTA files indexed by
esl-sfetch. Defaults to thelocal_database_pathconfiguration entry.- entrez_databasestr, default ‘protein’
A valid NCBI sequence database name.
- progressbool, default True
Whether to print a progress bar.
- triesint, default 3
Number of attempts to download data.
- sleep_between_triesint, default 1
Number of seconds to wait between download attempts.
- batch_sizeint, optional
Number of accessions per batch.
- threadsint, optional
Number of simultaneous threads.
- readerslist of str, default
See also
SequenceCursorslower download with full annotations
rotifer.db.local.easel.FastaCursorthe local backend
rotifer.db.ncbi.entrez.FastaCursorthe remote backend
Examples
>>> from rotifer.db import ncbi >>> fc = ncbi.FastaCursor() >>> seqrec = fc.fetchall("YP_009724395.1")