| ancestors {Oncotree} | R Documentation |
Find ancestors within an oncogenetic tree.
Description
ancestors finds all the ancestors of the given vertex within the tree starting from itself up to the root. least.common.ancestor finds the common ancestor of two vertices that is closest to them (and farthest from the root).
Usage
ancestors(otree, vertex)
least.common.ancestor(otree, v1, v2)
Arguments
otree |
An object of class |
vertex, v1, v2 |
Character values giving the names of the nodes. |
Value
For ancestors: a character vector giving the names of the ancestors of vertex. The first element is vertex, and the last one is “Root”.
For least.common.ancestor: a character value with the name of the least common ancestor of v1 and v2.
See Also
Examples
data(ov.cgh)
ov.tree <- oncotree.fit(ov.cgh)
ancestors(ov.tree, "4q-")
ancestors(ov.tree, "Xp-")
least.common.ancestor(ov.tree, "4q-","Xp-") #"5q-"
[Package Oncotree version 0.3.5 Index]