phylo
object.Function patristic_matrix_to_phylo
is used inside summarize_datelife_result()
.
patristic_matrix_to_phylo(
patristic_matrix,
clustering_method = "nj",
fix_negative_brlen = TRUE,
fixing_method = 0,
ultrametric = TRUE,
variance_matrix = NULL
)
A rooted phylo
object.
A patristic matrix
A character vector indicating the method to construct the tree. Options are:
Neighbor-Joining method applied with ape::nj()
.
Unweighted Pair Group Method with Arithmetic Mean method applied
with phangorn::upgma()
.
An improved version of the Neighbor-Joining method applied with
ape::bionj()
.
Triangles method applied with ape::triangMtd()
Minimum Variance Reduction method applied with ape::mvr()
.
Boolean indicating whether to fix negative branch
lengths in resulting tree or not. Default to TRUE
.
A character vector specifying the method to fix branch lengths: "bladj", "mrbayes" or a number to be assigned to all branches meeting fixing_criterion
Boolean indicating whether to force ultrametric or not.
A variance matrix from a datelifeResult
object,
usually an output from datelife_result_variance_matrix()
.
Only used if clustering_method = "mvr"
.
We might add the option to insert a function as clustering_method
in the future.
Before, we had hard-coded the function to try Neighbor-Joining (NJ) first; if it
errors, it will try UPGMA.
Now, it uses NJ for a "phylo_all" summary, and we are using our own algorithm to
get a tree from a summary matrix.