pal.datatype
Class Nucleotides

java.lang.Object
  |
  +--pal.datatype.SimpleDataType
        |
        +--pal.datatype.Nucleotides
All Implemented Interfaces:
DataType, java.io.Serializable

public class Nucleotides
extends SimpleDataType

implements DataType for nucleotides

See Also:
Serialized Form

Field Summary
static int A_STATE
           
static int C_STATE
           
static Nucleotides DEFAULT_INSTANCE
           
static int G_STATE
           
static int UT_STATE
           
 
Fields inherited from interface pal.datatype.DataType
AMINO_ACID_DESCRIPTION, AMINOACIDS, CODON_DESCRIPTION, CODONS, GENERALIZED_CODONS_DESCRIPTION, GENERALIZEDCODONS, IUPAC_NUCELOTIDES_DESCRIPTION, IUPACNUCLEOTIDES, NUCLEOTIDE_DESCRIPTION, NUCLEOTIDES, TWO_STATE_DESCRIPTION, TWOSTATES, UNKNOWN_CHARACTER
 
Constructor Summary
Nucleotides()
           
Nucleotides(boolean isRNA)
          If isRNA is true than getChar(state) will return a U instead of a T
 
Method Summary
 char getChar(int state)
          Get character corresponding to a given state
 java.lang.String getDescription()
          description of data type
 int getNumStates()
          get number of unique states
 int getState(char c)
          Get state corresponding to character c
NOTE: IF YOU CHANGE THIS IT MAY STOP THE NUCLEOTIDE TRANSLATOR FROM WORKING!
 int getTypeID()
          get numerical code describing the data type
 boolean isTransistionByChar(char firstChar, char secondChar)
           
 boolean isTransistionByState(int firstState, int secondState)
           
 boolean isUnknownState(int state)
           
 
Methods inherited from class pal.datatype.SimpleDataType
getNumSimpleStates, getSimpleStates, isAmbiguousState, isGapChar, isUnknownChar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

A_STATE

public static final int A_STATE

C_STATE

public static final int C_STATE

G_STATE

public static final int G_STATE

UT_STATE

public static final int UT_STATE

DEFAULT_INSTANCE

public static final Nucleotides DEFAULT_INSTANCE
Constructor Detail

Nucleotides

public Nucleotides()

Nucleotides

public Nucleotides(boolean isRNA)
If isRNA is true than getChar(state) will return a U instead of a T
Method Detail

getNumStates

public int getNumStates()
Description copied from interface: DataType
get number of unique states
Following copied from interface: pal.datatype.DataType
Returns:
number of unique states

isUnknownState

public boolean isUnknownState(int state)
Overrides:
isUnknownState in class SimpleDataType
Returns:
true if this state is an unknown state

getState

public int getState(char c)
Get state corresponding to character c
NOTE: IF YOU CHANGE THIS IT MAY STOP THE NUCLEOTIDE TRANSLATOR FROM WORKING! - It relies on the fact that all the states for 'ACGTU' are between [0, 3]
Following copied from interface: pal.datatype.DataType
Parameters:
c - character
Returns:
state

getChar

public char getChar(int state)
Get character corresponding to a given state
Following copied from interface: pal.datatype.DataType
Parameters:
state - state return corresponding character

getDescription

public java.lang.String getDescription()
Description copied from interface: DataType
description of data type
Returns:
a string describing the data type

getTypeID

public int getTypeID()
Description copied from interface: DataType
get numerical code describing the data type
Returns:
the unique numerical code describing the data type

isTransistionByState

public final boolean isTransistionByState(int firstState,
                                          int secondState)
Returns:
true if A->G, G->A, C->T, or T->C if firstState equals secondState returns FALSE!

isTransistionByChar

public final boolean isTransistionByChar(char firstChar,
                                         char secondChar)
Returns:
true if A->G, G->A, C->T, or T->C if firstState equals secondState returns FALSE! (I've renamed things to avoid confusion between java typing of ints and chars)