evalTerminal: evalTerminal

View source: R/evalTerminal.R

evalTerminalR Documentation

evalTerminal

Description

This function swaps the lengths of two edges in a phylogenetic tree and evaluates the resulting change in the selected area based on a specific index (e.g., PD). It performs multiple repetitions (nTimes) to assess the potential impact of edge length swapping on the chosen index.

Usage

evalTerminal(
  tree = tree,
  distribution = distribution,
  tipToEval = "taxB",
  approach = "lower",
  root = FALSE,
  index = "PD",
  maxMultiplier = 1.01,
  redondeo = 2,
  verbose = FALSE
)

Arguments

tree

A phylogenetic tree object (e.g., from the 'ape' package).

distribution

A labeled matrix object representing the distribution of

root

A logical value indicating whether to use the root edge in the swapping #' process (default: TRUE).

verbose

A logical value indicating whether to print progress information during the execution (default: TRUE).

model

The type of edge swapping to perform: * "simpleswap": Swaps the lengths of two randomly selected edges. * "allswap": Swaps the lengths of all possible edge pairs (computationally * "uniform": Randomly assigns new edge lengths from a uniform distribution

nTimes

The number of repetitions to perform for the chosen swapping model.

Value

A list containing the following elements: * initialPD: The initial value of the chosen index (e.g., PD) calculated for the original tree. * bestInitialArea: The area with the highest value in the initial PD calculation. * bestModifiedArea: A data frame summarizing the results of each repetition, including the modified PD, selected area, and delta (percentage change) compared to the initial area. * tree: The original tree object. * distribution: The original distribution matrix. * model: The model used for edge swapping. * nTimes: The number of repetitions performed. * root: The logical value indicating whether the root edge was included in swapping. * index: The index used for evaluation (e.g., "PD").

Author(s)

Miranda-Esquivel Daniel R.

Examples

library(blepd)  # Assuming blepd provides PDindex function
data(tree)
data(distribution)

# Run swapBL with different models
result1 <- swapBL(tree, distribution, model = "simpleswap", nTimes = 10)
result2 <- swapBL(tree, distribution, model = "allswap", nTimes = 10)
result3 <- swapBL(tree, distribution, model = "uniform", nTimes = 10)

# Print information from the results
print(result1)
print(result2)
print(result3)


Dmirandae/blepd documentation built on April 2, 2024, 12:24 p.m.