Package jazzparser :: Package data :: Package db_mirrors :: Class SequenceIndex
[hide private]
[frames] | no frames]

Class SequenceIndex

source code

object --+
         |
        SequenceIndex

Stores indexes and provides quick access to mirrored sequences. Since we are not accessing the database directly, this provides a reasonably efficent alternative to doing a linear search through sequences every time when need one.

Iterating of a SequenceIndex instance will iterate over its sequences in order of id.

Instance Methods [hide private]
 
__init__(self, sequences)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_get_sequences(self) source code
 
prepare_indices(self) source code
 
sequence_by_id(self, id) source code
 
_get_ids(self) source code
 
__len__(self) source code
 
sequence_by_index(self, index) source code
 
id_for_index(self, index) source code
 
index_for_id(self, id)
Get the index in the sequence file of the sequence with the given id.
source code
 
__iter__(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
from_file(filename) source code
Properties [hide private]
  sequences
  ids

Inherited from object: __class__

Method Details [hide private]

__init__(self, sequences)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

index_for_id(self, id)

source code 

Get the index in the sequence file of the sequence with the given id. Returns None if the id isn't in the sequence file.


Property Details [hide private]

sequences

Get Method:
_get_sequences(self)

ids

Get Method:
_get_ids(self)