Back to index

python-biopython  1.60
Public Member Functions | Public Attributes | Static Public Attributes
test_GAMutation.ConversionTest Class Reference
Inheritance diagram for test_GAMutation.ConversionTest:
Inheritance graph
[legend]
Collaboration diagram for test_GAMutation.ConversionTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def test_always_mutate
def test_never_mutate

Public Attributes

 organism

Static Public Attributes

int num_trials = 500

Detailed Description

Test mutation which just converts one gene in the chromosome.

Definition at line 64 of file test_GAMutation.py.


Member Function Documentation

Definition at line 67 of file test_GAMutation.py.

00067 
00068     def setUp(self):
00069         genome = MutableSeq("1111", TestAlphabet())
00070         self.organism = Organism(genome, test_fitness)

Test ability to cause mutations.

Definition at line 71 of file test_GAMutation.py.

00071 
00072     def test_always_mutate(self):
00073         """Test ability to cause mutations.
00074         """
00075         mutator = ConversionMutation(mutation_rate = 1.0)
00076 
00077         # when we mutate randomly by chance, we expect to get 2/3
00078         # visible mutations (there are three letters in the alphabet and
00079         # one change cannot be observed since it is a mutation back to itself)
00080         # For a four letter genome, the chance of being exactly the same
00081         # after mutations is about .01, so being better than 90% different
00082         # if a reasonable expectation.
00083         expected_percent = .9
00084 
00085         self._always_mutate(mutator, expected_percent)

Here is the call graph for this function:

Make sure we do not mutate at unexpected times.

Definition at line 86 of file test_GAMutation.py.

00086 
00087     def test_never_mutate(self):
00088         """Make sure we do not mutate at unexpected times.
00089         """
00090         mutator = ConversionMutation(mutation_rate = 0.0)
00091         self._never_mutate(mutator)

Here is the call graph for this function:


Member Data Documentation

int test_GAMutation.MutationHelper.num_trials = 500 [static, inherited]

Definition at line 32 of file test_GAMutation.py.

Definition at line 69 of file test_GAMutation.py.


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