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

Class MostCountSchemaFitness

source code

object --+
         |
        MostCountSchemaFitness

Calculate a fitness giving weight to schemas that match many times.

This fitness function tries to maximize schemas which are found many times in a group of sequences.

Instance Methods [hide private]
 
__init__(self, seq_records, schema_evaluator)
Initialize with sequences to evaluate.
source code
 
calculate_fitness(self, genome)
Calculate the fitness of a genome based on schema matches.
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, seq_records, schema_evaluator)
(Constructor)

source code 

Initialize with sequences to evaluate.

Arguments:

o seq_records -- A set of SeqRecord objects which we use to calculate the fitness.

o schema_evaluator - An Schema class which can be used to evaluate find motif matches in sequences.

Overrides: object.__init__

calculate_fitness(self, genome)

source code 

Calculate the fitness of a genome based on schema matches.

This bases the fitness of a genome completely on the number of times it matches in the set of seq_records. Matching more times gives a better fitness