edu.uconn.mcb.lineageevolver
Class Genome

java.lang.Object
  extended byedu.uconn.mcb.lineageevolver.Genome
All Implemented Interfaces:
java.lang.Cloneable, Visitable

public class Genome
extends java.lang.Object
implements java.lang.Cloneable, Visitable

Model of Genomes, composed of a collection of Genes.

Author:
Hasan Khalil, Lina Pezzella

Nested Class Summary
 class Genome.NoHGTProcessed
          Exception thrown when hgt was not processed within a reasonable timeframe.
 
Field Summary
private  Gene[] _gneGenes
          The collection of genes in this genome.
private  int[] _intParalogs
          The number of paralogs per gene in this genome.
private  float[] _lakeCategories
          The values for Lake's ten categories.
static int DEFAULT_REVERSAL_DIST_MEAN
          Default mean of the distance from the origin of replication of a reversal event.
static int DEFAULT_REVERSAL_DIST_STDEV
          Default standard deviation of the distance from the origin of replication of a reversal event.
static int DEFAULT_REVERSAL_MEAN
          Default mean of the number of genes to be reversed.
static int DEFAULT_REVERSAL_STDEV
          Default standard deviation of the number of genes to be reversed.
static float DUPE_KILL_FREQ
          The number of substitutions to process before calling duplicate or kill gene.
static float[] LAKE_MUTATION_MEAN
          The mean (per category) percentages of mutation used when Lake Categories are mutated.
static float[] LAKE_MUTATION_STDEV
          The standard deviations (per category) for mutation percentages used when Lake Categories are mutated.
static float[] LAKE_PROBABILITIES
          The probability that each rate category will affect horizontal gene transfer.
static java.util.Random randomNumberGenerator
          Random number generator shared by all genomes.
private  int totalSubs
          The age of this genome, including the age of its ancestors, in the number of substitutions it has undergone.
 
Constructor Summary
Genome(java.lang.String[] sequences, float[][] substitutionProbabilities, float[] lakeCategories)
           
Genome(java.lang.String[] sequences, float[] evolutionSpeeds, float[][] substitutionProbabilities, float[] lakeCategories)
          Constructor for objects of type Genome.
 
Method Summary
protected  java.lang.Object clone()
           
 Gene duplicateGene()
          Duplicates the given gene within this genome and inserts it into this genome.
 void evolve(int intDistance)
          Induces evolution in this Genome by causing genes selected according to random calculations on the evolution speed of each gene to undergo 'evolution'.
 Gene getGene(int index)
          Returns the Gene at a given index in this Genome.
 float[] getGeneEvolutionSpeeds()
          Returns an array containing the evolution speeds for each gene in this Genome.
 float getLakeCategory(int index)
          Returns the lake category value specified.
 int getSize()
          Returns the number of genes in this genome.
 void hgt(Genome gnmSource)
          Selects the genes on which horizontal transfer will occur within this genome.
 void killGene(int intGeneIndex)
          Kills the given gene within this genome.
static void main(java.lang.String[] args)
          Driver for debugging/testing.
private static float[] makeEvolutionSpeeds(int count)
          Generates random evolution speeds between 0 and 1 (uniform distribution).
private  void mutateRateCategories()
          Mutate each of Lake's categories by adding a random value (positive or negative) to each.
 void printString()
          Similar to toString(), but also details each gene recursively, all printing to System.out as oppose to returning a string.
 void reversal()
          Processes reversal in this genome from either the origin or terminus of replication (applicable only to circular prokaryotic genomes).
 void symmetricReversal()
          Processes a reversal event such that the reversal is symmetric about the origin or terminus of replication.
 java.lang.String toString()
           
 void visit(Visitor v)
          Method to visit this visitable object with a visitor.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

randomNumberGenerator

public static final java.util.Random randomNumberGenerator
Random number generator shared by all genomes.


_gneGenes

private Gene[] _gneGenes
The collection of genes in this genome.


_intParalogs

private int[] _intParalogs
The number of paralogs per gene in this genome.


LAKE_PROBABILITIES

public static final float[] LAKE_PROBABILITIES
The probability that each rate category will affect horizontal gene transfer.


LAKE_MUTATION_MEAN

public static final float[] LAKE_MUTATION_MEAN
The mean (per category) percentages of mutation used when Lake Categories are mutated.


LAKE_MUTATION_STDEV

public static final float[] LAKE_MUTATION_STDEV
The standard deviations (per category) for mutation percentages used when Lake Categories are mutated.


DUPE_KILL_FREQ

public static final float DUPE_KILL_FREQ
The number of substitutions to process before calling duplicate or kill gene.

See Also:
Constant Field Values

