-
Notifications
You must be signed in to change notification settings - Fork 2
Home
An R package for manipulating phylogentic trees using an efficient and intuitive S4 class
Installation
Version 1.1 is currently available on CRAN -- read current manual with RDocumentation.
install.packages('treeman')
Alternatively, install the development copy through GitHub:
# install development copy
library(devtools)
install_github('dombennett/treeman')
Terminology and structure
The treeman
package contains a TreeMan
class that encodes a phylogenetic tree as a list of nodes, each with a unique ID. The above diagram indicates how a tree (A), is composed of nodes (B) and is summarised in the TreeMan
object (C). Key terms that treeman
uses are span to refer to the length of the preceding branch of a node, pre-node ID or prid to refer to the parent node's ID and post-node ID or ptid to refer to the directly descending node IDs.
Efficient and intuitive
Manipulating trees with treeman
is designed to be as intuitive as possible in R. Generally it's faster with the TreeMan
class than with others, such as the more common phylo
class because adding a new tip or removing is computationally similar to adding or removing an element in a list. Above, shows the amount of time it takes to add 10 new tips to a tree of different sizes -- generated with this script
To get to know the TreeMan
class check out the quick guides.