scaleTreeRates: Phylogeneitc analysis of heterogeneity in discrete character...

View source: R/scaleTreeRates.R

scaleTreeRatesR Documentation

Phylogeneitc analysis of heterogeneity in discrete character evolution

Description

This function performs the phylogenetic methods for analysis of heterogenity in rates of discrete character evolution described in Jonika et al. (2023).

Usage

scaleTreeRates(tree, tip.states, model, fixedQ = NULL, 
               max.ratio = 2, nbins = 10, max.transition = 1, 
               var.start = FALSE, pi = "fitzjohn")

Arguments

tree

a tree of class phylo

tip.states

a named vector of tip states for some discrete character which is associated with the phylogeny. Order can differ from order of tips on phylogeny

model

the model which should be used to perform likelihod calculations. This can either be a string which can be passed to the fitMk function of phytools or a symmetrical transition matrix which has transitions between states categorized into some number of distinct classes

fixedQ

optional argument to be used when Q-matrix with pre-estimated rates is available. Deafults to NULL

max.ratio

num or int greater than one descirbing the maximum ratio of scalar bins to one. Defaults to 2, i.e. scalar bins range between 0.5 and 2

nbins

int giving the number of scalar bins above and below 1. Defaults to 10, i.e. 10 bins below 1 and 10 bins above 1 for a total of 21 bins inclusive of 1

max.transition

int giving the maximum number of bins which the scalar associated with an edge can differ from the scalar associated with it's parent edge. Defaults to 1

var.start

logical whether or not to increment scalar values at the root of the tree. If TRUE, the analysis will be iterated across all pssible root scalar values and the best tree (highest likelihood) returned. If FALSE (default), root scalar is set to one and only a single iteration is performed

pi

string giving method to be used for estimating prior. Takes any option which can be passed to phytool's fitMk, defaults to "fitzjohn"

Value

A phylogeny of class phylo and phyloscaled. Phylogeny has all elements normally included in an object of class phylo, with an additional element:

scalar

a numeric vector of scalars equal in length to the number of edges in phylogeny. Ordering of scalars is identical to the ordering of edges

Author(s)

Maximos Chin and Heath Blackmon

References

http://coleoguy.github.io/


coleoguy/evobir documentation built on July 27, 2023, 12:40 p.m.