pal.substmodel
Class SimpleSubstitutionModel

java.lang.Object
  |
  +--pal.substmodel.SimpleSubstitutionModel
All Implemented Interfaces:
Parameterized, Report, java.io.Serializable, SubstitutionModel

public class SimpleSubstitutionModel
extends java.lang.Object
implements SubstitutionModel

model of sequence substitution (rate matrix + rate variation). provides a convenient interface for the computation of transition probabilities

See Also:
Serialized Form

Constructor Summary
SimpleSubstitutionModel(RateMatrix rmat)
          constructor 1 (uniform rate distribution)
SimpleSubstitutionModel(RateMatrix rmat, int n, double a)
          constructor 2 (gamma rate distribution)
SimpleSubstitutionModel(RateMatrix rmat, RateDistribution rdist)
          constructor 3 (arbitrary rate distribution)
SimpleSubstitutionModel(SubstitutionModel model)
          Return a copy of this substitution model.
 
Method Summary
 void addPalObjectListener(PalObjectListener pol)
          Add a PalObjectListener to be notified of changes to the model.
 java.lang.Object clone()
          A non shallow implementation of clone()
 DataType getDataType()
           
 double getDefaultValue(int n)
          get default value of parameter
 int getDimension()
          Returns the dimension of this model.
 double getLowerLimit(int n)
          get lower parameter limit
 int getNumParameters()
          get number of parameters
 double getParameter(int n)
          get model parameter
 RateDistribution getRateDistribution()
           
 RateMatrix getRateMatrix()
           
 double getUpperLimit(int n)
          get upper parameter limit
 boolean isSimpleJukesCantor()
           
 void removePalObjectListener(PalObjectListener pol)
          Currently passes request on to rateMatrix
 void report(java.io.PrintWriter out)
          print human readable report (e.g., on parameters and associated model)
 void setDistance(double k)
          set distance and corresponding computation transition probabilities
 void setParameter(double param, int n)
          set model parameter
 void setParameterSE(double paramSE, int n)
          set standard errors for model parameter
 void setTime(double start, double end)
           
 java.lang.String toString()
          Return string representation of substitution model.
 double transProb(int r, int i, int j)
          get transition probability for the preselected model and the previously specified distance
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleSubstitutionModel

public SimpleSubstitutionModel(RateMatrix rmat)
constructor 1 (uniform rate distribution)
Parameters:
rmat - rate matrix

SimpleSubstitutionModel

public SimpleSubstitutionModel(RateMatrix rmat,
                               int n,
                               double a)
constructor 2 (gamma rate distribution)
Parameters:
rmat - rate matrix
n - number of rate categories
a - shape parameter

SimpleSubstitutionModel

public SimpleSubstitutionModel(RateMatrix rmat,
                               RateDistribution rdist)
constructor 3 (arbitrary rate distribution)
Parameters:
rmat - rate matrix
rdist - rate distribution

SimpleSubstitutionModel

public SimpleSubstitutionModel(SubstitutionModel model)
Return a copy of this substitution model.
Method Detail

getDataType

public DataType getDataType()
Specified by:
getDataType in interface SubstitutionModel

report

public void report(java.io.PrintWriter out)
Description copied from interface: Report
print human readable report (e.g., on parameters and associated model)
Specified by:
report in interface Report
Following copied from interface: pal.misc.Report
Parameters:
out - output stream

toString

public java.lang.String toString()
Return string representation of substitution model.
Overrides:
toString in class java.lang.Object

getNumParameters

public int getNumParameters()
Description copied from interface: Parameterized
get number of parameters
Specified by:
getNumParameters in interface Parameterized
Following copied from interface: pal.misc.Parameterized
Returns:
number of parameters

setParameter

public void setParameter(double param,
                         int n)
Description copied from interface: Parameterized
set model parameter
Specified by:
setParameter in interface Parameterized
Following copied from interface: pal.misc.Parameterized
Parameters:
param - parameter value
n - parameter number

getParameter

public double getParameter(int n)
Description copied from interface: Parameterized
get model parameter
Specified by:
getParameter in interface Parameterized
Following copied from interface: pal.misc.Parameterized
Parameters:
n - parameter number
Returns:
parameter value

setParameterSE

public void setParameterSE(double paramSE,
                           int n)
Description copied from interface: Parameterized
set standard errors for model parameter
Specified by:
setParameterSE in interface Parameterized
Following copied from interface: pal.misc.Parameterized
Parameters:
paramSE - standard error of parameter value
n - parameter number

getLowerLimit

public double getLowerLimit(int n)
Description copied from interface: Parameterized
get lower parameter limit
Specified by:
getLowerLimit in interface Parameterized
Following copied from interface: pal.misc.Parameterized
Parameters:
n - parameter number
Returns:
lower bound

getUpperLimit

public double getUpperLimit(int n)
Description copied from interface: Parameterized
get upper parameter limit
Specified by:
getUpperLimit in interface Parameterized
Following copied from interface: pal.misc.Parameterized
Parameters:
n - parameter number
Returns:
upper bound

getDefaultValue

public double getDefaultValue(int n)
Description copied from interface: Parameterized
get default value of parameter
Specified by:
getDefaultValue in interface Parameterized
Following copied from interface: pal.misc.Parameterized
Parameters:
n - parameter number
Returns:
default value

setTime

public void setTime(double start,
                    double end)

setDistance

public void setDistance(double k)
set distance and corresponding computation transition probabilities
Specified by:
setDistance in interface SubstitutionModel
Parameters:
k - distance

transProb

public double transProb(int r,
                        int i,
                        int j)
get transition probability for the preselected model and the previously specified distance
Specified by:
transProb in interface SubstitutionModel
Parameters:
r - rate category
i - start state
j - end state
Returns:
transition probability

isSimpleJukesCantor

public boolean isSimpleJukesCantor()

clone

public java.lang.Object clone()
A non shallow implementation of clone()
Specified by:
clone in interface SubstitutionModel
Overrides:
clone in class java.lang.Object

getRateMatrix

public RateMatrix getRateMatrix()
Specified by:
getRateMatrix in interface SubstitutionModel
Following copied from interface: pal.substmodel.SubstitutionModel
Returns:
the rate matrix

getRateDistribution

public RateDistribution getRateDistribution()
Specified by:
getRateDistribution in interface SubstitutionModel
Following copied from interface: pal.substmodel.SubstitutionModel
Returns:
the rate distribution of this substitution model.

getDimension

public int getDimension()
Description copied from interface: SubstitutionModel
Returns the dimension of this model.
Specified by:
getDimension in interface SubstitutionModel

addPalObjectListener

public void addPalObjectListener(PalObjectListener pol)
Add a PalObjectListener to be notified of changes to the model. Only the parametersChanged method will generally be called. Currently passes request on to rateMatrix
Specified by:
addPalObjectListener in interface SubstitutionModel

removePalObjectListener

public void removePalObjectListener(PalObjectListener pol)
Currently passes request on to rateMatrix
Specified by:
removePalObjectListener in interface SubstitutionModel