collectTerms {goCluster} | R Documentation |
The function will parse a tree (list of lists) and extract the names of items in all leaves of the tree that are named "annot". A tree with the same structure is returned but the leaves are either removed or replaced by the names of the items they contained.
collectTerms(tree)
tree |
A tree that contains list that are named "annot". |
A tree with leaves that only hold the names of items of the original tree.
Gunnar Wrobel, work@gunnarwrobel.de, http://www.gunnarwrobel.de.
namedv1 <- c(0.1,0.1,0.1) names(namedv1) <- c("AnnoA","AnnoB","AnnoC") namedv2 <- c(0.1,0.1,0.1) names(namedv2) <- c("AnnoD","AnnoE","AnnoF") a <- list(list(annot = list(namedv1,namedv2), group = 1), list(annot = list(namedv2,namedv1), group = 1)) collectTerms(a)