Back to index

python-biopython  1.60
Public Member Functions | Private Attributes
Bio.NeuralNetwork.Gene.Schema.RandomMotifGenerator Class Reference

List of all members.

Public Member Functions

def __init__
def random_motif

Private Attributes

 _alphabet
 _min_size
 _max_size

Detailed Description

Generate a random motif within given parameters.

Definition at line 364 of file Schema.py.


Constructor & Destructor Documentation

def Bio.NeuralNetwork.Gene.Schema.RandomMotifGenerator.__init__ (   self,
  alphabet,
  min_size = 12,
  max_size = 17 
)
Initialize with the motif parameters.

Arguments:

o alphabet - An alphabet specifying what letters can be inserted in
a motif.

o min_size, max_size - Specify the range of sizes for motifs.

Definition at line 367 of file Schema.py.

00367 
00368     def __init__(self, alphabet, min_size = 12, max_size = 17):
00369         """Initialize with the motif parameters.
00370 
00371         Arguments:
00372 
00373         o alphabet - An alphabet specifying what letters can be inserted in
00374         a motif.
00375 
00376         o min_size, max_size - Specify the range of sizes for motifs.
00377         """
00378         self._alphabet = alphabet
00379         self._min_size = min_size
00380         self._max_size = max_size

Here is the caller graph for this function:


Member Function Documentation

Create a random motif within the given parameters.

This returns a single motif string with letters from the given
alphabet. The size of the motif will be randomly chosen between
max_size and min_size.

Definition at line 381 of file Schema.py.

00381 
00382     def random_motif(self):
00383         """Create a random motif within the given parameters.
00384         
00385         This returns a single motif string with letters from the given
00386         alphabet. The size of the motif will be randomly chosen between
00387         max_size and min_size.
00388         """
00389         motif_size = random.randrange(self._min_size, self._max_size)
00390 
00391         motif = ""
00392         for letter_num in range(motif_size):
00393             cur_letter = random.choice(self._alphabet.letters)
00394             motif += cur_letter
00395 
00396         return MutableSeq(motif, self._alphabet)


Member Data Documentation

Definition at line 377 of file Schema.py.

Definition at line 379 of file Schema.py.

Definition at line 378 of file Schema.py.


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