edu.uconn.mcb.lineageevolver
Class ByteAminoAcid

java.lang.Object
  extended byedu.uconn.mcb.lineageevolver.ByteAminoAcid
All Implemented Interfaces:
AminoAcid, java.lang.Cloneable, Substitutable

public class ByteAminoAcid
extends java.lang.Object
implements AminoAcid, Substitutable

Amino Acid implementation using byte datatype.

Author:
Hasan Khalil, Lina Pezzella

Field Summary
private  byte _byteType
          The type of this amino acid.
private  float _fltSubstitutionProbability
          The probability that this amino acid will undergo substitution.
 
Constructor Summary
ByteAminoAcid()
          Default constructor for objects of type ByteAminoAcid.
ByteAminoAcid(byte byteType, float fltSubstitutionProbability)
          Constructor for objects of type ByteAminoAcid given a type (encoded as a byte) and a substitution probability.
ByteAminoAcid(char charType, float fltSubstitutionProbability)
          Constructor for objects of type ByteAminoAcid given a type (encoded as a char) and a substitution probability.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 float getSubstitutionProbability()
          Returns the substitution probability for this amino acid.
 char getType()
          Returns the type of this amino acid.
static void main(java.lang.String[] args)
          Simple driver for ByteAminoAcid testing/debugging.
 void setSubstitutionProbability(float fltNewSubstitutionProbability)
          Sets the substitution probability of this amino acid.
 void setType(byte byteNewType)
          Sets the type of this amino acid given a new type encoded as a byte..
 void setType(char charNewType)
          Sets the type of this amino acid given a new type encoded as a character.
 void substitute(SubstitutionMatrix sm)
          Induces substitution in this substitutable object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_byteType

private byte _byteType
The type of this amino acid.


_fltSubstitutionProbability

private float _fltSubstitutionProbability
The probability that this amino acid will undergo substitution.

Constructor Detail

ByteAminoAcid

public ByteAminoAcid()
Default constructor for objects of type ByteAminoAcid. This constructor calls a more specific constructor with reasonable default values.


ByteAminoAcid

public ByteAminoAcid(char charType,
                     float fltSubstitutionProbability)
Constructor for objects of type ByteAminoAcid given a type (encoded as a char) and a substitution probability. The provided character is converted to a byte using the AATranslator class.

Parameters:
charType - the desired type for the new AminoAcid, encoded as a character..
fltSubstitutionProbability - the desired substitution probability for the new AminoAcid.
See Also:
AATranslator.getByte(char)

ByteAminoAcid

public ByteAminoAcid(byte byteType,
                     float fltSubstitutionProbability)
Constructor for objects of type ByteAminoAcid given a type (encoded as a byte) and a substitution probability.

Parameters:
byteType - the desired type for the new AminoAcid, encoded as a byte..
fltSubstitutionProbability - the desired substitution probability for the new AminoAcid.
Method Detail

getSubstitutionProbability

public float getSubstitutionProbability()
Description copied from interface: AminoAcid
Returns the substitution probability for this amino acid.

Specified by:
getSubstitutionProbability in interface AminoAcid
Returns:
the substitution probability for this amino acid
See Also:
AminoAcid.getSubstitutionProbability()

setSubstitutionProbability

public void setSubstitutionProbability(float fltNewSubstitutionProbability)
Description copied from interface: AminoAcid
Sets the substitution probability of this amino acid.

Specified by:
setSubstitutionProbability in interface AminoAcid
Parameters:
fltNewSubstitutionProbability - the new substitution probability of this amino acid
See Also:
AminoAcid.setSubstitutionProbability(float)

substitute

public void substitute(SubstitutionMatrix sm)
Description copied from interface: Substitutable
Induces substitution in this substitutable object.

Specified by:
substitute in interface Substitutable
Parameters:
sm - the substitution matrix to use when processing substitution.
See Also:
Substitutable.substitute(SubstitutionMatrix)

getType

public char getType()
Returns the type of this amino acid.

Specified by:
getType in interface AminoAcid
Returns:
The type of this amino acid.

setType

public void setType(char charNewType)
Sets the type of this amino acid given a new type encoded as a character. Converts the provided character to a byte using an AATranslator.

Specified by:
setType in interface AminoAcid
Parameters:
charNewType - The type to set this amino acid to.
See Also:
AATranslator.getByte(char)

setType

public void setType(byte byteNewType)
Sets the type of this amino acid given a new type encoded as a byte.. Checks that the provided new type is sane using an AATranslator.

Parameters:
byteNewType -
See Also:
AATranslator.sanityCheck(byte)

clone

public java.lang.Object clone()
Specified by:
clone in interface AminoAcid
See Also:
Object.clone()

equals

public boolean equals(java.lang.Object obj)
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)
Simple driver for ByteAminoAcid testing/debugging.

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