edu.uconn.mcb.lineageevolver
Class ASRVByteAAGene

java.lang.Object
  extended byedu.uconn.mcb.lineageevolver.ASRVByteAAGene
All Implemented Interfaces:
java.lang.Cloneable, Gene

public class ASRVByteAAGene
extends java.lang.Object
implements Gene

Gene implementation using ByteAminoAcid and Simple Among Site Rate Variation (ASRV).

Author:
Hasan Khalil, Lina Pezzella

Field Summary
private  ByteAminoAcid[] _aaAminoAcid
          The sequence of amino acids that make up this gene.
private  float _fltEvolutionSpeed
          The speed with which this gene evolves.
 int _id
          The ID number for this gene.
 int _paralogID
          The paralog ID number for this gene.
private static SubstitutionMatrix _smtrx
          The currently employed substitution matrix for this gene.
private  int _totalSubs
          The number of substitutions processed in this gene.
static int ASRV_MUT_FREQ
          The number of substitutions undergone before each ASRV mutation.
static int ASRV_MUTLENGTH_MEAN
          The average length of sites that mutate their substitution rates in a given mutation event.
static int ASRV_MUTLENGTH_STDEV
          The standard deviation of sites that mutate their substitution rates in a given mutation event.
static int DEFAULT_GENESIZE
          Default size for a gene in number of amino acids.
static float DUPLICATE_EVOLSPEED_FACTOR
          The factor by which to increase the fltEvolutionSpeed of a newly duplicated gene.
static float EVOLRATE_MUTATION_MEAN
          The average rate at which this gene's fltEvolutionSpeed mutations.
static float EVOLRATE_MUTATION_STDEV
          The standard deviation for this gene's fltEvolutionSpeed mutation.
static java.util.Random randomNumberGenerator
          Random number generator shared by all gen1es.
 
Constructor Summary
  ASRVByteAAGene()
          Default constructor for objects of type ASRVByteAAGene.
private ASRVByteAAGene(float fltEvolutionSpeed, int id, int paralogID)
          Constructor for objects of type ASRVByteAAGene that sets characteristic properties of gene instances.
  ASRVByteAAGene(float fltEvolutionSpeed, int id, int paralogID, float[] subProbabilities, byte[] sequence)
          Constructor for objects of type ASRVByteAAGene that generates a new gene given a byte sequence.
  ASRVByteAAGene(float fltEvolutionSpeed, int id, int paralogID, float[] subProbabilities, java.lang.String sequence)
          Constructor for objects of type ASRVByteAAGene that generates a new gene given a character sequence in the form of a String.
 
Method Summary
 java.lang.Object clone()
          All genes must be cloneable.
 Gene duplicate(int paralogID)
          Generates an paralog of this gene.
 boolean equals(java.lang.Object obj)
          Checks for equality between two ASRVByteAAGenes.
 AminoAcid getAminoAcid(int index)
          Returns the AminoAcid at the given index.
 float getEvolutionSpeed()
          Returns the currently employed evolution speed for this Gene
 int getID()
          Return the ID number for this gene.
 int getParalogID()
          Returns the paralog number for this gene.
 int getSize()
          Returns the number of AminoAcids in this Gene.
static void main(java.lang.String[] args)
          Generic driver for ASRVByteAAGenes.
 void mutateASRV()
          Mutate the ASRV by swapping randomly selected regions.
 void mutateEvolutionSpeed()
          Mutates the evolution speed of this Gene randomly up or down from the current evolution speed.
 void reverse()
          Reverses the amino acid positions in this gene.
 void setEvolutionSpeed(float fltNewEvolutionSpeed)
          Sets the evolution speed for this Gene.
 void substitute()
          Processes substitution according to the currently employed substitution matrix for this Gene.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

randomNumberGenerator

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


DEFAULT_GENESIZE

public static final int DEFAULT_GENESIZE
Default size for a gene in number of amino acids.

See Also:
Constant Field Values

_id

public final int _id
The ID number for this gene.


_paralogID

public final int _paralogID
The paralog ID number for this gene.


_smtrx

private static final SubstitutionMatrix _smtrx
The currently employed substitution matrix for this gene.


_aaAminoAcid

private ByteAminoAcid[] _aaAminoAcid
The sequence of amino acids that make up this gene.


_fltEvolutionSpeed

private float _fltEvolutionSpeed
The speed with which this gene evolves.


_totalSubs

private int _totalSubs
The number of substitutions processed in this gene.


EVOLRATE_MUTATION_MEAN

public static final float EVOLRATE_MUTATION_MEAN
The average rate at which this gene's fltEvolutionSpeed mutations.

See Also:
Constant Field Values

EVOLRATE_MUTATION_STDEV

public static final float EVOLRATE_MUTATION_STDEV
The standard deviation for this gene's fltEvolutionSpeed mutation.

See Also:
Constant Field Values

DUPLICATE_EVOLSPEED_FACTOR

public static final float DUPLICATE_EVOLSPEED_FACTOR
The factor by which to increase the fltEvolutionSpeed of a newly duplicated gene.

See Also:
Constant Field Values

ASRV_MUTLENGTH_MEAN

public static final int ASRV_MUTLENGTH_MEAN
The average length of sites that mutate their substitution rates in a given mutation event.

See Also:
Constant Field Values

ASRV_MUTLENGTH_STDEV

