getAllResiduals: main RER computation function

View source: R/RERfuncs.R

getAllResidualsR Documentation

main RER computation function

Description

main RER computation function

Usage

getAllResiduals(
  treesObj,
  cutoff = NULL,
  transform = "sqrt",
  weighted = T,
  useSpecies = NULL,
  min.sp = 10,
  scale = T,
  doOnly = NULL,
  maxT = NULL,
  scaleForPproj = F,
  mean.trim = 0.05,
  plot = T
)

Arguments

treesObj

A treesObj created by readTrees

transform

The transformation to apply to the trees branch values before computing relative rates. Available options are sqrt and log, sqrt is recommended.

weighted

Use weighted regression to compute relative rates, meant to correct for the non-constant mean-variance relationship in evolutionary rate data.

useSpecies

Give only a subset of the species to use for RER calculation. Some times excluding unusually long branches can provide more stable results

min.sp

The minimum number of species needed to compute RER

scale

Scale relative rates internally for each species subset. Increases computation time with little apparent benefit. Better to scale the final matrix.

doOnly

The index of a specific tree in the treesObj to calculate RER for. Useful if a single result is needed quickly.

maxT

The maximum number of trees to compute results for. Since this function takes some time this is useful for debugging.

plot

Whether to plot the output of the correction for mean-variance relationship.

a

cutoff value for branch lengths bellow which the branch lengths will be discarded, very data dependent but should roughly correspond to 0 or 1 sequence change on that branch. If left NULL this whill be set to the bottom 0.05 quantile. Set to 0 for no cutoff.

Value

A numer of trees by number of paths matrix of relative evolutionary rates. Only an independent set of paths has non-NA values for each tree.


nclark-lab/RERconverge documentation built on March 2, 2024, 8:51 a.m.