Package jebl.evolution.parsimony
Class FitchParsimony
java.lang.Object
jebl.evolution.parsimony.FitchParsimony
- All Implemented Interfaces:
ParsimonyCriterion
Class for reconstructing characters using Fitch parsimony. This is intended to be much faster
than the static methods in the utility "Parsimony" class.
- Version:
- $Id: FitchParsimony.java 604 2007-01-04 20:22:42Z msuchard $
- Author:
- Andrew Rambaut, Alexei Drummond
-
Constructor Summary
ConstructorsConstructorDescriptionFitchParsimony
(List<Pattern> patterns, boolean gapsAreStates) FitchParsimony
(Patterns patterns, boolean gapsAreStates) -
Method Summary
Modifier and TypeMethodDescriptiondouble
Calculates the minimum number of steps for the parsimony reconstruction for the given tree.double[]
getSiteScores
(Tree tree) Calculates the minimum number of siteScores for the parsimony reconstruction of a a set of character patterns on a tree.State[]
Returns the reconstructed character states for a given node in the tree.
-
Constructor Details
-
FitchParsimony
-
FitchParsimony
-
-
Method Details
-
getSiteScores
Calculates the minimum number of siteScores for the parsimony reconstruction of a a set of character patterns on a tree. This only does the first pass of the Fitch algorithm so it does not store ancestral state reconstructions.- Specified by:
getSiteScores
in interfaceParsimonyCriterion
- Parameters:
tree
- a tree object to reconstruct the characters on- Returns:
- number of parsimony siteScores
-
getScore
Description copied from interface:ParsimonyCriterion
Calculates the minimum number of steps for the parsimony reconstruction for the given tree. It is expected that the implementation's constructor will be set up with the characters so that repeated calls can be made to this function to evaluate different trees.- Specified by:
getScore
in interfaceParsimonyCriterion
- Parameters:
tree
- a tree object to reconstruct the characters on- Returns:
- the total score
-
getStates
Returns the reconstructed character states for a given node in the tree. If this method is repeatedly called with the same tree and patterns then only the first call will reconstruct the states and each subsequent call will return the stored states.- Specified by:
getStates
in interfaceParsimonyCriterion
- Parameters:
tree
- a tree object to reconstruct the characters onnode
- the node of the tree- Returns:
- an array containing the reconstructed states for this node
-