Package org.biojava.nbio.alignment
Class GuideTree.Node
- java.lang.Object
-
- org.biojava.nbio.alignment.GuideTree.Node
-
- All Implemented Interfaces:
TreeNode
,GuideTreeNode<S,C>
public class GuideTree.Node extends Object implements GuideTreeNode<S,C>
Implements a data structure for the node in a guide tree used during progressive multiple sequence alignment.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Enumeration<GuideTreeNode<S,C>>
children()
boolean
getAllowsChildren()
GuideTreeNode<S,C>
getChild1()
Returns the first child node of this node.GuideTreeNode<S,C>
getChild2()
Returns the second child node of this node.GuideTreeNode<S,C>
getChildAt(int childIndex)
int
getChildCount()
double
getDistanceToParent()
Returns the difference in height of this node and it's parent node.int
getIndex(TreeNode child)
String
getName()
Returns the name of this node.GuideTreeNode<S,C>
getParent()
Profile<S,C>
getProfile()
Returns the profile stored at this node.Future<ProfilePair<S,C>>
getProfileFuture()
Returns the profile future stored at this node, but does not force the calculation, yet.boolean
isLeaf()
void
setProfile(Profile<S,C> profile)
Stores the given profile.void
setProfileFuture(Future<ProfilePair<S,C>> profileFuture)
Stores the given profile future.
-
-
-
Method Detail
-
getChild1
public GuideTreeNode<S,C> getChild1()
Description copied from interface:GuideTreeNode
Returns the first child node of this node. For leaf nodes (sequences), this will be null.
-
getChild2
public GuideTreeNode<S,C> getChild2()
Description copied from interface:GuideTreeNode
Returns the second child node of this node. For leaf nodes (sequences), this will be null.
-
getDistanceToParent
public double getDistanceToParent()
Description copied from interface:GuideTreeNode
Returns the difference in height of this node and it's parent node. A likely meaning of this distance is half the percent difference between this node and it's sibling node.- Specified by:
getDistanceToParent
in interfaceGuideTreeNode<S extends Sequence<C>,C extends Compound>
- Returns:
- the difference in height of this node to it's parent node
-
getName
public String getName()
Description copied from interface:GuideTreeNode
Returns the name of this node. For leaf nodes (sequences), this will likely be the accession ID.
-
getProfile
public Profile<S,C> getProfile()
Description copied from interface:GuideTreeNode
Returns the profile stored at this node. If the node is a leaf, the profile is that of a single sequence. If not, this returns null untilGuideTreeNode.setProfile(Profile)
has been called.- Specified by:
getProfile
in interfaceGuideTreeNode<S extends Sequence<C>,C extends Compound>
- Returns:
- the profile stored at this node
-
getProfileFuture
public Future<ProfilePair<S,C>> getProfileFuture()
Description copied from interface:GuideTreeNode
Returns the profile future stored at this node, but does not force the calculation, yet. This allows alignment tasks for the entire tree to be queued in a post-order traversal before concurrent execution.- Specified by:
getProfileFuture
in interfaceGuideTreeNode<S extends Sequence<C>,C extends Compound>
- Returns:
- the profile future stored at this node
-
setProfile
public void setProfile(Profile<S,C> profile)
Description copied from interface:GuideTreeNode
Stores the given profile.- Specified by:
setProfile
in interfaceGuideTreeNode<S extends Sequence<C>,C extends Compound>
- Parameters:
profile
- new profile stored at this node
-
setProfileFuture
public void setProfileFuture(Future<ProfilePair<S,C>> profileFuture)
Description copied from interface:GuideTreeNode
Stores the given profile future. This allows concurrent execution of alignment tasks.- Specified by:
setProfileFuture
in interfaceGuideTreeNode<S extends Sequence<C>,C extends Compound>
- Parameters:
profileFuture
- new profile to be calculated and then stored at this node
-
children
public Enumeration<GuideTreeNode<S,C>> children()
-
getAllowsChildren
public boolean getAllowsChildren()
- Specified by:
getAllowsChildren
in interfaceTreeNode
-
getChildAt
public GuideTreeNode<S,C> getChildAt(int childIndex)
- Specified by:
getChildAt
in interfaceTreeNode
-
getChildCount
public int getChildCount()
- Specified by:
getChildCount
in interfaceTreeNode
-
-