Learn R Programming

phytools (version 2.1-1)

read.simmap: Read SIMMAP style trees from file

Description

This reads one or multiple SIMMAP style trees from file.

Usage

read.simmap(file="", text, format="nexus", rev.order=TRUE, version=1)

Value

An object of class "simmap" (or list of such objects with class "multiSimmap"), consisting of a modified object of class "phylo" with at least the following additional elements:

maps

a list of named vectors containing the times spent in each state on each branch, in the order in which they occur.

mapped.edge

a matrix containing the total time spent in each state along each edge of the tree.

Arguments

file

name of text file with one or multiple SIMMAP v1.0 or v1.5 style trees containing the mapped history of a discrete character.

text

character string containing the tree. If version=1.5 this argument is ignored. (This format tree can only be read from file in the present version.)

format

format of the trees: either "phylip" or "nexus" - the latter is the default output from SIMMAP. If version=1.5 this argument is ignored.

rev.order

a logical value indicating whether the states and times along each branch is given (from root to tip) in right-to-left order (if TRUE) or in left-to-right order. If version=1.5 this argument is ignored.

version

version of SIMMAP for input tree. If the tree(s) was/were simulated in SIMMAP v1.0 or written to file by link{make.simmap} then version=1.0; if the tree(s) was/were simulated using SIMMAP v1.5 then version=1.5.

Author

Liam Revell liam.revell@umb.edu

Details

This function now accepts trees in both SIMMAP v1.0 and SIMMAP v1.5 format. In addition, it can read a more flexible format than is produced by SIMMAP (for instance, multi-character mapped states and more than 7 mapped states).

The function uses some modified code from read.nexus from the ape package to read the NEXUS block created by SIMMAP. Also creates the attribute "map.order" which indicates whether the stochastic map was read in from left to right or right to left. This attribute is used by default by write.simmap to write the tree in the same order.

References

Bollback, J. P. (2006) Stochastic character mapping of discrete traits on phylogenies. BMC Bioinformatics, 7, 88.

Paradis, E., J. Claude, and K. Strimmer (2004) APE: Analyses of phylogenetics and evolution in R language. Bioinformatics, 20, 289-290.

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.

See Also

brownie.lite, evol.vcv, read.tree, read.nexus