| Trees | Indices | Help |
|
|---|
|
|
UserDict.DictMixin --+
|
_IndexedSeqFileDict
Read only dictionary interface to a sequential record file. This code is used in both Bio.SeqIO for indexing as SeqRecord objects, and in Bio.SearchIO for indexing QueryResult objects. Keeps the keys and associated file offsets in memory, reads the file to access entries as objects parsing them on demand. This approach is memory limited, but will work even with millions of records. Note duplicate keys are not allowed. If this happens, a ValueError exception is raised. As used in Bio.SeqIO, by default the SeqRecord's id string is used as the dictionary key. In Bio.SearchIO, the query's id string is used. This can be changed by suppling an optional key_function, a callback function which will be given the record id and must return the desired key. For example, this allows you to parse NCBI style FASTA identifiers, and extract the GI number to use as the dictionary key. Note that this dictionary is essentially read only. You cannot add or change values, pop values, nor clear the dictionary.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
D[k] if k in D, else d |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
|
How many records are there?
|
Iterate over the SeqRecord) items.
|
Iterate over the (key, SeqRecord) items.
|
Iterate over the keys.
|
Would be a list of the (key, SeqRecord) tuples, but not implemented. In general you can be indexing very very large files, with millions of sequences. Loading all these into memory at once as SeqRecord objects would (probably) use up all the RAM. Therefore we simply don't support this dictionary method.
|
Would be a list of the SeqRecord objects, but not implemented. In general you can be indexing very very large files, with millions of sequences. Loading all these into memory at once as SeqRecord objects would (probably) use up all the RAM. Therefore we simply don't support this dictionary method.
|
Iterate over the keys.
|
d defaults to None.
|
Similar to the get method, but returns the record as a raw string. If the key is not found, a KeyError exception is raised. Note that on Python 3 a bytes string is returned, not a typical unicode string. NOTE - This functionality is not supported for every file format. |
Would allow adding more values, but not implemented.
|
Would remove specified record, but not implemented.
|
Would remove and return a SeqRecord, but not implemented.
|
Would clear dictionary, but not implemented.
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Tue Feb 5 17:59:51 2013 | http://epydoc.sourceforge.net |