Likelihood
Class Probabilities

java.lang.Object
  extended by Likelihood.Probabilities

public class Probabilities
extends java.lang.Object

Stores the values of each transition, frequency etc for one set of parameters.

Version:
1.2

Nested Class Summary
 class Probabilities.RateProbabilities
          Stores the values of each transition, frequency etc for one set of parameters and for a single rate category.
 
Constructor Summary
Probabilities(Model m, Tree t, Parameters p)
          Constructor
 
Method Summary
 java.util.Set<java.lang.String> getAllStates()
          Gets the list of all possible states
 java.util.List<java.lang.String> getAllStatesAsList()
          Gets the list of all possible states.
 ArrayMap<java.lang.String,java.lang.Integer> getArrayMap()
          Gets an ArrayMap linking states to position in an array
 double getFreq(RateCategory r, java.lang.String state)
          Gets the root frequency for a specified state under a specified RateClass
 Probabilities.RateProbabilities getP(RateCategory r)
          Gets a specific probability for a change from one state to another along a specific branch under a specific RateClass
 java.util.Set<RateCategory> getRateCategory()
          Gets the set of RateClasses that we have calculated probailities for
 double getRateP(RateCategory r)
          Gets the probability of a rate class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Probabilities

public Probabilities(Model m,
                     Tree t,
                     Parameters p)
              throws TreeException,
                     RateCategory.RateException,
                     Model.ModelException,
                     Parameters.ParameterException
Constructor

Parameters:
m - The model
t - The tree
p - The parameters
Throws:
TreeException - Thrown if there is a problem with the tree.
RateCategory.RateException - Thrown if there is an issue with a rate category in the model (e.g. a badly formatted rate).
Model.ModelException - Thrown if there is a problem with the model (e.g. the rate categories differ in their states)
Parameters.ParameterException - Thrown if there is a problem with the parameters (e.g. a requied parameter is not present)
Method Detail

getRateCategory

public java.util.Set<RateCategory> getRateCategory()
Gets the set of RateClasses that we have calculated probailities for

Returns:
Set of RateClasses

getAllStates

public java.util.Set<java.lang.String> getAllStates()
Gets the list of all possible states

Returns:
A list of all possible states

getAllStatesAsList

public java.util.List<java.lang.String> getAllStatesAsList()
Gets the list of all possible states. Called this as getAllStates() is kept for backward compitability

Returns:
A list of all possible states

getP

public Probabilities.RateProbabilities getP(RateCategory r)
Gets a specific probability for a change from one state to another along a specific branch under a specific RateClass

Parameters:
r - The rate class
Returns:
The probability of a transition from start state to end state along the branch under the specified rate class.

getFreq

public double getFreq(RateCategory r,
                      java.lang.String state)
Gets the root frequency for a specified state under a specified RateClass

Parameters:
r - The rate class
state - The state
Returns:
The frequency of the state under the rate class

getRateP

public double getRateP(RateCategory r)
Gets the probability of a rate class

Parameters:
r - the rate class
Returns:
The probability of the rate class

getArrayMap

public ArrayMap<java.lang.String,java.lang.Integer> getArrayMap()
Gets an ArrayMap linking states to position in an array

Returns:
Map linking state to positions