public static final int ASRV_MUTLENGTH_STDEV
The standard deviation of sites that mutate their substitution rates in a given mutation event.

See Also:
Constant Field Values

ASRV_MUT_FREQ

public static final int ASRV_MUT_FREQ
The number of substitutions undergone before each ASRV mutation.

See Also:
Constant Field Values
Constructor Detail

ASRVByteAAGene

public ASRVByteAAGene()
Default constructor for objects of type ASRVByteAAGene.


ASRVByteAAGene

public ASRVByteAAGene(float fltEvolutionSpeed,
                      int id,
                      int paralogID,
                      float[] subProbabilities,
                      java.lang.String sequence)
Constructor for objects of type ASRVByteAAGene that generates a new gene given a character sequence in the form of a String.

Parameters:
fltEvolutionSpeed - the speed with which this ASRVByteAAGene evolves.
id - the ID number for this ASRVByteAAGene.
paralogID - the paralogID number for this ASRVByteAAGene.
subProbabilities - the ASRV probabilities for the amino acids in this ASRVByteAAGene.
sequence - the sequence of amino acids in this ASRVByteAAGene.

ASRVByteAAGene

public ASRVByteAAGene(float fltEvolutionSpeed,
                      int id,
                      int paralogID,
                      float[] subProbabilities,
                      byte[] sequence)
Constructor for objects of type ASRVByteAAGene that generates a new gene given a byte sequence.

Parameters:
fltEvolutionSpeed - the speed with which this ASRVByteAAGene evolves.
id - the ID number for this ASRVByteAAGene.
paralogID - the paralogID number for this ASRVByteAAGene.
subProbabilities - the ASRV probabilities for the amino acids in this ASRVByteAAGene.
sequence - the sequence of amino acids in this ASRVByteAAGene.

ASRVByteAAGene

private ASRVByteAAGene(float fltEvolutionSpeed,
                       int id,
                       int paralogID)
Constructor for objects of type ASRVByteAAGene that sets characteristic properties of gene instances.

Parameters:
fltEvolutionSpeed - the speed with which this ASRVByteAAGene evolves.
id - the ID number for this ASRVByteAAGene.
paralogID - the paralogID number for this ASRVByteAAGene.
Method Detail

getEvolutionSpeed

public float getEvolutionSpeed()
Description copied from interface: Gene
Returns the currently employed evolution speed for this Gene

Specified by:
getEvolutionSpeed in interface Gene
Returns:
the currently employed evolution speed for this gene
See Also:
Gene.getEvolutionSpeed()

setEvolutionSpeed

public void setEvolutionSpeed(float fltNewEvolutionSpeed)
Description copied from interface: Gene
Sets the evolution speed for this Gene.

Specified by:
setEvolutionSpeed in interface Gene
Parameters:
fltNewEvolutionSpeed - the new evolution speed for this gene
See Also:
Gene.setEvolutionSpeed(float)

mutateEvolutionSpeed

public void mutateEvolutionSpeed()
Mutates the evolution speed of this Gene randomly up or down from the current evolution speed.


substitute

public void substitute()
Description copied from interface: Gene
Processes substitution according to the currently employed substitution matrix for this Gene. Calculates overall substitution probabilities on the amino acid level on the fly from specific amino acid substitution probabilities and the currently employed Among Site Rate Variation (ASRV) distrubtion curve for this Gene.

Specified by:
substitute in interface Gene
See Also:
Gene.substitute()

mutateASRV

public void mutateASRV()
Mutate the ASRV by swapping randomly selected regions.


getAminoAcid

public AminoAcid getAminoAcid(int index)
Description copied from interface: Gene
Returns the AminoAcid at the given index.

Specified by:
getAminoAcid in interface Gene
Parameters:
index - the index of the AminoAcid to return.
Returns:
the AminoAcid at the given index.
See Also:
Gene.getAminoAcid(int)

getSize

public int getSize()
Description copied from interface: Gene
Returns the number of AminoAcids in this Gene.

Specified by:
getSize in interface Gene
Returns:
the number of AminoAcids in this Gene.
See Also:
Gene.getSize()

getID

public int getID()
Description copied from interface: Gene
Return the ID number for this gene.

Specified by:
getID in interface Gene
Returns:
the ID number for this gene.
See Also:
Gene.getID()

getParalogID

public int getParalogID()
Description copied from interface: Gene
Returns the paralog number for this gene.

Specified by:
getParalogID in interface Gene
Returns:
the paralog number for this gene.
See Also:
Gene.getParalogID()

duplicate

public Gene duplicate(int paralogID)
Description copied from interface: Gene
Generates an paralog of this gene.

Specified by:
duplicate in interface Gene
Parameters:
paralogID - the paralog ID for the duplicated gene.
Returns:
the generated paralog of this gene.
See Also:
Gene.duplicate(int)

reverse

public void reverse()
Description copied from interface: Gene
Reverses the amino acid positions in this gene.

Specified by:
reverse in interface Gene
See Also:
Gene.reverse()

clone

public java.lang.Object clone()
Description copied from interface: Gene
All genes must be cloneable.

Specified by:
clone in interface Gene
See Also:
Object.clone()

equals

public boolean equals(java.lang.Object obj)
Checks for equality between two ASRVByteAAGenes. Only performs checks on evolution speed, and amino acids (count, type, etc.).

See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
See Also:
Object.toString()

main

public static void main(java.lang.String[] args)
Generic driver for ASRVByteAAGenes.

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