LineageHomology_w_uncertainty_v2: LineageHomology_w_uncertainty_v2

View source: R/LineageHomology.R

LineageHomology_w_uncertainty_v2R Documentation

LineageHomology_w_uncertainty_v2

Description

LineageHomology_w_uncertainty_v2 returns the same outputs as LineageHomology. This is the same function as LineageHomology_w_uncertainty but faster. LineageHomology counts transmission lineages according to state transitions between ancestral and descendant nodes that have a probability higher than 50 percent. LineageHomolog_w_uncertainty instead samples states from the posterior probability of states (that is usually included in a phylogeographical consensus tree) for each node. Thus, the transmission lineage division is probabilistic and retains the uncertainty in the posterior distribution if the function is run multiple times, e.g., using base::replicate().

Usage

LineageHomology_w_uncertainty_v2(
  tree,
  ace_nodes,
  ace_tips,
  give_tips = NA,
  start_time = NA
)

Arguments

tree

Phylogenetic tree

ace_nodes

Node probabilities in ace format

ace_tips

Tip probabilities in ace format

give_tips

Constrain the computations to a set of tips, e.g. all the names of the tips in a certain state (e.g. one specific geographical location).

start_time

Date of root in the phylogeny.

Examples

## Not run: 
multi_counts = pbreplicate(
  100,
  LineageHomology::LineageHomology_w_uncertainty_v2(
    tree,
    ace_nodes = test$lik.anc,
    give_tips = Norwegian_tips,
    ace_tips = to.matrix(Locations, seq = c("Norway", "RoW")),
    start_time = start_date
  )
)

## End(Not run)


magnusnosnes/LineageHomology documentation built on April 17, 2025, 6:30 p.m.