statalign.model.subst.plugins
Class NucleotideModel

java.lang.Object
  extended by statalign.model.subst.SubstitutionModel
      extended by statalign.model.subst.plugins.NucleotideModel
Direct Known Subclasses:
Felsenstein81, Felsenstein84, HKY85, JukesCantor, Kimura3, ReversibleNucleotide, Tamura92, TamuraNei

public abstract class NucleotideModel
extends SubstitutionModel

This is the abstract class for nucleotide models.

Author:
lyngsoe

Field Summary
static java.lang.String type
           
 
Fields inherited from class statalign.model.subst.SubstitutionModel
alphabet, attachedScoringScheme, d, e, menuName, params, v, w
 
Method Summary
 double acceptable(RawSequences r)
          This function decides if this model can analyze input sequences.
 java.awt.Color getColor(char c)
          This function assigns colors to characters.
 char mostLikely(double[] seq)
          Returns with the most likely character, given a Felsentein likelihood array.
 java.lang.String print()
          returns the description of the current parameters of the model
 void restoreParameter()
          restore the parameters to the old values when a parameter-changing proposal is not accepted.
 void setPrintRNA(boolean printRNA)
          Selects whether to print RNA nucleotides (U for T) or default DNA ones.
 
Methods inherited from class statalign.model.subst.SubstitutionModel
getMenuName, getMenuName, getPrior, getType, getType, sampleParameter, updateSpan, updateTransitionMatrix
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public static java.lang.String type
Method Detail

acceptable

public double acceptable(RawSequences r)
This function decides if this model can analyze input sequences. accepted characters are 'acgutryswmkbdhvn'. Our program is case insensitive.

Specified by:
acceptable in class SubstitutionModel
Parameters:
r - raw sequences
Returns:
the value telling how well the substitution model likes the sequences.

getColor

public java.awt.Color getColor(char c)
This function assigns colors to characters. 'A' is red, 'C' is blue, 'G' is orange, 'T' or 'U' is green, the remaining characters (ambiguous characters and the gap symbol) are grey

Specified by:
getColor in class SubstitutionModel
Parameters:
c - character whose background colour is to be returned

print

public java.lang.String print()
returns the description of the current parameters of the model

Specified by:
print in class SubstitutionModel
Returns:
the resulting String

restoreParameter

public void restoreParameter()
restore the parameters to the old values when a parameter-changing proposal is not accepted.

Specified by:
restoreParameter in class SubstitutionModel

mostLikely

public char mostLikely(double[] seq)
Returns with the most likely character, given a Felsentein likelihood array. It can handle ambiguous characters. If the probabilities in the Felsentein array are all zero, returns '*'.

Specified by:
mostLikely in class SubstitutionModel

setPrintRNA

public void setPrintRNA(boolean printRNA)
Selects whether to print RNA nucleotides (U for T) or default DNA ones. Affects the beviour of mostLikely(double[]).