Back to index

python-biopython  1.60
Point.py
Go to the documentation of this file.
00001 """Perform two-point crossovers between the genomes of two organisms.
00002 
00003 This module performs single-point crossover between two genomes.
00004 
00005 SinglePointCrossover:
00006 genome 1 --       A B C*D E F
00007 genome 2 --       a b c*d e f
00008 
00009 new genome 1 --   A B C d e f
00010 new genome 2 --   a b c D E F
00011 
00012 """
00013 # standard modules
00014 from GeneralPoint import TwoCrossover
00015 
00016 class SinglePointCrossover(TwoCrossover):
00017     """Perform point crossover between genomes at some defined rate.
00018 
00019     This performs a crossover between two genomes at some defined 
00020     frequency.  Length of genome is preserved, as the crossover 
00021     point is the same for either genome.
00022     """
00023     def __init__(self, crossover_prob = .1):
00024         """Initialize to do crossovers at the specified probability.
00025         """
00026         TwoCrossover.__init__(self, 1, crossover_prob)