m_process_recon: Prepare MuHiSSE marginal reconstruction for plotting

Description Usage Arguments Details Examples

View source: R/utilhisse.R

Description

A function to process the output from hisse::MarginReconMuHiSSE. First we get model averaged rates for tips and nodes of the phylogeny and probabilities from the ancestral reconstruction of character states. Then convert the tree from phylo format into a treedata class and assign the data.frame of mode-averaged rates to the @data slot. We output the node and tip rates tables and the reformated tree object for downstream plotting with ggtree and ggplot.

Usage

1
m_process_recon(muhisse_recon)

Arguments

muhisse_recon

An object produced by hisse::MarginReconMuHiSSE, or a list of such objects over which we can model-average using hisse::GetModelAveRates

Details

Internally, the probabilities for individual states (00, 01, 10, 11) are converted into prob_0x giving the probability for the first character being 0, and prob_x0 giving the probability of the second character being 0. This way we can plot in terms of a 'focal character', i.e., we can plot the rate on the y axis and the probability of being 0 for the 'focal character' on the x axis while color-coding by the states of both characters.

#'@return A list with three components:

Examples

1
2
3
4
5
data("diatoms")
processed_muhisse <- m_process_recon(muhisse_recon=diatoms$muhisse_recon)
processed_muhisse$tip_rates
processed_muhisse$node_rates
processed_muhisse$tree_data

teofiln/utilhisse documentation built on Sept. 3, 2020, 2:55 p.m.