BLAST Database#
Reader#
- class pyncbitk.objtools.DatabaseReader#
A reader over the contents of a BLAST database.
This class implements access to the BLAST database as a
MappingofSeqIdobjects toBioSeqobjects.- classmethod __new__(*args, **kwargs)#
- __getitem__(key, /)#
Return self[key].
- __init__(name, type=None)#
Create a new reader for a database of the given name.
- Parameters:
name (
stroros.PathLike) – The name of the database, as given when the database was created.type (
strorNone) – The type of sequences in the database, eithernucleotideorprotein. IfNonegiven, the database type will be detected from the metadata.
- __iter__()#
Implement iter(self).
- __len__()#
Return len(self).
- __reduce__()#
Helper for pickle.
- keys()#
Get a set-like view over the keys of the database.
- Returns:
DatabaseKeys– The keys of the database, i.e. theSeqIdof the sequences stored in the database.
- values()#
Get a set-like view over the values of the database.
- Returns:
DatabaseValues– The values of the database, i.e. theBioSeqstoring the sequences in the database.
- class pyncbitk.objtools.DatabaseKeys#
A set-like view over the keys of a BLAST database.
- classmethod __new__(*args, **kwargs)#
- __contains__(key, /)#
Return bool(key in self).
- __init__(*args, **kwargs)#
- __iter__()#
Implement iter(self).
- __len__()#
Return len(self).
- __reduce__()#
Helper for pickle.
- class pyncbitk.objtools.DatabaseValues#
A set-like view over the values of a BLAST database.
- classmethod __new__(*args, **kwargs)#
- __contains__(key, /)#
Return bool(key in self).
- __init__(*args, **kwargs)#
- __iter__()#
Implement iter(self).
- __len__()#
Return len(self).
- __reduce__()#
Helper for pickle.
Writer#
- class pyncbitk.objtools.DatabaseWriter#
A handle allowing to write sequences to a BLAST database.
- classmethod __new__(*args, **kwargs)#
- __init__(name, type='nucleotide', *, title=None, version=4)#
Create a new database writer.
- __reduce__()#
Helper for pickle.
- append(sequence)#
Add a sequence to the database.
- Parameters:
sequence (
BioSeq) – The sequence to add to the database.
- close()#
Close the database and write the remaining buffered sequences.