The treestats package provides an easy to use interface to calculate summary statistics on phylogenetic trees. To obtain a list of all supported summary statistics use:
## [1] "area_per_pair" "average_leaf_depth" "avg_ladder"
## [4] "avg_vert_depth" "b1" "b2"
## [7] "beta" "cherries" "colless"
## [10] "colless_corr" "colless_quad" "crown_age"
## [13] "diameter" "double_cherries" "eigen_centrality"
## [16] "eigen_centralityW" "ew_colless" "four_prong"
## [19] "gamma" "i_stat" "il_number"
## [22] "imbalance_steps" "j_one" "j_stat"
## [25] "laplace_spectrum_a" "laplace_spectrum_e" "laplace_spectrum_g"
## [28] "laplace_spectrum_p" "max_adj" "max_betweenness"
## [31] "max_closeness" "max_closenessW" "max_del_width"
## [34] "max_depth" "max_ladder" "max_laplace"
## [37] "max_width" "mean_branch_length" "mean_branch_length_ext"
## [40] "mean_branch_length_int" "mean_inv_branch_dist" "min_adj"
## [43] "min_laplace" "mntd" "mpd"
## [46] "mw_over_md" "nltt_base" "number_of_lineages"
## [49] "phylogenetic_div" "pigot_rho" "pitchforks"
## [52] "psv" "rogers" "root_imbalance"
## [55] "rquartet" "sackin" "sshape"
## [58] "stairs" "stairs2" "symmetry_nodes"
## [61] "tot_coph" "tot_internal_path" "tot_path"
## [64] "tree_height" "treeness" "var_branch_length"
## [67] "var_branch_length_ext" "var_branch_length_int" "var_depth"
## [70] "vpd" "wiener"
If your favourite summary statistic is missing, please let the maintainer know, treestats is a dynamic package always under development, and the maintainers are always looking for new statistics!
Given a phylogenetic tree, you can now use of the available functions to calculate your summary statistic of choice. Let’s take for instance the Colless statistic (and we generate a dummy tree):
## [1] 419
Looking at the documentation of the colless statistic
(?colless), we find that the function also includes options
to normalize for size: either ‘pda’ or ‘yule’:
## [1] 0.7007613
The treestats package supports calculating many statistics in one go.
For this, several functions have been set up aptly. Firstly, the
function calc_all_stats will calculate all statistics:
Similarly, we can also blanket apply all topology associated summary statistics:
## area_per_pair average_leaf_depth avg_ladder avg_vert_depth
## 1.437394e+01 8.990000e+00 2.428571e+00 8.040201e+00
## b1 b2 beta cherries
## 5.296073e+01 4.849731e+00 -5.450073e-01 3.400000e+01
## colless colless_corr colless_quad diameter
## 4.190000e+02 8.637394e-02 8.849000e+03 2.700000e+01
## double_cherries eigen_centrality ew_colless four_prong
## 4.000000e+00 2.824185e-01 4.756123e-01 5.000000e+00
## i_stat il_number imbalance_steps j_one
## 5.416527e-01 3.200000e+01 8.500000e+01 7.390274e-01
## max_betweenness max_closeness max_del_width max_depth
## 1.262700e+04 NA 6.000000e+00 1.400000e+01
## max_ladder max_width mw_over_md pitchforks
## 4.000000e+00 2.600000e+01 1.857143e+00 1.500000e+01
## rogers root_imbalance rquartet sackin
## 6.100000e+01 5.900000e-01 4.711518e+06 8.990000e+02
## sshape stairs stairs2 symmetry_nodes
## 1.721884e+02 6.161616e-01 6.286611e-01 6.100000e+01
## tot_coph tot_internal_path tot_path_length var_depth
## 8.925000e+03 7.010000e+02 1.600000e+03 7.309900e+00