genTrees: Generate permuted trees using rNNI or rtree, and check for...

View source: R/genTrees.R

genTreesR Documentation

Generate permuted trees using rNNI or rtree, and check for uniqueness.

Description

This function generates a specified number of trees by permutation or random generation, then checks to make sure that they are unique before returning the original tree plus the generated trees

Usage

genTrees(x, N = 200, filebase = "trial", method = c("nni", "random"),
         maxmoves = 2, perms = "DEFAULT", software = c("raxml"), ...)

Arguments

x

an object of class "phylo"

N

number of new trees to return

filebase

base name of the file to which trees will be written

method

method of generating the trees, either nearest neighbor interchange (nni) or random

maxmoves

maximum number nni moves

perms

number of permutations per nni stratum; defaults to the number of single-step nni trees, then the remainder of N divided by the number of nni strata requested (negatives not allowed)

software

not currently used; in an earlier version, would write out analysis file for PAUP or RAxML

...

further arguments to be passed to rtree

Details

The main need for this function is to ensure that the trees you get back are unique... mainly just a wrapper to rNNI and rtree. perms defaults to:

c(length(nni(x)), max(1, as.integer(N - (length(nni(x))))))

Value

an object of class "multiPhylo"

Author(s)

Andrew Hipp

See Also

gen.RAD.loci.datasets, compare.all.trees

Examples

  data(oak.tree)
  out <- genTrees(oak.tree, N = 10, maxmoves = 2, perms = c(5, 5))
  plot(out[[1]]) # this is the tree you input
  plot(out[[2]]) # this is the first generated tree...
  plot(out[[11]]) # ... and this is the last generated tree.

andrew-hipp/RADami documentation built on Nov. 9, 2023, 5:40 p.m.