Methods
|
|
|
|
__eq__
|
__eq__ ( self, alph )
|
|
__hash__
|
__hash__ ( self )
|
|
__init__
|
__init__ ( self, listOfCharacters )
Creates an alphabet out of a listOfCharacters
@param listOfCharacters: a list of strings (single characters most of
the time), ints, or other objects that can be used as dictionary keys
for a mapping of the external sequences to the internal representation Note: Alphabets should be considered as imutable. That means the
listOfCharacters and the mapping should never be touched after
construction.
|
|
__len__
|
__len__ ( self )
|
|
__str__
|
__str__ ( self )
|
|
external
|
external ( self, internal )
Given an internal representation return the
external representation Note: the internal code -1 always represents a gap character -
Raises KeyError
Exceptions
|
|
KeyError, "Internal symbol " + str( internal ) + " not recognized."
|
|
|
externalSequence
|
externalSequence ( self, internalSequence )
Given a sequence with the internal representation return the
external representation
|
|
getExternalCharacterLength
|
getExternalCharacterLength ( self )
If all external characters are of the same length the length is
returned. Otherwise None.
@return: length of the external characters or None
|
|
internal
|
internal ( self, emission )
Given a emission return the internal representation
|
|
internalSequence
|
internalSequence ( self, emissionSequence )
Given a emission_sequence return the internal representation
Raises KeyError
|
|
isAdmissable
|
isAdmissable ( self, emission )
Check whether emission is admissable (contained in) the domain
|
|
size
|
size ( self )
Deprecated
|