edu.uconn.mcb.lineageevolver
Class DiagonalRecombiner

java.lang.Object
  extended byedu.uconn.mcb.lineageevolver.Recombiner
      extended byedu.uconn.mcb.lineageevolver.DiagonalRecombiner

public class DiagonalRecombiner
extends Recombiner

Description of type goes here.

Author:
Hasan Khalil, Lina Pezzella

Nested Class Summary
 
Nested classes inherited from class edu.uconn.mcb.lineageevolver.Recombiner
Recombiner.NoRecombineRegion
 
Field Summary
 
Fields inherited from class edu.uconn.mcb.lineageevolver.Recombiner
_gneDestination, _gneSource, DEFAULT_RECOMBINE_MEAN, DEFAULT_RECOMBINE_PADDING, DEFAULT_RECOMBINE_STDEV, randomNumberGenerator
 
Constructor Summary
DiagonalRecombiner(Gene gneSource, Gene gneDestination)
          Default constructor for objects of type DiagonalRecombiner.
 
Method Summary
private  int findEnd(int target)
          Searches for matching regions between source and destination genes within a reasonable distance of the provided target region.
private  int findStart(int start, int end)
          Searches the source and destination genes between given start and end points for a matching region of length 6.
private  boolean isIdentical(int start, int distance)
          Determines if a given region is identical between both source and destination Genes.
 void recombine()
          Processes recombination between the source and destination genes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiagonalRecombiner

public DiagonalRecombiner(Gene gneSource,
                          Gene gneDestination)
Default constructor for objects of type DiagonalRecombiner.

See Also:
Recombiner.Recombiner(Gene, Gene)
Method Detail

recombine

public void recombine()
               throws Recombiner.NoRecombineRegion
Description copied from class: Recombiner
Processes recombination between the source and destination genes.

Specified by:
recombine in class Recombiner
Throws:
Recombiner.NoRecombineRegion - If no regioin suitable for recombination was found.
See Also:
Recombiner.recombine()

findStart

private int findStart(int start,
                      int end)
Searches the source and destination genes between given start and end points for a matching region of length 6.

Parameters:
start - the start point of the search.
end - the end point of the search.
Returns:
the start end point of the matching region of length 6, of -1 if none was found.

findEnd

private int findEnd(int target)
Searches for matching regions between source and destination genes within a reasonable distance of the provided target region.

Parameters:
target - the desired center for a matching sequence to be found.
Returns:
the start position of a matching segment of length DEFAULT_RECOMBINE_PADDING, or -1 if none was found within reasonable boundaries.
See Also:
Recombiner.DEFAULT_RECOMBINE_PADDING, Recombiner.DEFAULT_RECOMBINE_STDEV

isIdentical

private boolean isIdentical(int start,
                            int distance)
Determines if a given region is identical between both source and destination Genes.

Parameters:
start - the location to start checking identicality.
distance - the distance from the start location to stop checking identicality.
Returns:
true if both genes are identical for the specified stretch, false otherwise.