Calculate pairwise patristic distances in phytree object

* D* = pdist(

`Tree`

[

`D`

`C`

`Tree`

pdist(..., 'Nodes',

`NodesValue`

pdist(..., 'Squareform',

`SquareformValue`

pdist(..., 'Criteria',

`CriteriaValue`

`Tree` | phytree object created by |

`NodesValue` | String that specifies the nodes included in the computation.
Choices are `'leaves'` (default) or `'all'` . |

`SquareformValue` | Controls the creation of a square matrix. Choices are `true` or `false` (default). |

`CriteriaValue` | String that specifies the criteria used to relate pairs. Choices
are `'distance'` (default) or `'levels'` . |

returns * D* = pdist(

`Tree`

`D`

`Tree`

`seqlinkage`

function. The output vector * D* is arranged in
the order

```
((2,1), (3,1), ..., (M,1), (3,2), ..., (M,2), ...,
(M,M-1))
```

(the lower-left triangle of the full `M`

-by-`M`

distance
matrix). To get the distance between the `I`

th and `J`

th
nodes `(I > J)`

, use the formula `D((J-1)*(M-J/2)+I-J)`

. `M`

is
the number of leaves.`[`

returns in * D*,

`C`

`Tree`

`C`

`pdist(..., '`

calls * PropertyName*',

`PropertyValue`

`pdist`

with optional properties
that use property name/property value pairs. You can specify one or
more properties in any order. Each `PropertyName`

specifies the nodes included in the computation. Choices
are

pdist(..., 'Nodes', * NodesValue*,
...)

`'leaves'`

(default) or `'all'`

.
When `NodesValue`

`'leaves'`

,
the output is ordered as before, but `M`

is the total
number of nodes in the tree (`NumLeaves+NumBranches`

).`pdist(..., 'Squareform', `

controls the creation of a square matrix. Choices
are * SquareformValue*,
...)

`true`

or `false`

(default).
When `SquareformValue`

`true`

, `pdist`

converts
the output into a square-formatted matrix, so that `D(I,J)`

denotes
the distance between the `I`

th and the `J`

th
nodes. The output matrix is symmetric and has a zero diagonal.`pdist(..., 'Criteria', `

changes the criteria used to relate pairs. * CriteriaValue*,
...)

`CriteriaValue`

`'distance'`

(default) or `'levels'`

.Read a phylogenetic tree file into a phytree object.

tr = phytreeread('pf00002.tree')

Calculate the tree distances between pairs of leaves.

dist = pdist(tr,'nodes','leaves','squareform',true)

`phytree`

| `phytreeread`

| `phytreeviewer`

| `seqlinkage`

| `seqpdist`

Was this topic helpful?