View source: R/impute_duplications.R
imputate_duplications | R Documentation |
Uses a simple algorithm to impute duplication events based on the terminal genes of the tree. An interior node is a duplication event if a specie has two or more leafs within its clade.
imputate_duplications(tree, species)
tree |
An object of class ape::phylo. |
species |
A character vector of length |
This function will take a vector of species and, based on that, assign duplication events throughout the interior nodes. An interior node is labeled as a duplication event if two or more of the leaves within it are from the same species.
A logical vector of length ape::Nnode(tree, internal.only = FALSE)
with TRUE
to indicate that the corresponding node is a duplication event.
The order matches that in the input tree.
# Data from PANTHER
path <- system.file("tree.tree", package="aphylo")
ptree <- read_panther(path)
# Extracting the species
sp <- gsub(".+[:]|[|].+", "" , ptree$tree$tip.label)
# Imputing duplications
imputate_duplications(ptree$tree, species = sp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.