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

java.lang.Object
org.biojava.nbio.alignment.GuideTree<S,C>
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:
Iterable<GuideTreeNode<S,C>>

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

    • GuideTree

      public GuideTree(List<S> sequences, 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 Details

    • 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<S,C>.Node getRoot()
      Returns the root GuideTree<S extends Sequence<C>,C extends Compound>.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 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 Iterator<GuideTreeNode<S,C>> iterator()
      Returns a post-order Iterator that traverses the tree from leaves to root.
      Specified by:
      iterator in interface Iterable<S extends Sequence<C>>
    • toString

      public String toString()
      Overrides:
      toString in class Object