Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_GAMutation.TestMutator Class Reference

List of all members.

Public Member Functions

def __init__
def mutate

Public Attributes

 type

Detailed Description

Provide basic mutator ability.

Definition at line 117 of file test_GAMutation.py.


Constructor & Destructor Documentation

Definition at line 120 of file test_GAMutation.py.

00120 
00121     def __init__(self):
00122         self.type = "lower"


Member Function Documentation

def test_GAMutation.TestMutator.mutate (   self,
  org 
)

Definition at line 123 of file test_GAMutation.py.

00123 
00124     def mutate(self, org):
00125         org_genome_seq = org.genome.toseq()
00126         old_org_genome = org_genome_seq.tostring()
00127         
00128         new_org = org.copy()
00129         
00130         if self.type == "same":
00131             return new_org
00132         elif self.type == "lower":
00133             new_org.genome = MutableSeq(str(int(old_org_genome) - 1),
00134                                         org_genome_seq.alphabet)
00135             return new_org
00136         elif self.type == "higher":
00137             new_org.genome = MutableSeq(str(int(old_org_genome) + 1),
00138                                         org_genome_seq.alphabet)
00139             return new_org
00140         else:
00141             raise ValueError("Got type %s" % self.type)


Member Data Documentation

Definition at line 121 of file test_GAMutation.py.


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