nodeToPhy: Add Node Constraints to Tree in MCMCTree Format

Description Usage Arguments Value Examples

View source: R/nodeToPhy.R

Description

Produce tree with node labels in PAML format

Usage

1
nodeToPhy(phy, monoGroups, nodeCon, returnPhy = T)

Arguments

phy

fully resolved phylogeny in ape format

monoGroups

list with each element containing species that define a node of interest

nodeCon

node distributions in MCMCTreeR format

returnPhy

logical specifying whether to return phy to console or write MCMCTree for input (default = TRUE)

Value

If returnPhy=TRUE phylogeny with node labels in ape format

If returnPhy=FALSE phylogeny with node labels in MCMCTree format

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
apeTree <- read.tree(text="((((human, (chimpanzee, bonobo)), gorilla), (orangutan, sumatran)), gibbon);")
monophyleticGroups <- list()
monophyleticGroups[[1]] <- c("human", "chimpanzee", "bonobo", "gorilla", "sumatran", "orangutan", "gibbon")
monophyleticGroups[[2]] <- c("human", "chimpanzee", "bonobo", "gorilla")
monophyleticGroups[[3]] <- c("human", "chimpanzee", "bonobo")
monophyleticGroups[[4]] <- c("sumatran", "orangutan")
minimumTimes <- c("nodeOne"=15, "nodeTwo"=6, "nodeThree"=8, "nodeFour"=13) / 10
maximumTimes <- c("nodeOne"=30, "nodeTwo"=12, "nodeThree"=12, "nodeFour"=20) / 10
boundEst <- estimateBound(minAge=minimumTimes[1], maxAge=maximumTimes[1], monoGroups=monophyleticGroups[[1]], phy=apeTree)
nodeToPhy <- function(phy=apeTree, monoGroups=monophyleticGroups[[1]], nodeCon=boundEst$nodeLabels, returnPhy=T)

PuttickMacroevolution/MCMCTreeR documentation built on Nov. 20, 2017, 2:22 p.m.