Class GuideTree<S extends Sequence<C>,​C extends Compound>

  • Type Parameters:
    S - each Sequence in the tree is of type S
    C - each element of a Sequence is a Compound of type C
    All Implemented Interfaces:
    java.lang.Iterable<GuideTreeNode<S,​C>>

    public class GuideTree<S extends Sequence<C>,​C extends Compound>
    extends java.lang.Object
    implements java.lang.Iterable<GuideTreeNode<S,​C>>
    Implements a data structure for a guide tree used during progressive multiple sequence alignment. Leaf GuideTree.Nodes correspond to single Sequences. Internal GuideTree.Nodes correspond to multiple sequence alignments. The root GuideTree.Node corresponds to the full multiple sequence alignment.
    Author:
    Mark Chapman
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  GuideTree.Node
      Implements a data structure for the node in a guide tree used during progressive multiple sequence alignment.
    • Constructor Summary

      Constructors 
      Constructor Description
      GuideTree​(java.util.List<S> sequences, java.util.List<PairwiseSequenceScorer<S,​C>> scorers)
      Creates a guide tree for use during progressive multiple sequence alignment.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double[] getAllPairsScores()
      Returns a sequence pair score for all Sequence pairs in the given List.
      double[][] getDistanceMatrix()
      Returns the distance matrix used to construct this guide tree.
      GuideTree.Node getRoot()
      Returns the root GuideTree.Node which corresponds to the full multiple sequence alignment.
      double[][] getScoreMatrix()
      Returns the similarity matrix used to construct this guide tree.
      java.util.List<S> getSequences()
      Returns the Sequences which make up the leaves of this tree.
      java.util.Iterator<GuideTreeNode<S,​C>> iterator()
      Returns a post-order Iterator that traverses the tree from leaves to root.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • GuideTree

        public GuideTree​(java.util.List<S> sequences,
                         java.util.List<PairwiseSequenceScorer<S,​C>> scorers)
        Creates a guide tree for use during progressive multiple sequence alignment.
        Parameters:
        sequences - the List of Sequences to align
        scorers - list of sequence pair scorers, one for each pair of sequences given
    • Method Detail

      • getAllPairsScores

        public double[] getAllPairsScores()
        Returns a sequence pair score for all Sequence pairs in the given List.
        Returns:
        list of sequence pair scores
      • getDistanceMatrix

        public double[][] getDistanceMatrix()
        Returns the distance matrix used to construct this guide tree. The scores have been normalized.
        Returns:
        the distance matrix used to construct this guide tree
      • getRoot

        public GuideTree.Node getRoot()
        Returns the root GuideTree.Node which corresponds to the full multiple sequence alignment.
        Returns:
        the root node
      • getScoreMatrix

        public double[][] getScoreMatrix()
        Returns the similarity matrix used to construct this guide tree. The scores have not been normalized.
        Returns:
        the similarity matrix used to construct this guide tree
      • getSequences

        public java.util.List<S> getSequences()
        Returns the Sequences which make up the leaves of this tree.
        Returns:
        the sequences which make up the leaves of this tree
      • iterator

        public java.util.Iterator<GuideTreeNode<S,​C>> iterator()
        Returns a post-order Iterator that traverses the tree from leaves to root.
        Specified by:
        iterator in interface java.lang.Iterable<S extends Sequence<C>>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object