idMatches: Identify matched nodes between two trees

View source: R/idMatches.R

idMatchesR Documentation

Identify matched nodes between two trees

Description

Identify nodes with matching descendant taxa between two phylogenies.

Usage

idMatches(tree1, tree2, least.inclusive = TRUE)

Arguments

tree1

The first tree.

tree2

The second tree.

least.inclusive

Do you want to keep the smallest or largest set of matched taxa. See details.

Details

If there are multiple nodes in tree 2 which could potentially be mapped to a node in tree 1, do you want to keep the smallest or the largest one? for example: ((A,B),Z) vs (((A,B),Z),C), where C doesn't occur in tree 1. Do you want the matched node from tree 2 to be A,B,Z or A,B,Z,C.

Author(s)

Eliot Miller

Examples

first <- sim.bdtree(n=50)
second <- sim.bdtree(n=1000)
third <- sim.bdtree(n=2000)
#always returns equivalent no matter which tree is first if you set it to least inclusive = TRUE
system.time(test <- idMatches(first,second))
system.time(test2 <- idMatches(second,first))
setequal(test[,1], test2[,2])
setequal(test[,2], test2[,1])

eliotmiller/shiftPlot documentation built on March 30, 2023, 4:26 a.m.