Description
Aggregating Trees.
Description
Aggregates a set of trees with the same leaves to create a consensus tree. The trees are typically obtained via hierarchical clustering, hence the hclust format is used to encode both the aggregated trees and the final consensus tree. The method is exact and proven to be O(nqlog(n)), n being the individuals and q being the number of trees to aggregate.
README.md
Rmergetrees
A package for fastly merging tree-like objects.
Install
devtools::install_github("AudreH/Rmergetrees")
nb_genes = 50
nb_indiv = 3
nb_trees = 10
list.trees = lapply(1:nb_trees, FUN = function(x){
set.seed(x)
data_mat = matrix(rnorm(nb_genes*nb_indiv), ncol = nb_indiv, nrow = nb_genes)
return(hclust(dist(data_mat)))
})
mergedTree = merge.trees(hc.list = list.trees)
plot(mergedTree_noStd, main = "noStd")