This function annotates a phylogenetic tree with copy number variation (CNV) events. It identifies
significant CNV events in the provided matrix, links them to clones and ancestral nodes, and
updates the tree with this information.
Usage
annotateCNVtree(tree, cnv_mat, cnv_thresh = 0.15)
Arguments
- tree
A phylogenetic tree (of class phylo
) that will be annotated.
- cnv_mat
A matrix of copy number variation (CNV) values, with samples as rows and regions as columns.
- cnv_thresh
A numeric threshold to filter significant CNV events. Default is 0.2.
Value
A data frame with the tree data, including annotations for CNV events.
Examples
cnv_matrix <- structure(c(0.2, 0.4, 0, 0, 0.1, 0, 0.1, 0.2, 0.2), dim = c(3L,
3L), dimnames = list(c("Clone 1", "Clone 2", "Clone 3"), c("Region 1",
"Region 2", "Region 3")))
tree <- CNVtree(cnv_matrix)
tree_data <- annotateCNVtree(tree, cnv_matrix)
#> Joining with `by = join_by(node, label)`