# Make a neighbor joining tree

Section author: Gavin Huttley

An example of how to calculate the pairwise distances for a set of sequences.

Import a substitution model (or create your own)

Load the alignment.

Create a pairwise distances object calculator for the alignment, providing a substitution model instance.

Now use this matrix to build a neighbour joining tree.

We can save this tree to file.

previous

Calculate pairwise distances between sequences

next

Make a UPGMA cluster