Package Bio :: Package NeuralNetwork :: Package Gene :: Module Schema :: Class GeneticAlgorithmFinder
[hide private]
[frames] | no frames]

Class GeneticAlgorithmFinder

source code

object --+
         |
        GeneticAlgorithmFinder

Find schemas using a genetic algorithm approach.

This approach to finding schema uses Genetic Algorithms to evolve a set of schema and find the best schema for a specific set of records.

The 'default' finder searches for ambiguous DNA elements. This can be overridden easily by creating a GeneticAlgorithmFinder with a different alphabet.

Instance Methods [hide private]
 
__init__(self, alphabet=SchemaDNAAlphabet())
Initialize a finder to get schemas using Genetic Algorithms.
source code
 
_set_up_genetic_algorithm(self)
Overrideable function to set up the genetic algorithm parameters.
source code
 
find_schemas(self, fitness, num_schemas)
Find the given number of unique schemas using a genetic algorithm
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, alphabet=SchemaDNAAlphabet())
(Constructor)

source code 

Initialize a finder to get schemas using Genetic Algorithms.

Arguments:

o alphabet -- The alphabet which specifies the contents of the schemas we'll be generating. This alphabet must contain the attribute 'alphabet_matches', which is a dictionary specifying the potential ambiguities of each letter in the alphabet. These ambiguities will be used in building up the schema.

Overrides: object.__init__

_set_up_genetic_algorithm(self)

source code 

Overrideable function to set up the genetic algorithm parameters.

This functions sole job is to set up the different genetic algorithm functionality. Since this can be quite complicated, this allows cusotmizablity of all of the parameters. If you want to customize specially, you can inherit from this class and override this function.

find_schemas(self, fitness, num_schemas)

source code 

Find the given number of unique schemas using a genetic algorithm

Arguments:

o fitness - A callable object (ie. function) which will evaluate the fitness of a motif.

o num_schemas - The number of unique schemas with good fitness that we want to generate.