pal.tree
Class DatedTipsClockTree

java.lang.Object
  |
  +--pal.tree.ParameterizedTree
        |
        +--pal.tree.DatedTipsClockTree
All Implemented Interfaces:
ExternalParameterListener, Parameterized, java.io.Serializable, Tree, Units

public class DatedTipsClockTree
extends ParameterizedTree
implements ExternalParameterListener, java.io.Serializable

provides parameter interface to a clock tree with dated tips, following A. Rambaut. 2000. Bioinformatics 16:395-399. (parameters are the minimal node height differences at each internal node and the evolutionary rate)

See Also:
Serialized Form

Field Summary
static int NO_PARAMETRIZE
           
static int PARAMETERIZE_WITH_DEFAULTS
           
static int PARAMETERIZE_WITH_GIVEN
           
 
Fields inherited from interface pal.misc.Units
DAYS, EXPECTED_SUBSTITUTIONS, GENERATIONS, MONTHS, YEARS
 
Constructor Summary
DatedTipsClockTree(Tree t)
          Constructor without TimeOrderCharacterData.
DatedTipsClockTree(Tree t, ParameterizedDouble rate, TimeOrderCharacterData tocd, int internalHeightMode, int rateMode)
          take any tree and afford it with an interface suitable for a clock-like tree with dated tips (parameters are the minimal node height differences at each internal node and the rate).
DatedTipsClockTree(Tree t, TimeOrderCharacterData tocd, boolean useDefaultParameters)
          take any tree and afford it with an interface suitable for a clock-like tree with dated tips (parameters are the minimal node height differences at each internal node and the rate).
 
Method Summary
 double getDefaultValue(int n)
          get default value of parameter
 double getLowerLimit(int n)
          get lower parameter limit
 double getMaxRate()
          find max. rate (for setRate) allowed by current node heights
 int getNumParameters()
          get number of parameters
 double getParameter(int n)
          get model parameter
 double getParameterSE(int n)
          return standard error of parameter
 double getRate()
          get rate
 TimeOrderCharacterData getTimeOrderCharacterData()
          Gets the TimeOrderCharacterData
 double getUpperLimit(int n)
          get upper parameter limit
 void parameterChanged(ParameterEvent pe)
          The rate was changed externally
 void setParameter(double param, int n)
          set model parameter
 void setParameterSE(double paramSE, int n)
          set standard errors for model parameter
 void setRate(double r)
          set rate (and thus node heights and branch lengths of leaves) without changing all other node heights and branch lengths
 void setRateSE(double rSE)
          set rate SE
 void update()
          make parameters consistent with branch lengths and rate parameter
 
Methods inherited from class pal.tree.ParameterizedTree
createNodeList, getAttribute, getBaseTree, getExternalNode, getExternalNodeCount, getInternalNode, getInternalNodeCount, getRoot, getUnits, setAttribute, setBaseTree, setRoot, setUnits, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETERIZE_WITH_DEFAULTS

public static final int PARAMETERIZE_WITH_DEFAULTS

PARAMETERIZE_WITH_GIVEN

public static final int PARAMETERIZE_WITH_GIVEN

NO_PARAMETRIZE

public static final int NO_PARAMETRIZE
Constructor Detail

DatedTipsClockTree

public DatedTipsClockTree(Tree t)
Constructor without TimeOrderCharacterData. Dates are extracted from labels.

DatedTipsClockTree

public DatedTipsClockTree(Tree t,
                          TimeOrderCharacterData tocd,
                          boolean useDefaultParameters)
take any tree and afford it with an interface suitable for a clock-like tree with dated tips (parameters are the minimal node height differences at each internal node and the rate). This constructor uses the standard definition of a rate (default value = 0, min value = 0, max value = 1) and does include the rate as the parameter

This parameterisation of a clock-tree, ensuring that all parameters are independent of each other is due to Andrew Rambaut (personal communication).


DatedTipsClockTree

public DatedTipsClockTree(Tree t,
                          ParameterizedDouble rate,
                          TimeOrderCharacterData tocd,
                          int internalHeightMode,
                          int rateMode)
take any tree and afford it with an interface suitable for a clock-like tree with dated tips (parameters are the minimal node height differences at each internal node and the rate).

This parameterisation of a clock-tree, ensuring that all parameters are independent of each other is due to Andrew Rambaut (personal communication).

Method Detail

parameterChanged

public void parameterChanged(ParameterEvent pe)
The rate was changed externally
Specified by:
parameterChanged in interface ExternalParameterListener

update

public void update()
make parameters consistent with branch lengths and rate parameter

getNumParameters

public int getNumParameters()
Description copied from interface: Parameterized
get number of parameters
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
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
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
Following copied from interface: pal.misc.Parameterized
Parameters:
paramSE - standard error of parameter value
n - parameter number

getParameterSE

public double getParameterSE(int n)
return standard error of parameter

getLowerLimit

public double getLowerLimit(int n)
Description copied from interface: Parameterized
get lower parameter limit
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
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
Following copied from interface: pal.misc.Parameterized
Parameters:
n - parameter number
Returns:
default value

setRate

public void setRate(double r)
set rate (and thus node heights and branch lengths of leaves) without changing all other node heights and branch lengths

getRate

public double getRate()
get rate

setRateSE

public void setRateSE(double rSE)
set rate SE

getMaxRate

public double getMaxRate()
find max. rate (for setRate) allowed by current node heights

getTimeOrderCharacterData

public TimeOrderCharacterData getTimeOrderCharacterData()
Gets the TimeOrderCharacterData