compute_fitch {MethEvolSIM} | R Documentation |
Compute Fitch Parsimony for Methylation Categories
Description
This function applies Fitch parsimony to determine the minimum number of changes required for methylation categories at tree tips.
Usage
compute_fitch(tree, meth, input_control = TRUE)
Arguments
tree |
A rooted binary tree in Newick format (character string) or as an |
meth |
A matrix of methylation categories at the tree tips, with rows corresponding to tips (names matching tree tip labels) and columns corresponding to sites or structures. |
input_control |
Logical; if |
Value
A list containing:
optStateSet
A list of sets of optimal states for the root at each site/structure.
minChange_number
A numeric vector indicating the minimum number of changes for each site.
Examples
tree <- "((a:1,b:1):2,(c:2,d:2):1.5);"
meth <- matrix(c("u", "m", "p", "u", "p", "m", "m", "u"),
nrow=4, byrow=TRUE, dimnames=list(c("a", "b", "c", "d")))
compute_fitch(tree, meth)
[Package MethEvolSIM version 0.2.1 Index]