Finds and returns the names of all edges in the path between two nodes in a phylogenetic tree, formatted as "parent_child" strings.

get_edges_between_clones(tree, upper_node, lower_node)

Arguments

tree

An igraph object representing the phylogenetic tree structure

upper_node

Character. Name of the starting (ancestor) node

lower_node

Character. Name of the ending (descendant) node

Value

A character vector containing edge names in the format "parent_child" for all edges in the path from upper_node to lower_node

Details

The function:

  1. Finds the shortest path between the two nodes

  2. Identifies all edges along this path

  3. Formats edge names as "parent_child"

Note: Assumes that the nodes are connected and upper_node is an ancestor of lower_node in the tree structure.

Examples

if (FALSE) { # \dontrun{
# For a tree with path A -> B -> C
edges <- get_edges_between_clones(tree, "A", "C")
# Returns: c("A_B", "B_C")
} # }