annotations: A data.frame with annotations. The first column should be the gene id (see details).
types: A data.frame with types. Just like the annotations, the first column should be the gene id.
Returns
An object of class aphylo .
Details
Each row in the the annotations data frame passed to this function must have a unique row per gene, and one column per function (GO term). The id of each gene must match the labels in the tree object. Missing genes are annotated with NA (9).
In the case of types, while tips can also be annotated with a type, which should be either 0, duplication, or 1, speciation, only internal nodes are required. Tip types are ignored.
Examples
# Generating a test datasetset.seed(1371)x <- raphylo(20)# Extracting the tree and annotationstree <- x$tree
anno <- with(x, rbind(tip.annotation, node.annotation))anno <- data.frame(id = with(tree, c(tip.label, node.label)), anno)types <- data.frame(id = tree$node.label, x$node.type)# Creating a aphylo tree without node typesaphylo_from_data_frame(tree, anno)# Now including typesaphylo_from_data_frame(tree, anno, types)# Dropping some dataaphylo_from_data_frame(tree, anno[sample.int(nrow(anno),10),])