A Statistical Framework for Comparing Sets of Trees

Statistical framework for comparing sets of trees using hypothesis testing methods. Designed for transmission trees, phylogenetic trees, and directed acyclic graphs (DAGs), the package implements chi-squared tests to compare edge frequencies between sets and PERMANOVA to analyse topological dissimilarities with customisable distance metrics, following Anderson (2001) .


mixtree

R-CMD-check

The mixtree package provides a statistical framework for comparing sets of trees.

Installation

You can install the development version of mixtree from GitHub with:

# install.packages("pak")
pak::pak("CyGei/mixtree")

Quick start

library(mixtree)

# Simulate two chains of transmission trees
chainA <- lapply(1:100, function(i) {
  make_tree(20, R = 2, stochastic = TRUE) |>
    igraph::as_long_data_frame()
})
chainB <- lapply(1:100, function(i) {
  make_tree(20, R = 4, stochastic = TRUE) |>
    igraph::as_long_data_frame()
})

# Compare the two chains
result <- tree_test(chainA, chainB)
print(result)
#> Permutation test for adonis under reduced model
#> Permutation: free
#> Number of permutations: 999
#> 
#> (function (formula, data, permutations = 999, method = "bray", sqrt.dist = FALSE, add = FALSE, by = NULL, parallel = getOption("mc.cores"), na.action = na.fail, strata = NULL, ...) 
#>           Df SumOfSqs      R2      F Pr(>F)    
#> Model      1     6730 0.13248 30.236  0.001 ***
#> Residual 198    44071 0.86752                  
#> Total    199    50801 1.00000                  
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("mixtree")

0.0.1 by Cyril Geismar, 2 years ago


https://cygei.github.io/mixtree/


Browse source code at https://github.com/cran/mixtree


Authors: Cyril Geismar [aut, cre, cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports igraph, treespace, vegan

Suggests knitr, rmarkdown


Suggested by o2ools.


See at CRAN