public class DistanceCalculator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT |
Constructor and Description |
---|
DistanceCalculator()
Default constructor.
|
DistanceCalculator(Phylogeny t)
Constructor.
|
DistanceCalculator(Phylogeny t,
java.util.Vector<PhylogenyNode> ext_nodes)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
getDistanceToLCA(java.lang.String seq_name)
Calculates the distance of the PhylogenyNode with seq name seq_name to
the LCA of ext_nodes, which has been set either with constructor
DistanceCalculator(Phylogeny,Vector) or method
setTreeAndExtNodes(Phylogeny,Vector).
|
double |
getDistanceToNode(PhylogenyNode outer,
PhylogenyNode inner)
Calculates the distance of PhylogenyNode outer to PhylogenyNode inner.
|
double |
getDistanceToNode(java.lang.String seq_name,
PhylogenyNode inner)
Calculates the distance of the PhylogenyNode with seq name seq_name to
PhylogenyNode inner.
|
double |
getDistanceToRoot(PhylogenyNode n)
Calculates the distance of PhylogenyNode n to the root of Phylogeny t
which has been set either with a constructor, setTree(Phylogeny), or
setTreeAndExtNodes(Phylogeny,Vector).
|
double |
getDistanceToRoot(java.lang.String seq_name)
Calculates the distance of the PhylogenyNode with seq name seq_name to
the root of Phylogeny t, which has been set either with a constructor,
setTree(Phylogeny), or setTreeAndExtNodes(Phylogeny,Vector).
|
double |
getMean()
Returns the mean distance.
|
int |
getN()
Returns the sum of all Nodes used to calculate the mean.
|
double |
getStandardDeviation()
Returns the standard deviation.
|
double |
getVariance()
Returns the variance.
|
static void |
main(java.lang.String[] args) |
void |
setTree(Phylogeny t)
Sets the rooted Phylogeny t for which the mean distance to the root and
its variance and standard deviation are calculated.
|
void |
setTreeAndExtNodes(Phylogeny t,
java.util.ArrayList<PhylogenyNode> ext_nodes)
Sets the rooted Phylogeny t and the external Nodes ext_nodes for which
the mean distance to their lowest common ancestor and its variance and
standard deviation are calculated.
|
void |
setTreeAndExtNodes(Phylogeny t,
java.util.Vector<PhylogenyNode> ext_nodes)
Sets the rooted Phylogeny t and the external Nodes ext_nodes for which
the mean distance to their lowest common ancestor and its variance and
standard deviation are calculated.
|
public static final double DEFAULT
public DistanceCalculator()
public DistanceCalculator(Phylogeny t)
t
- the rooted Phylogeny for which the mean distance to the root
and its variance and standard deviation are calculatedpublic DistanceCalculator(Phylogeny t, java.util.Vector<PhylogenyNode> ext_nodes)
t
- the rooted Phylogeny containing Nodes in Vector ext_nodesext_nodes
- a Vector of Nodes of t, the mean distance to their lowest
common ancestor and its variance and standard deviation are
calculatedpublic double getDistanceToLCA(java.lang.String seq_name)
seq_name
- the seq name for the PhylogenyNode for which the distance to
the LCA is to be calculatedDistanceCalculator(Phylogeny,Vector)
,
setTreeAndExtNodes(Phylogeny,Vector)
,
setTreeAndExtNodes(Phylogeny,ArrayList)
public double getDistanceToNode(PhylogenyNode outer, PhylogenyNode inner)
outer
- a PhylogenyNodeinner
- a PhylogenyNode closer to the root than outerpublic double getDistanceToNode(java.lang.String seq_name, PhylogenyNode inner)
seq_name
- the seq name of a PhylogenyNode further from the root than
PhylogenyNode innerinner
- a PhylogenyNodepublic double getDistanceToRoot(PhylogenyNode n)
n
- the PhylogenyNode for which the distance to the root is to be
calculatedDistanceCalculator(Phylogeny)
,
DistanceCalculator(Phylogeny,Vector)
,
setTree(Phylogeny)
,
setTreeAndExtNodes(Phylogeny,Vector)
public double getDistanceToRoot(java.lang.String seq_name)
seq_name
- the seq name for the PhylogenyNode for which the distance to
the root is to be calculatedDistanceCalculator(Phylogeny)
,
DistanceCalculator(Phylogeny,Vector)
,
setTree(Phylogeny)
,
setTreeAndExtNodes(Phylogeny,Vector)
,
setTreeAndExtNodes(Phylogeny,ArrayList)
public double getMean()
DistanceCalculator(Phylogeny)
,
DistanceCalculator(Phylogeny,Vector)
,
setTree(Phylogeny)
,
setTreeAndExtNodes(Phylogeny,Vector)
,
setTreeAndExtNodes(Phylogeny,ArrayList)
public int getN()
public double getStandardDeviation()
DistanceCalculator(Phylogeny)
,
DistanceCalculator(Phylogeny,Vector)
,
setTree(Phylogeny)
,
setTreeAndExtNodes(Phylogeny,Vector)
,
setTreeAndExtNodes(Phylogeny,ArrayList)
public double getVariance()
public void setTree(Phylogeny t)
t
- the rooted Phylogeny for which the mean distance to the root
and its variance and standard deviation are calculatedpublic void setTreeAndExtNodes(Phylogeny t, java.util.ArrayList<PhylogenyNode> ext_nodes)
t
- the rooted Phylogeny containing Nodes in Vector ext_nodesext_nodes
- a ArrayList of Nodes of t, the mean distance to their lowest
common ancestor and its variance and standard deviation are
calculatedpublic void setTreeAndExtNodes(Phylogeny t, java.util.Vector<PhylogenyNode> ext_nodes)
t
- the rooted Phylogeny containing Nodes in Vector ext_nodesext_nodes
- a Vector of Nodes of t, the mean distance to their lowest
common ancestor and its variance and standard deviation are
calculatedpublic static void main(java.lang.String[] args)