Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

thijsjanzen/treestats

Repository files navigation

CRAN_Status_BadgeR-CMD-checkcodecov.io

Treestats

Measuring properties of phylogenetic trees

Thetreestats R package contains rapid, C++ based, functions tocalculate summary statistics on phylogenies. For some functions (but not all, see below), thephylogenies are required to be ultrametric and/or binary.

Getting started

Installation

To get started, you can either install from CRAN or use the latestversion from GitHub:

install.packages("treestats") # install from CRAN# use the devtools package to install latest version from GitHub:install.packages("devtools")devtools::install_github("thijsjanzen/treestats")

Basic usage

Given a tree (for example a simulated tree, as in the code example), youcan either access individual statistics, or calculate all currentlyimplemented statistics:

focal_tree   <- ape::rphylo(n = 10, birth = 1, death = 0)colless_stat <- treestats::colless(focal_tree)all_stats    <- treestats::calc_all_stats(focal_tree)

List of statistics

The following summary statistics are included:

StatisticInformationFischerNormalizationAssumes Ultrametric treeRequires binary treeAssumes rooted treeSensitive to root positionReference
area_per_pairTopologyShapeYuleNOYESYESYESLima et al., 2020
average_leaf_depthTopologyImbalanceYuleNOYESYESYESShao & Sokal, 1990
avg_ladderTopologyShapeNoneNOYESYESYESKendall et al., 2018
avg_vert_depthTopologyImbalanceNoneNONOYESYESColijn & Gardy, 2014
b1TopologyBalanceTipsNONOYESYESShao & Sokal, 1990
b2TopologyBalanceYuleNONOYESYESShao & Sokal, 1990
betaTopologyNo indexNoneNOYESYESYESAldous, 1996
blumTopologyImbalanceNoneNOYESYESYESBlum & François, 2006
cherriesTopologyShapeYuleNOYESNOYESMcKenzie et al., 1999
collessTopologyImbalanceYuleNOYESYESYESColless, 1982
colless_corrTopologyImbalanceYuleNOYESYESYESHeard, 1992
colless_quadTopologyImbalanceNoneNOYESYESYESBartoszek et al., 2021
crown_ageBranching timesNo indexNoneNONOYESYES
diameterTopologyShapeNoneNOYESYESYESChindelevitch et al., 2021
double_cherriesTopologyShapeNoneNOYESNOYESChindelevitch et al., 2021
eigen_centralityTopologyNo indexNoneNONONOYESChindelevitch et al., 2021
eigen_centralityWTopology + branch lengthsNo indexNoneNONONOYESChindelevitch et al., 2021
ew_collessTopologyImbalanceNoneNOYESYESYESMooers & S. B. Heard, 1997
four_prongTopologyShapeNoneNOYESNOYESChindelevitch et al., 2021
gammaBranching timesNo indexNoneYESNOYESYESPybus & Harvey, 2000
i_statTopologyImbalanceNoneNOYESYESYESFusco & Cronk, 1995
il_numberTopologyShapeTipsNONONOYESKendall et al., 2018
imbalance_stepsTopologyNo indexTipsNONOYESYESJanzen & Etienne, 2024
j_oneTopologyNo indexNoneNOYESYESYESLemant et al., 2022
j_statTopology + branch lengthsNo indexNoneNONONONOIzsák & Papp, 2000
laplace_spectrum_aTopology + branch lengthsNo indexNoneYESNONOYESLewitus & Morlon, 2016
laplace_spectrum_eTopology + branch lengthsNo indexNoneYESNONOYESLewitus & Morlon, 2016
laplace_spectrum_gTopology + branch lengthsNo indexNoneYESNONOYESLewitus & Morlon, 2016
laplace_spectrum_pTopology + branch lengthsNo indexNoneYESNONOYESLewitus & Morlon, 2016
max_adjTopology + branch lengthsNo indexNoneNOYESNOYESChindelevitch et al., 2021
max_betweennessTopologyShapeTipsNOYESYESYESChindelevitch et al., 2021
max_closenessTopologyShapeTipsNOYESNOSmallChindelevitch et al., 2021
max_closenessWTopology + branch lengthsShapeNoneNOYESNOSmallChindelevitch et al., 2021
max_del_widthTopologyShapeTipsNONOYESYESColijn & Gardy, 2014
max_depthTopologyImbalanceTipsNONOYESYESColijn & Gardy, 2014
max_ladderTopologyShapeNoneNOYESNOYESKendall et al., 2018
max_laplaceTopology + branch lengthsNo indexNoneNOYESNOYESChindelevitch et al., 2021
max_widthTopologyBalanceTipsNONOYESYESColijn & Gardy, 2014
mean_branch_lengthTopology + branch lengthsNo indexNoneNONONOYESJanzen & Etienne, 2017
mean_branch_length_extTopology + branch lengthsNo indexNoneNONONONOSaulnier et al., 2017
mean_branch_length_intTopology + branch lengthsNo indexNoneNONONOYESSaulnier et al., 2017
min_adjTopology + branch lengthsNo indexNoneNOYESNOYESChindelevitch et al., 2021
min_laplaceTopology + branch lengthsNo indexNoneNOYESNOYESChindelevitch et al., 2021
mntdTopology + branch lengthsNo indexNoneNONONONOWebb et al., 2002
mpdTopology + branch lengthsNo indexTipsNONONONOWebb et al., 2002
mw_over_mdTopologyBalanceNoneNONOYESYESColijn & Gardy, 2014
nltt_baseBranching timesNo indexNoneYESNOYESYESJanzen et al., 2015
number_of_lineagesTopology + branch lengthsNo indexNoneNONONONO
phylogenetic_divTopology + branch lengthsNo indexNoneNONOYESYESFaith, 1992
pigot_rhoBranching timesNo indexNoneYESNOYESYESPigot et al., 2010
pitchforksTopologyShapeTipsNONONOYESKendall et al., 2018
psvTopology + branch lengthsNo indexTipsNONONONOHelmus et al., 2007
rogersTopologyImbalanceTipsNOYESNOYESRogers, 1996
root_imbalanceTopologyShapeNoneNOYESYESYESGuyer et al., 1993
rquartetTopologyBalanceYuleNONOYESYESCoronado et al., 2019
sackinTopologyImbalanceYuleNOYESYESYESSackin, 1972
stairsTopologyImbalanceNoneNOYESYESYESNorström et al., 2012
stairs2TopologyBalanceNoneNOYESYESYESNorström et al., 2012
symmetry_nodesTopologyImbalanceTipsNOYESYESYESKersting & Fischer, 2021
tot_cophTopologyImbalanceYuleNOYESYESYESMir et al., 2013
tot_internal_pathTopologyImbalanceNoneNONOYESYESKnuth, 1997
tot_pathTopologyImbalanceNoneNOYESYESYESColijn & Gardy, 2014
tree_heightBranching timesNo indexNoneNONOYESYES
treenessTopology + branch lengthsNo indexNoneNONONOYESAstolfi & Zonta-Sgaramella, 1984
var_branch_lengthTopology + branch lengthsNo indexNoneNONONOYESSaulnier et al., 2017
var_branch_length_extTopology + branch lengthsNo indexNoneNONONOYESSaulnier et al., 2017
var_branch_length_intTopology + branch lengthsNo indexNoneNONONOYESSaulnier et al., 2017
var_depthTopologyImbalanceYuleNONOYESYESCoronado et al., 2020
vpdTopology + branch lengthsNo indexNoneNONONONOWebb et al., 2002
wienerTopology + branch lengthsShapeNoneNOYESNOYESChindelevitch et al., 2021

Rcpp

For all of these statistics, the package provides Rcpp versions that aremuch, much faster than their R sister functions. Furthermore, someadditional functions have been improved as well:

  • ape::branching.times
  • DDD::phylo2L
  • DDD::L2phylo

C++ Library

For the Rcpp improved summary statistics (excluding statistics that relyon the calculation of eigen values, as these rely on the Rcppindependent Eigen code), R independent C++ code is provided in theinst/include folder. These can be independently linked by adding thetreestats package in the DESCRIPTION in both the LinkingTo and Dependsfields. Then, in your package, you can also calculate these functions.

Please note that for all functions, there are two versions available: 1)based on input of a phylo object, which is typically one 2-column matrixcontaining all edges, and a vector containing the edge lengths(depending on which information is required to calculate the statistic).2) based on input of an Ltable (Lineage table), which is a 4-columnmatrix containing information on each species, being 1) birth time, 2)parent species, 3) species label and 4) death time (or -1 if extant).

Ltable input can be useful when summary statistics are required for morecomplicated simulation models.

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp