| Trees | Indices | Help |
|
|---|
|
|
UserDict.DictMixin --+
|
_IndexedSeqFileDict
Read only dictionary interface to a sequential sequence file. Keeps the keys and associated file offsets in memory, reads the file to access entries as SeqRecord objects using Bio.SeqIO for parsing them. This approach is memory limited, but will work even with millions of sequences. Note - as with the Bio.SeqIO.to_dict() function, duplicate keys (record identifiers by default) are not allowed. If this happens, a ValueError exception is raised. By default the SeqRecord's id string is used as the dictionary key. 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 Fri Feb 24 13:49:15 2012 | http://epydoc.sourceforge.net |