Skip to Main Content Skip to Search
Product Documentation

getmatrix (phytree) - Convert phytree object into relationship matrix

Syntax

[Matrix, ID, Distances] = getmatrix(PhytreeObj)

Arguments

PhytreeObjphytree object created by phytree (object constructor).

Description

[Matrix, ID, Distances] = getmatrix(PhytreeObj) converts a phytree object, PhytreeObj, into a logical sparse matrix, Matrix, in which 1 indicates that a branch node (row index) is connected to its child (column index). The child can be either another branch node or a leaf node. ID is a column vector of strings listing the labels that correspond to the rows and columns of Matrix, with the labels from 1 to Number of Leaves being the leaf nodes, then the labels from Number of Leaves + 1 to Number of Leaves + Number of Branches being the branch nodes, and the label for the last branch node also being the root node. Distances is a column vector with one entry for every nonzero entry in Matrix traversed column-wise and representing the distance between the branch node and the child.

Examples

 T = phytreeread('pf00002.tree')
 [MATRIX, ID, DIST] = getmatrix(T); 
 

See Also

get | pdist | phytree | phytreetool | prune

How To

  


Free Computational Biology Interactive Kit

See how to analyze, visualize, and model biological data and systems using MathWorks products.

Get free kit

Trials Available

Try the latest computational biology products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS