imputate_duplications {aphylo} | R Documentation |
Impute duplication events based on a vector of species
Description
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.
Usage
imputate_duplications(tree, species)
Arguments
tree |
An object of class ape::phylo. |
species |
A character vector of length |
Details
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.
Value
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.
Examples
# 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)
[Package aphylo version 0.3-3 Index]