computeFitch_islandGlbSt {MethEvolSIM} | R Documentation |
Compute Fitch Parsimony for Global Methylation States at CpG Islands
Description
This function categorizes CpG islands into methylation states and applies Fitch parsimony to estimate the minimum number of state changes in a phylogenetic tree.
Usage
computeFitch_islandGlbSt(
index_islands,
data,
tree,
u_threshold,
m_threshold,
testing = FALSE
)
Arguments
index_islands |
A numeric vector specifying the indices of genomic structures corresponding to islands. |
data |
A list containing methylation states at tree tips, structured as |
tree |
A rooted binary tree in Newick format (character string) or as an |
u_threshold |
A numeric threshold value (0-1) defining the unmethylated category. |
m_threshold |
A numeric threshold value (0-1) defining the methylated category. |
testing |
Logical; if |
Details
The function first validates the input data and categorizes CpG islands using categorize_islandGlbSt
.
It then structures the data into a matrix matching tree tip labels and applies compute_fitch
to infer the minimum number of changes.
Value
If testing = TRUE
, returns a list containing the categorized data matrix; otherwise,
returns a numeric vector of minimum state changes.
Examples
tree <- "((a:1,b:1):2,(c:2,d:2):1.5);"
data <- list(
list(rep(1,10), rep(0,5), rep(1,8)),
list(rep(1,10), rep(0.5,5), rep(0,8))
)
index_islands <- c(1,3)
computeFitch_islandGlbSt(index_islands, data, tree, 0.2, 0.6)