Learn R Programming

poweRbal (version 0.0.1.1)

genTrees: Generation of rooted binary trees under a given tree model

Description

genTrees - Is a wrapper function that generates Ntrees-many rooted binary trees with the given number of n leaves under any tree model tm contained in this package (more details on the available models are given in the parameter information for tm).

Usage

genTrees(n, Ntrees = 1L, tm)

Value

genTrees If Ntrees is 1, then a single tree of class phylo is returned. If Ntrees is larger than 1, a list of class multiPhylo containing the trees of class phylo is returned.

Arguments

n

Integer value that specifies the desired number of leaves, i.e., vertices with in-degree 1 and out-degree 0.
Due to the restrictions of the phylo or multiPhylo format, the number of leaves must be at least 2 since there must be at least one edge.

Ntrees

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

tm

Character or list specifying the tree model under which the trees should be generated as well as their parameters. Available are:

  • "yule" - Yule model.

  • "pda" - PDA model.

  • "etm" - ETM.

  • list("aldous", BETA) - Aldous' beta splitting model with parameter BETA >= -2.

  • list("ford", ALPHA) - Ford's alpha model with parameter ALPHA >= 0 and <= 1.

  • list("alt-birth-death", BIRTHRATE, DEATHRATE) or
    list("alt-birth-death", BIRTHRATE, DEATHRATE, TRIES) - Alternative birth-death model with parameters BIRTHRATE >0 and DEATHRATE>= 0.

  • list("density", BIRTHRATE, EQUILIB) or
    list("density", BIRTHRATE, EQUILIB, TRIES, TIMEperTRY) - Density dependent model with parameters BIRTHRATE >0 and EQULIB>= 1.

  • list("BiSSE", BIRTHRATES, DEATHRATES, TRANSRATES) or
    list("BiSSE", BIRTHRATES, DEATHRATES, TRANSRATES, TRIES, TIMEperTRY) - BiSSE model with parameters BIRTHRATES (vector with 2 values >=0, one value >0), DEATHRATES (vector with 2 values >=0), and TRANSRATES (vector with 2 values >=0, one value >0).

  • list("DCO_sym", ZETA) or
    list("DCO_sym", ZETA, STARTING_RATE) - Symmetric direct-children-only with parameter ZETA > 0 and optionally STARTING_RATE > 0 (default = 1).

  • list("DCO_asym", ZETA) or
    list("DCO_asym", ZETA, STARTING_RATE) - Asymmetric direct-children-only with parameter ZETA > 0 and optionally STARTING_RATE > 0 (default = 1).

  • list("IF_sym", ZETA) or
    list("IF_sym", ZETA, STARTING_RATE) - Symmetric inherited fertility with parameter ZETA > 0 and optionally STARTING_RATE > 0 (default = 1).

  • list("IF_asym", ZETA) or
    list("IF_asym", ZETA, STARTING_RATE) - Asymmetric inherited fertility with parameter ZETA > 0 and optionally STARTING_RATE > 0 (default = 1).

  • list("IF-diff", ZETA) or
    list("IF-diff", ZETA, STARTING_RATE) - Unequal fertility inheritance with parameter ZETA >= 1 and optionally STARTING_RATE > 0 (default = 1).

  • list("biased", ZETA) or
    list("biased", ZETA, STARTING_RATE) - Biased speciation with parameter ZETA >=0 and <=1 and optionally STARTING_RATE > 0 (default = 1).

  • list("ASB", ZETA) or
    list("ASB", ZETA, STARTING_RATE) - Age-step-based fertility with parameter ZETA > 0 and optionally STARTING_RATE > 0 (default = 1).

  • list("simpleBrown_sym", SIGMA) or
    list("simpleBrown_sym", SIGMA, STARTING_RATE) - Symmetric simple Brownian with parameter SIGMA >= 0 and optionally STARTING_RATE > 0 (default = 1).

  • list("simpleBrown_asym", SIGMA) or
    list("simpleBrown_asym", SIGMA, STARTING_RATE) - Asymmetric simple Brownian with parameter SIGMA >= 0 and optionally STARTING_RATE > 0 (default = 1).

  • list("lin-Brown_sym", SIGMA) or
    list("lin-Brown_sym", SIGMA, STARTING_RATE, STARTING_TRAIT) - Sym. punctuated(-intermittent) linear-Brownian with parameter SIGMA (vector with 2 values >=0) and optionally STARTING_RATE > 0 (default = 1) and STARTING_TRAIT (default = 10).

  • list("lin-Brown_asym", SIGMA) or
    list("lin-Brown_asym", SIGMA, STARTING_RATE, STARTING_TRAIT) - Asym. punctuated(-intermittent) linear-Brownian with parameter SIGMA (vector with 2 values >=0) and optionally STARTING_RATE > 0 (default = 1) and STARTING_TRAIT (default = 10).

  • list("lin-Brown-bounded_sym", SIGMA) or
    list("lin-Brown-bounded_sym", SIGMA, STARTING_RATE, STARTING_TRAIT) - Bounded sym. punctuated(-intermittent) linear-Brownian with parameter SIGMA (vector with 2 values >=0) and optionally STARTING_RATE > 0 (default = 1) and STARTING_TRAIT (default = 10).

  • list("lin-Brown-bounded_asym", SIGMA) or
    list("lin-Brown-bounded_asym", SIGMA, STARTING_RATE, STARTING_TRAIT) - Bounded asym. punctuated(-intermittent) linear-Brownian with parameter SIGMA (vector with 2 values >=0) and optionally STARTING_RATE > 0 (default = 1) and STARTING_TRAIT (default = 10).

  • list("log-Brown_sym", SIGMA) or
    list("log-Brown_sym", SIGMA, STARTING_RATE, STARTING_TRAIT) - Sym. punctuated(-intermittent) log-Brownian with parameter SIGMA (vector with 2 values >=0) and optionally STARTING_RATE > 0 (default = 1) and STARTING_TRAIT (default = 10).

  • list("log-Brown_asym", SIGMA) or
    list("log-Brown_asym", SIGMA, STARTING_RATE, STARTING_TRAIT) - Asym. punctuated(-intermittent) log-Brownian with parameter SIGMA (vector with 2 values >=0) and optionally STARTING_RATE > 0 (default = 1) and STARTING_TRAIT (default = 10).

    More information on each model and their parameters can be found in the description of each model, accessible with ?genYuleTree, ?genPDATree, ?genETMTree, ?genAldousBetaTree, ?genFordsAlphaTree,
    ?genBirthDeathTree, ?genAltBirthDeathTree, ?genGrowTree.

References

  • S. J. Kersting, K. Wicke, and M. Fischer. Tree balance in phylogenetic models. arXiv:2406.05185, 2024.

  • S. J. Kersting, K. Wicke, and M. Fischer. Tree balance in phylogenetic models: Supplementary material. https://tinyurl.com/278cwdh8, 2024.

Examples

Run this code
genTrees(n = 5, Ntrees = 2, tm = list("aldous", 1))
genTrees(n = 5, tm = "pda")

Run the code above in your browser using DataLab