biopython v1.71.0 Bio.Phylo.TreeConstruction.DistanceTreeConstructor

Distance based tree constructor.

:Parameters:

method : str
    Distance tree construction method, 'nj'(default) or 'upgma'.
distance_calculator : DistanceCalculator
    The distance matrix calculator for multiple sequence alignment.
    It must be provided if `build_tree` will be called.

Example


 >>> from TreeConstruction import DistanceTreeConstructor
 >>> constructor = DistanceTreeConstructor()

UPGMA Tree:

 >>> upgmatree = constructor.upgma(dm)
 >>> print upgmatree
 Tree(rooted=True)
     Clade(name='Inner4')
         Clade(branch_length=0.171955155115, name='Inner1')
             Clade(branch_length=0.111111111111, name='Epsilon')
             Clade(branch_length=0.111111111111, name='Delta')
         Clade(branch_length=0.0673103855608, name='Inner3')
             Clade(branch_length=0.0907558806655, name='Inner2')
                 Clade(branch_length=0.125, name='Gamma')
                 Clade(branch_length=0.125, name='Beta')
             Clade(branch_length=0.215755880666, name='Alpha')

NJ Tree:

 >>> njtree = constructor.nj(dm)
 >>> print njtree
 Tree(rooted=False)
     Clade(name='Inner3')
         Clade(branch_length=0.0142054862889, name='Inner2')
             Clade(branch_length=0.239265540676, name='Inner1')
                 Clade(branch_length=0.0853101915988, name='Epsilon')
                 Clade(branch_length=0.136912030623, name='Delta')
             Clade(branch_length=0.292306275042, name='Alpha')
         Clade(branch_length=0.0747705106139, name='Beta')
         Clade(branch_length=0.175229489386, name='Gamma')

Link to this section Summary

Functions

Initialize the class

Calculate clade height — the longest path to any terminal

Construct and return an Neighbor Joining tree

Construct and return an UPGMA tree

Link to this section Functions

Initialize the class.

Calculate clade height — the longest path to any terminal.

Construct and return an Neighbor Joining tree.

:Parameters:

distance_matrix : DistanceMatrix
    The distance matrix for tree construction.

Construct and return an UPGMA tree.

Constructs and returns an Unweighted Pair Group Method with Arithmetic mean (UPGMA) tree.

:Parameters:

distance_matrix : DistanceMatrix
    The distance matrix for tree construction.