Learn R Programming

Claddis (version 0.7.0)

match_tree_edges: Edge matching function

Description

Given two trees where one is a pruned version of the other gives matching edges and nodes of pruned tree to original tree.

Usage

match_tree_edges(original_tree, pruned_tree)

Value

matching_edges

A list of the matching edges.

matching_nodes

A matrix of matching node numbers.

removed_edges

A vector of the removed edges.

Arguments

original_tree

A tree in phylo format.

pruned_tree

A tree in phylo format that represents a pruned version of original_tree.

Author

Graeme T. Lloyd graemetlloyd@gmail.com

Details

Finds matching edge(s) and node(s) for a pruned tree in the original tree from which it was created. This is intended as an internal function, but may be of use to someone.

Examples

Run this code

# Create a random 10-taxon tree:
original_tree <- ape::rtree(n = 10)

# Remove three leaves:
pruned_tree <- ape::drop.tip(phy = original_tree, tip = c("t1", "t3", "t8"))

# Find matching edges:
X <- match_tree_edges(original_tree, pruned_tree)

# Show matching edges:
X$matching_edges

# Show matching nodes:
X$matching_nodes

# Show removed edges:
X$removed_edges

Run the code above in your browser using DataLab