# Class TreeBuilderFactory

java.lang.Object
jebl.evolution.trees.TreeBuilderFactory

public class TreeBuilderFactory extends Object
A meeting point for tree building from sequence data. A very initial form which will develope to encompass more methods and distances. Currently only pairwise distance methods are implemented.

Version:
  $Id: TreeBuilderFactory.java 853 2007-12-07 07:32:42Z twobeers $
Author:
  Joseph Heled

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`TreeBuilderFactory.ConsensusMethod`
Supported consensus methods.
`static enum`
`TreeBuilderFactory.DistanceModel`
Supported pairwise distance methods
`static enum`
`TreeBuilderFactory.Method`
Supported methods for tree building

## Constructor Summary

Constructors
Constructor
Description
`TreeBuilderFactory()`

## Method Summary

Modifier and Type
Method
Description
`static ConsensusTreeBuilder`
`buildRooted(RootedTree[] trees, double supportThreshold, TreeBuilderFactory.ConsensusMethod method)`
`static ConsensusTreeBuilder`
`buildRooted(Tree[] trees, double supportThreshold, TreeBuilderFactory.ConsensusMethod method)`
convenience method.
`static ConsensusTreeBuilder`
`buildUnRooted(Tree[] trees, Taxon outGroup, double supportThreshold, TreeBuilderFactory.ConsensusMethod method)`
`static ClusteringTreeBuilder`
`getBuilder(TreeBuilderFactory.Method method, DistanceMatrix distances)`
`static boolean`
`isRootedMethod(TreeBuilderFactory.Method method)`

### Methods inherited from class Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TreeBuilderFactory

public TreeBuilderFactory()

## Method Details

### isRootedMethod

public static boolean isRootedMethod(TreeBuilderFactory.Method method)

Parameters:
  `method` - to check
Returns:
  Wheather method generates a rooted or unrooted tree.

### getBuilder

public static ClusteringTreeBuilder getBuilder(TreeBuilderFactory.Method method, DistanceMatrix distances)

Parameters:
  `method` - build method to use.
  `distances` - Pre computed pairwise distances.
Returns:
  A tree builder using method and distance matrix

### buildUnRooted

public static ConsensusTreeBuilder buildUnRooted(Tree[] trees, Taxon outGroup, double supportThreshold, TreeBuilderFactory.ConsensusMethod method)

### buildRooted

public static ConsensusTreeBuilder buildRooted(RootedTree[] trees, double supportThreshold, TreeBuilderFactory.ConsensusMethod method)

### buildRooted

public static ConsensusTreeBuilder buildRooted(Tree[] trees, double supportThreshold, TreeBuilderFactory.ConsensusMethod method)
convenience method. Convert arrays of trees, guaranteed to be rooted to the array of the appropriate type.

Parameters:
  `trees` - trees - all must be rooted
  `supportThreshold` - minimum required consensus support (in [01])
  `method` - which consensus method to use
Returns:
  consensus tree builder