-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
140 lines (83 loc) · 4.21 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
title: "phyloTop readme"
author: "Michelle Kendall"
date: "`r Sys.Date()`"
output: md_document
---
```{r setup, echo=FALSE}
# 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)
```
[![Travis-CI Build Status](https://travis-ci.org/MichelleKendall/phyloTop.png?branch=master)](https://travis-ci.org/MichelleKendall/phyloTop)
[![CRAN Status Badge](http://www.r-pkg.org/badges/version/phyloTop)](https://cran.r-project.org/package=phyloTop)
[![CRAN Downloads](http://cranlogs.r-pkg.org/badges/phyloTop)](https://cran.r-project.org/package=phyloTop)
*phyloTop*: Calculating Topological Properties of Phylogenies
========
*phyloTop* provides tools for calculating and viewing topological properties of phylogenetic trees.
Installing *phyloTop*
-------------
To install the development version from github:
```{r install_1, eval=FALSE}
library(devtools)
install_github("michellekendall/phyloTop")
```
The stable version can be installed from CRAN using:
```{r install_2, eval=FALSE}
install.packages("phyloTop")
```
Then, to load the package, use:
```{r load}
library("phyloTop")
```
Content overview
-------------
The key functions available in *phyloTop* are:
#### Tree statistics and topological properties:
* __`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
#### Tree visualisation tools:
* __`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)
#### Simulating an epidemic and creating the corresponding genealogy:
* __`makeEpiRecord`__: simulate an epidemiological record of infectors, infectees, infection times and recovery times
* __`getLabGenealogy`__: create a genealogy from an epidemiological record
Examples
---------
#### Tree statistics:
Apply tree statistic functions to a list of 10 random trees, each with 50 tips:
```{r phyloTop_example}
set.seed(123)
phyloTop(rmtree(10,50))
```
#### Tree visualisation tools:
Plot a random tree with 20 tips, highlighting the the clade(s) descending from nodes 25 and 33:
```{r subtreeShow_example}
subtreeShow(rtree(20),nodeList=c(25,33), mainCol="navy", subtreeCol="cyan", nodeLabelCol="cyan", edge.width=2)
```
Contributing / asking a question
--------------------------------
Contributions are welcome via **pull requests**.
Please note that this project is released with a [Contributor Code of
Conduct](https://github.com/MichelleKendall/phyloTop/blob/master/CONDUCT.md). 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](https://github.com/michellekendall/phylotop/issues).