totalSubs

private int totalSubs
The age of this genome, including the age of its ancestors, in the number of substitutions it has undergone.


_lakeCategories

private float[] _lakeCategories
The values for Lake's ten categories.


DEFAULT_REVERSAL_MEAN

public static final int DEFAULT_REVERSAL_MEAN
Default mean of the number of genes to be reversed.

See Also:
Constant Field Values

DEFAULT_REVERSAL_STDEV

public static final int DEFAULT_REVERSAL_STDEV
Default standard deviation of the number of genes to be reversed.

See Also:
Constant Field Values

DEFAULT_REVERSAL_DIST_MEAN

public static final int DEFAULT_REVERSAL_DIST_MEAN
Default mean of the distance from the origin of replication of a reversal event.

See Also:
Constant Field Values

DEFAULT_REVERSAL_DIST_STDEV

public static final int DEFAULT_REVERSAL_DIST_STDEV
Default standard deviation of the distance from the origin of replication of a reversal event.

See Also:
Constant Field Values
Constructor Detail

Genome

public Genome(java.lang.String[] sequences,
              float[] evolutionSpeeds,
              float[][] substitutionProbabilities,
              float[] lakeCategories)
Constructor for objects of type Genome.

Parameters:
sequences - An array containing sequences for each gene in this genome.
evolutionSpeeds - An array of evolution speeds corresponding to each of the genes in this genome.
substitutionProbabilities - An array of arrays of substitution probabilities for each site specified by the above sequences.
lakeCategories - An array containing each lake category float value, in order.

Genome

public Genome(java.lang.String[] sequences,
              float[][] substitutionProbabilities,
              float[] lakeCategories)
Parameters:
sequences -
substitutionProbabilities -
lakeCategories -
Method Detail

makeEvolutionSpeeds

private static float[] makeEvolutionSpeeds(int count)
Generates random evolution speeds between 0 and 1 (uniform distribution).

Parameters:
count - the number of speeds to generate.
Returns:
an array containing each generated speed.

evolve

public void evolve(int intDistance)
Induces evolution in this Genome by causing genes selected according to random calculations on the evolution speed of each gene to undergo 'evolution'. 'Evolution' consists of substitutions and mutation of Lake Categories.

Parameters:
intDistance - the number of substitutions along this branch.

mutateRateCategories

private void mutateRateCategories()
Mutate each of Lake's categories by adding a random value (positive or negative) to each.


killGene

public void killGene(int intGeneIndex)
Kills the given gene within this genome.

Parameters:
intGeneIndex - the index of the gene to kill.

duplicateGene

public Gene duplicateGene()
Duplicates the given gene within this genome and inserts it into this genome.

Returns:
the duplicate gene.

reversal

public void reversal()
Processes reversal in this genome from either the origin or terminus of replication (applicable only to circular prokaryotic genomes).


symmetricReversal

public void symmetricReversal()
Processes a reversal event such that the reversal is symmetric about the origin or terminus of replication.


hgt

public void hgt(Genome gnmSource)
         throws Genome.NoHGTProcessed
Selects the genes on which horizontal transfer will occur within this genome. TODO: Comment heavily here.

Parameters:
gnmSource - the source genome for horizontal transfer.
Throws:
Genome.NoHGTProcessed - If HGT was not processed.

getGeneEvolutionSpeeds

public float[] getGeneEvolutionSpeeds()
Returns an array containing the evolution speeds for each gene in this Genome.

Returns:
an array containing the evolution speeds for each gene in this Genome.

getGene

public Gene getGene(int index)
Returns the Gene at a given index in this Genome.

Parameters:
index - the index of the Gene to be returned.
Returns:
the Gene to be returned.

getLakeCategory

public float getLakeCategory(int index)
Returns the lake category value specified.

Parameters:
index - the numerical index of the category to return.
Returns:
the specified category value.

getSize

public int getSize()
Returns the number of genes in this genome.

Returns:
the number of genes in this genome.

clone

protected java.lang.Object clone()
See Also:
Object.clone()

toString

public java.lang.String toString()
See Also:
TODO: Comment exactly which details get outputted here.

main

public static void main(java.lang.String[] args)
Driver for debugging/testing.

Parameters:
args - Arguments are not used for this driver.

visit

public void visit(Visitor v)
Description copied from interface: Visitable
Method to visit this visitable object with a visitor.

Specified by:
visit in interface Visitable
Parameters:
v - the visitor with which to visit this visitable object.
See Also:
Visitable.visit(edu.uconn.mcb.lineageevolver.misc.Visitor)

printString

public void printString()
Similar to toString(), but also details each gene recursively, all printing to System.out as oppose to returning a string.