The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

treenomial

CRAN status

Overview

The package treenomial is an application of polynomials that uniquely describe trees. It provides tools for tree analysis and comparison based on polynomials. The core functions are:

For the mathematical description of the tree defining polynomial see:

Liu, Pengyu. “A tree distinguishing polynomial.” arXiv preprint arXiv:1904.03332 (2019).

Installation

To install using CRAN:

install.packages("treenomial")

For the development version:

library(devtools)
install_github("mattgou1d/treenomial")

Example tree and polynomial

Consider a three tip tree:

library(ape)
library(treenomial)

threeTipTree <- rtree(3, rooted = T)
plot.phylo(threeTipTree, use.edge.length = F, show.tip.label = F, direction = "downwards")

It’s polynomial is x^3+xy+y which can equivalently be described with a coefficient matrix where the element in the ith row, jth column represents the y^(i-1) * x^(j-1) coefficient:

treeToPoly(threeTipTree, varLabels = T)
#>     x^0 x^1 x^2 x^3
#> y^0   0   0   0   1
#> y^1   1   1   0   0
#> y^2   0   0   0   0

Using the coefficients of the polynomials, distances between trees can be compared, below the two closest trees to a random target tree are found from a random sample:

# random 12 tip target tree 
target <- rtree(12)

# random sample of 100 trees
sample <- rmtree(100,12)

minInfo <- plotExtremeTrees(target,sample, n = 2, comparison = "min", type = "d")

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.