BioinfoFieldExtractor
Class UPGMA

java.lang.Object
  extended by BioinfoFieldExtractor.UPGMA

public class UPGMA
extends java.lang.Object

This class is the standard implementation of Unweighted Pair Group Method with Arithmetic mean, also known as average linkage method. It is used to combine similar messages into clusters for for glocal alignment.

Author:
Serge Gorbunov

Constructor Summary
UPGMA(float[][] disM, java.util.ArrayList<java.lang.String> seq)
          The constructor
 
Method Summary
 PhylogenTree buildTree()
          This method performs UPGMA algorithm to build a tree with clusters characterizing the closest related elements of the sequence.
 void clusterTrees(PhylogenTree root)
          Cluster "closely-related" trees into clusters
 java.util.ArrayList<java.lang.Integer> convertToDec(java.lang.String msg)
          Converts string to an array of dec representations of the chars
 float findDistance(PhylogenTree tree1, PhylogenTree tree2)
          Returns the distance between two clusters
 java.util.ArrayList<PhylogenTree> getClusters()
          Returns the clusters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UPGMA

public UPGMA(float[][] disM,
             java.util.ArrayList<java.lang.String> seq)
The constructor

Parameters:
disM - Distance matrix
seq - The sequences of messages
Method Detail

buildTree

public PhylogenTree buildTree()
This method performs UPGMA algorithm to build a tree with clusters characterizing the closest related elements of the sequence.

Returns:
A single clustered phylogenetic tree.

findDistance

public float findDistance(PhylogenTree tree1,
                          PhylogenTree tree2)
Returns the distance between two clusters

Parameters:
tree1 - Phylogenetic tree # 1
tree2 - Phylogenetic tree # 2

clusterTrees

public void clusterTrees(PhylogenTree root)
Cluster "closely-related" trees into clusters

Parameters:
root - of the tree to be clustered

getClusters

public java.util.ArrayList<PhylogenTree> getClusters()
Returns the clusters


convertToDec

public java.util.ArrayList<java.lang.Integer> convertToDec(java.lang.String msg)
Converts string to an array of dec representations of the chars