Back to index

python-biopython  1.60
Public Member Functions | Public Attributes | Private Member Functions
Bio.Alphabet.HasStopCodon Class Reference
Inheritance diagram for Bio.Alphabet.HasStopCodon:
Inheritance graph
[legend]
Collaboration diagram for Bio.Alphabet.HasStopCodon:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __cmp__
def contains
def __getattr__
def __repr__

Public Attributes

 stop_symbol
 alphabet
 new_letters
 letters

Private Member Functions

def _upper
def _lower

Detailed Description

Definition at line 177 of file __init__.py.


Constructor & Destructor Documentation

def Bio.Alphabet.HasStopCodon.__init__ (   self,
  alphabet,
  stop_symbol = "*" 
)

Reimplemented from Bio.Alphabet.AlphabetEncoder.

Definition at line 178 of file __init__.py.

00178 
00179     def __init__(self, alphabet, stop_symbol = "*"):
00180         AlphabetEncoder.__init__(self, alphabet, stop_symbol)
00181         self.stop_symbol = stop_symbol
        

Here is the caller graph for this function:


Member Function Documentation

def Bio.Alphabet.HasStopCodon.__cmp__ (   self,
  other 
)

Definition at line 182 of file __init__.py.

00182 
00183     def __cmp__(self, other):
00184         x = cmp(self.alphabet, other.alphabet)
00185         if x == 0:
00186             return cmp(self.stop_symbol, other.stop_symbol)
00187         return x

def Bio.Alphabet.AlphabetEncoder.__getattr__ (   self,
  key 
) [inherited]

Definition at line 128 of file __init__.py.

00128 
00129     def __getattr__(self, key):
00130         if key[:2] == "__" and key[-2:] == "__":
00131             raise AttributeError(key)
00132         return getattr(self.alphabet, key)

def Bio.Alphabet.AlphabetEncoder.__repr__ (   self) [inherited]

Definition at line 133 of file __init__.py.

00133 
00134     def __repr__(self):
00135         return "%s(%r, %r)" % (self.__class__.__name__, self.alphabet,
00136                                self.new_letters)

def Bio.Alphabet.HasStopCodon._lower (   self) [private]
Return a lower case variant of the current alphabet (PRIVATE).

Reimplemented from Bio.Alphabet.AlphabetEncoder.

Definition at line 202 of file __init__.py.

00202 
00203     def _lower(self):
00204         """Return a lower case variant of the current alphabet (PRIVATE)."""
00205         return HasStopCodon(self.alphabet._lower(), self.stop_symbol.lower())
00206 

def Bio.Alphabet.HasStopCodon._upper (   self) [private]
Return an upper case variant of the current alphabet (PRIVATE).

Reimplemented from Bio.Alphabet.AlphabetEncoder.

Definition at line 198 of file __init__.py.

00198 
00199     def _upper(self):
00200         """Return an upper case variant of the current alphabet (PRIVATE)."""
00201         return HasStopCodon(self.alphabet._upper(), self.stop_symbol.upper())

def Bio.Alphabet.HasStopCodon.contains (   self,
  other 
)
Does this alphabet 'contain' the other (OBSOLETE?).

Returns a boolean.  This relies on the Alphabet subclassing
hierarchy, and attempts to check the stop symbol.  This fails
if the other alphabet does not have a stop symbol!

Reimplemented from Bio.Alphabet.AlphabetEncoder.

Definition at line 188 of file __init__.py.

00188 
00189     def contains(self, other):
00190         """Does this alphabet 'contain' the other (OBSOLETE?).
00191 
00192         Returns a boolean.  This relies on the Alphabet subclassing
00193         hierarchy, and attempts to check the stop symbol.  This fails
00194         if the other alphabet does not have a stop symbol!
00195         """
00196         return other.stop_symbol == self.stop_symbol and \
00197                self.alphabet.contains(other.alphabet)


Member Data Documentation

Definition at line 122 of file __init__.py.

Definition at line 125 of file __init__.py.

Definition at line 123 of file __init__.py.

Definition at line 180 of file __init__.py.


The documentation for this class was generated from the following file: