File: Point.py

package info (click to toggle)
python-biopython 1.42-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 17,584 kB
  • ctags: 12,272
  • sloc: python: 80,461; xml: 13,834; ansic: 7,902; cpp: 1,855; sql: 1,144; makefile: 203
file content (27 lines) | stat: -rw-r--r-- 798 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Perform two-point crossovers between the genomes of two organisms.

This module performs single-point crossover between two genomes.

SinglePointCrossover:
genome 1 --       A B C*D E F
genome 2 --       a b c*d e f

new genome 1 --   A B C d e f
new genome 2 --   a b c D E F

"""
# standard modules
from GeneralPoint import TwoCrossover

class SinglePointCrossover(TwoCrossover):
    """Perform point crossover between genomes at some defined rate.

    This performs a crossover between two genomes at some defined 
    frequency.  Length of genome is preserved, as the crossover 
    point is the same for either genome.
    """
    def __init__(self, crossover_prob = .1):
	"""Initialize to do crossovers at the specified probability.
	"""
	TwoCrossover.__init__(self, 1, crossover_prob)