rotifer.db.uniprot.BaseUniProtRecordCursor#

class rotifer.db.uniprot.BaseUniProtRecordCursor(readers=[], writers=[], progress=True, tries=None, batch_size=None, threads=None, *args, **kwargs)[source]#

Bases: SequentialDelegatorCursor

Shared behaviour of the UniProt delegators that fetch records.

This class is not meant to be used directly. It gives the cursors that fetch entries, rather than mappings between them, the two things BaseUniProtDelegatorCursor gives the mapping ones: a progress bar over the whole query instead of one per backend, and dictionary style access that stays quiet.

See also

rotifer.db.delegator.SequentialDelegatorCursor

the delegation logic

BaseUniProtDelegatorCursor

the same idea, for identifier mappings

__getitem__(accessions, *args, **kwargs)[source]#

Fetch records, dictionary style.

Equivalent to fetchall(), but quiet: a lookup is not a job worth watching.

Parameters:
accessionsstr or iterable of str

Database identifiers.

Returns:
The same value as fetchall().
fetchone(accessions, *args, **kwargs)[source]#

Iterate over records, trying each backend in turn.

Parameters:
accessionsstr or iterable of str

Database identifiers.

Yields:
Whatever the backend that found them produced.