Back to index

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

List of all members.

Public Member Functions

def __repr__
def contains

Static Public Attributes

 size = None
 letters = None

Private Member Functions

def _case_less
def _upper
def _lower

Detailed Description

Definition at line 13 of file __init__.py.


Member Function Documentation

Definition at line 21 of file __init__.py.

00021 
00022     def __repr__(self):
00023         return self.__class__.__name__ + "()"

def Bio.Alphabet.Alphabet._case_less (   self) [private]
Return an case-less variant of the current alphabet (PRIVATE).

Definition at line 33 of file __init__.py.

00033 
00034     def _case_less(self):
00035         """Return an case-less variant of the current alphabet (PRIVATE)."""
00036         #TODO - remove this method by dealing with things in subclasses?
00037         if isinstance(self, ProteinAlphabet):
00038             return generic_protein
00039         elif isinstance(self, DNAAlphabet):
00040             return generic_dna
00041         elif isinstance(self, NucleotideAlphabet):
00042             return generic_rna
00043         elif isinstance(self, NucleotideAlphabet):
00044             return generic_nucleotide
00045         elif isinstance(self, SingleLetterAlphabet):
00046             return single_letter_alphabet
00047         else:
00048             return generic_alphabet

Here is the caller graph for this function:

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

Definition at line 58 of file __init__.py.

00058 
00059     def _lower(self):
00060         """Return a lower case variant of the current alphabet (PRIVATE)."""
00061         if not self.letters or self.letters==self.letters.lower():
00062             #Easy case, no letters or already lower case!
00063             return self
00064         else:
00065             #TODO - Raise NotImplementedError and handle via subclass?
00066             return self._case_less()

Here is the call graph for this function:

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

Definition at line 49 of file __init__.py.

00049 
00050     def _upper(self):
00051         """Return an upper case variant of the current alphabet (PRIVATE)."""
00052         if not self.letters or self.letters==self.letters.upper():
00053             #Easy case, no letters or already upper case!
00054             return self
00055         else:
00056             #TODO - Raise NotImplementedError and handle via subclass?
00057             return self._case_less()

Here is the call graph for this function:

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

Returns a boolean.  This relies on the Alphabet subclassing
hierarchy only, and does not check the letters property.
This isn't ideal, and doesn't seem to work as intended
with the AlphabetEncoder classes.

Reimplemented in test_GACrossover.TestAlphabet.

Definition at line 24 of file __init__.py.

00024 
00025     def contains(self, other):
00026         """Does this alphabet 'contain' the other (OBSOLETE?).
00027 
00028         Returns a boolean.  This relies on the Alphabet subclassing
00029         hierarchy only, and does not check the letters property.
00030         This isn't ideal, and doesn't seem to work as intended
00031         with the AlphabetEncoder classes."""
00032         return isinstance(other, self.__class__)


Member Data Documentation

Bio.Alphabet.Alphabet.size = None [static]

Reimplemented in Bio.Alphabet.ThreeLetterProtein, and Bio.Alphabet.SingleLetterAlphabet.

Definition at line 14 of file __init__.py.


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