summary_matrix_to_phylo {datelife}R Documentation

Go from a summary matrix to an ultrametric phylo object.

Description

Go from a summary matrix to an ultrametric phylo object.

Usage

summary_matrix_to_phylo(
  summ_matrix,
  datelife_query = NULL,
  target_tree = NULL,
  total_distance = TRUE,
  use = "mean",
  ...
)

Arguments

summ_matrix

Any summary patristic distance matrix, such as the ones obtained with datelife_result_sdm_matrix() or datelife_result_median_matrix().

datelife_query

A datelifeQuery object, usually an output of make_datelife_query().

target_tree

A phylo object. Use this in case you want a specific backbone for the output tree.

total_distance

Whether the input summ_matrix stores total age distance (from tip to tip) or distance from node to tip. Default to TRUE, divides the matrix in half, if FALSE it will take it as is.

use

A character vector indicating what type of age to use for summary tree. One of the following:

"mean"

It will use the mean() of the node ages in summ_matrix.

"median"

It uses the stats::median() age of node ages in summ_matrix.

"min"

It will use the min() age from node ages in summ_matrix.

"max"

Choose this if you wanna be conservative; it will use the max() age from node ages in summ_matrix.

"midpoint"

It will use the mean of minimum age and maximum age.

...

Arguments passed on to summary_matrix_to_phylo_all

Details

It can take a regular patristic distance matrix, but there are simpler methods for that implemented in patristic_matrix_to_phylo().

Value

An ultrametric phylo object.


[Package datelife version 0.6.8 Index]