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

Class DifferentialSchemaFitness

source code

Calculate fitness for schemas that differentiate between sequences.

Instance Methods [hide private]
 
__init__(self, positive_seqs, negative_seqs, schema_evaluator)
Initialize with different sequences to evaluate
source code
 
calculate_fitness(self, genome)
Calculate the fitness for a given schema.
source code
Method Details [hide private]

__init__(self, positive_seqs, negative_seqs, schema_evaluator)
(Constructor)

source code 

Initialize with different sequences to evaluate

Arguments:

o positive_seq - A list of SeqRecord objects which are the 'positive' sequences -- the ones we want to select for.

o negative_seq - A list of SeqRecord objects which are the 'negative' sequences that we want to avoid selecting.

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

calculate_fitness(self, genome)

source code 

Calculate the fitness for a given schema.

Fitness is specified by the number of occurances of the schema in the positive sequences minus the number of occurances in the negative examples.

This fitness is then modified by multiplying by the length of the schema and then dividing by the number of ambiguous characters in the schema. This helps select for schema which are longer and have less redundancy.