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()booleangetAllowsChildren()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)intgetChildCount()doublegetDistanceToParent()Returns the difference in height of this node and it's parent node.intgetIndex(TreeNode child)StringgetName()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.booleanisLeaf()voidsetProfile(Profile<S,C> profile)Stores the given profile.voidsetProfileFuture(Future<ProfilePair<S,C>> profileFuture)Stores the given profile future.
-
-
-
Method Detail
-
getChild1
public GuideTreeNode<S,C> getChild1()
Description copied from interface:GuideTreeNodeReturns 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:GuideTreeNodeReturns the second child node of this node. For leaf nodes (sequences), this will be null.
-
getDistanceToParent
public double getDistanceToParent()
Description copied from interface:GuideTreeNodeReturns 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:
getDistanceToParentin 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:GuideTreeNodeReturns 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:GuideTreeNodeReturns 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:
getProfilein 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:GuideTreeNodeReturns 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:
getProfileFuturein 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:GuideTreeNodeStores the given profile.- Specified by:
setProfilein 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:GuideTreeNodeStores the given profile future. This allows concurrent execution of alignment tasks.- Specified by:
setProfileFuturein 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:
getAllowsChildrenin interfaceTreeNode
-
getChildAt
public GuideTreeNode<S,C> getChildAt(int childIndex)
- Specified by:
getChildAtin interfaceTreeNode
-
getChildCount
public int getChildCount()
- Specified by:
getChildCountin interfaceTreeNode
-
-