| Bioinformatics Toolbox | ![]() |
Find ancestors in a biograph object
Nodes = getancestors(BiographNode)
Nodes = getancestors(BiographNode, NumGenerations)
BiographNode | Node in a biograph object. |
NumGenerations | Number of generations. Enter a positive integer. |
Nodes = getancestors(BiographNode) returns a node (BiographNode) and all of its direct ancestors.
Nodes = getancestors(BiographNode, NumGenerations) finds the node (BiographNode) and its direct ancestors up to a specified number of generations (NumGenerations).
Create a biograph object.
cm = [0 1 1 0 0;1 0 0 1 1;1 0 0 0 0;0 0 0 0 1;1 0 1 0 0]; bg = biograph(cm)
Find one generation of ancestors for node 2.
ancNodes = getancestors(bg.nodes(2)); set(ancNodes,'Color',[1 .7 .7]); bg.view;

Find two generations of ancestors for node 2.
ancNodes = getancestors(bg.nodes(2),2); set(ancNodes,'Color',[.7 1 .7]); bg.view;

Bioinformatics Toolbox methods for the biograph object, biograph, dolayout, getdescendants, getedgesbynodeid, getnodesbyid, getrelatives, view
| get (phytree) | getblast | ![]() |
© 1994-2005 The MathWorks, Inc.