Back to index

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

List of all members.

Public Member Functions

def setUp
def test_always_mutate
def test_never_mutate

Public Attributes


Static Public Attributes

int num_trials = 500

Detailed Description

Test mutations at a single position in a genome.

Definition at line 92 of file

Member Function Documentation

Definition at line 95 of file

00096     def setUp(self):
00097         genome = MutableSeq("1111", TestAlphabet())
00098         self.organism = Organism(genome, test_fitness)

Test ability to cause mutations.

Definition at line 99 of file

00100     def test_always_mutate(self):
00101         """Test ability to cause mutations.
00102         """
00103         mutator = SinglePositionMutation(mutation_rate = 1.0)
00105         # when we mutate randomly by chance, we expect to get 2/3
00106         # visible mutations (there are three letters in the alphabet and
00107         # one change cannot be observed since it is a mutation back to itself)
00108         expected_percent = .6
00110         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 111 of file

00112     def test_never_mutate(self):
00113         """Make sure we do not mutate at unexpected times.
00114         """
00115         mutator = SinglePositionMutation(mutation_rate = 0.0)
00116         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

Definition at line 97 of file

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