getTSSdata {poweRbal}R Documentation

Functions for generating the TSS data under a tree model

Description

getTSSdata - Compute the tree shape statistics of trees generated under a tree model for each given TSS.

getTSSdata_trees - Compute the tree shape statistics for each given TSS and all given trees.

Usage

getTSSdata(tss, n, Ntrees = 1L, tm)

getTSSdata_trees(tss, treeList)

Arguments

tss

Vector containing the names (as character) of the tree shape statistics that should be compared. You may either use the short names provided in tssInfo to use the already included TSS, or use the name of a list object containing similar information as the entries in tssInfo. Example:
Use "new_tss" as the name for the list object new_tss containing at least the function new_tss$func = function(tree){...}, and optionally also the information new_tss$short, new_tss$simple, new_tss$name, new_tss$type, new_tss$only_binary, and new_tss$safe_n.

n

Integer value that specifies the desired number of leaves, i.e., vertices with in-degree 1 and out-degree 0.

Ntrees

Integer value (default = 1) that specifies the desired number of generated trees.

tm

If the respective model is included in this package, then specify the model and its parameters by using a character or list. Available are all options listed under parameter tm in the documentation of function genTrees (type ?genTrees).
If you want to include your own tree model, then use the name of a list object containing the function (with the two input parameters n and Ntrees). Example:
Use "new_tm" for the list object new_tm <- list(func = function(n, Ntrees){...}).

treeList

List of trees of class multiphylo.

Value

getTSSdata Numeric matrix of TSS values (one row per TSS).

getTSSdata_trees Numeric matrix of TSS values (one row per TSS).

Author(s)

Sophie Kersting

Examples

# Example using tree models included in this package.
getTSSdata(tss = c("Colless", "Sackin"), n = 5L, Ntrees = 3L,
           tm = "yule")
# Example using a "new" TM provided by the user.
my_aldous <- list(func = function(n, Ntrees){
                        trees <- lapply(1:Ntrees,
                           function(x){genAldousBetaTree(n = n, BETA =5L)})
                        attr(trees, "class") <- "multiPhylo"
                        return(trees)})
getTSSdata(tss = c("Colless", "Sackin"), n = 5L, Ntrees = 3L,
           tm = "my_aldous")
# Example using TSS provided in tssInfo.
getTSSdata_trees(tss = c("Colless", "Sackin"),
           treeList = lapply(1:6L, function(x) genYuleTree(5)))
# Example using a "new" TSS provided by the user.
my_avd <- list(func = treebalance::avgVertDep, short = "My AVD")
getTSSdata_trees(tss = c("Colless", "my_avd"),
           treeList = lapply(1:6L, function(x) genYuleTree(5)))

[Package poweRbal version 0.0.0.3 Index]