read.annot.beast: read.annot.beast

Description Usage Arguments Details Value See Also Examples

View source: R/read.annot.beast.R

Description

This function reads a nexus formated beast file and appends all meta-data and annotations.

Usage

1

Arguments

file

The path to the MCC file from BEAST

Details

Node ordering is the same as in the read.tree/read.nexus functions from ape (cladewise). The metadata is stored as a data.frame named 'metadata'. Only node posterior probabilites are passed as an additional numeric vector named 'posterior'. Note that 'metadata' includes tip annotations as well. The code might be a bit slow for large trees.

Value

annotated phylo object

See Also

read.nexus

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
file <- system.file("data/mcc.tre", package="rBt")
tr <- read.annot.beast(file)
class(tr)
# [1] "phylo"
names(tr)
#[1] "edge"        "edge.length" "Nnode"       "root.edge"   "tip.label"
#[6] "metadata"    "posterior"
# for add pp to nodes you could try:
plot(tr)
nodelabels(text=round(tr$posterior,2), cex=0.5)
# for edges, try:
tr$ordered.edges <- order.edges(tr)
plot(tr)
edgelabels(edge=tr$ordered.edges, text=round(tr$posterior,2), cex=0.5)

santiagosnchez/rBt documentation built on Aug. 9, 2021, 11:52 p.m.