# set global chunk options: images will be 7x7 inches knitr::opts_chunk$set(fig.width=7, fig.height=7, fig.path="man/figures/", cache=FALSE, dpi=96) options(digits = 4)
phyloTop provides tools for calculating and viewing topological properties of phylogenetic trees.
To install the development version from github:
library(devtools) install_github("michellekendall/phyloTop")
The stable version can be installed from CRAN using:
install.packages("phyloTop")
Then, to load the package, use:
library("phyloTop")
The key functions available in phyloTop are:
avgLadder
: find the average ladder size in a tree
cherries
: find the number of cherries in a tree
colless.phylo
: find the Colless imbalance number of a tree
getDepths
: find the depth of each node in a tree
ILnumber
: find the number of nodes with exactly one tip child
ladderSizes
: find the size of any "ladders" in a tree (consecutive nodes, each with exactly one tip child)
maxHeight
: find the maximum height (equivalently, depth) of nodes in a tree
nConfig
: find the sizes of all configurations (equivalently, clades) in a tree
nodeDepth
: find the depth of a given node in a tree
nodeDepthFrac
: find the fraction of nodes in a tree at a given depth
nodeImb
: find the imbalance of a given node in a tree
nodeImbFrac
: find the fraction of nodes in a tree with an imbalance of a given threshold or more
phyloTop
: find a range of tree statistics for a list of trees (faster than calling each function individually)
pitchforks
: find the number of pitchforks (clades of size three) in a tree
sackin.phylo
: find the Sackin index of a tree
splitTop
: find the split topology of a tree - the size of clades at a given depth
stairs
: find the "staircase-ness" measures, as defined by Norstrom et al. 2012
treeImb
: find the tree imbalance - the imbalance at each node
widths
: find the number of nodes at each depth in a tree
configShow
: plot a tree, highlighting the configurations of a given size
ladderShow
: plot a tree, highlighting the "ladders"
subtreeShow
: plot a tree, highlighting the subtree(s) descending from the given node(s)
makeEpiRecord
: simulate an epidemiological record of infectors, infectees, infection times and recovery times
getLabGenealogy
: create a genealogy from an epidemiological record
Apply tree statistic functions to a list of 10 random trees, each with 50 tips:
set.seed(123) phyloTop(rmtree(10,50))
Plot a random tree with 20 tips, highlighting the the clade(s) descending from nodes 25 and 33:
subtreeShow(rtree(20),nodeList=c(25,33), mainCol="navy", subtreeCol="cyan", nodeLabelCol="cyan", edge.width=2)
Contributions are welcome via pull requests.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Questions, feature requests and bugs can be reported using the package's issue system.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.