| check.morpho {dispRity} | R Documentation |
Check a morphological matrix consistency levels.
Description
Performs a fast check of the phylogenetic signal in a morphological matrix using parsimony.
Usage
check.morpho(
matrix,
orig.tree,
parsimony = "fitch",
first.tree = c(phangorn::dist.hamming, phangorn::NJ),
distance = phangorn::RF.dist,
...,
contrast.matrix,
verbose = FALSE
)
Arguments
matrix |
A discrete morphological matrix. |
orig.tree |
Optional, the input tree to measure the distance between the parsimony and the original tree. |
parsimony |
Either the parsimony algorithm to be passed to |
first.tree |
A list of functions to generate the first most parsimonious tree (default = |
distance |
Optional, if orig.tree is provided, the function to use for measuring distance between the trees (default = |
... |
Any additional arguments to be passed to the parsimony algorithm. |
contrast.matrix |
An optional contrast matrix. By default, the function recognises any character state token as different apart from |
verbose |
Whether to be verbose or not ( |
Details
The
first.treeargument must be a list of functions to be used in a cascade to transform the matrix (as aphyDatobject) into a tree using the functions iteratively. For example the defaultc(dist.hamming, NJ)will apply the following to the matrix:NJ(dist.hamming(matrix))
Value
Returns the parsimony score (using parsimony), the consistency and retention indices (using CI and RI) from the most parsimonious tree obtained from the matrix.
Can also return the topological distance from the original tree if provided.
Author(s)
Thomas Guillerme
See Also
sim.morpho, get.contrast.matrix, optim.parsimony
Examples
## Generating a random tree
random_tree <- rcoal(10)
## Generating a random matrix
random_matrix <- sim.morpho(random_tree, characters = 50, model = "ER",
rates = c(rgamma, 1, 1))
## Checking the matrix scores
check.morpho(random_matrix, orig.tree = random_tree)