This is a test version of Biostars. For the public version, visit https://www.biostars.org.
pairwise distance in phylogeny tree in matlab

I am playing with the matlab bioinformatic toolbox and I have an issue with making phylogeny tree using pairwise distances;

my code is very simple, as following:

clear, clc
dist = [10, 10, 4];
tree = seqlinkage(dist,'complete');
phytreeviewer(tree)

the output looks like this

as you can see the pairwise distance is not exactly as I define. in the image the distance between Leaf1 and leaf2 is 20 and the leaf2 to leaf3 8.

So my question is what kind of distance it is and how can I change it to be what I expect to have.

phylogeny matlab

1 answer

Hi there,

As I understand the plot is correct. As matlab specifies, in your distance vector you have the distance between:

[ (Leaf 2, Leaf 1); (Leaf 3, Leaf 1); (Leaf 3, Leaf 2) ] = [10, 10, 4] (help seqpdist).

If you take a look at the dendrogram, it displays the highest distance at the bottom (10). Leafs 2 and 3 are merged at a distance of 4 (10 - 6 in you dendrogram). Finally, Leaf 1 is merged with the cluster (Leaf 2 and Leaf 3) at a distance of 10 (10 - 0 in your dendrogram), which corresponds to the max dist between all objects in the two clusters (definition of the complete linkage).

Try playing with a vector of 6 distances (4 objects), it will be clear, probably. If it is not, I'll be glad to give more help.

Cheers!

Log in to answer this question.