View source: R/custom_branch.R
custom_branch | R Documentation |
Bind PUTs to customized sets of phylogenetic edges
custom_branch(
tree,
edges,
rand.type = "random",
forceultrametric = FALSE,
prob = TRUE
)
tree |
backbone tree of class phylo. |
edges |
matrix with five columns (character vectors). Each row defines a set of consecutive edges between two nodes, and multiple rows can be used for the same PUT. Column 1 includes the PUTs. Columns 2 and 3 include a pair of species whose MRCA defines the older node, whereas the MRCA of the species in columns 4 and 5 defines the younger node. Using the same species in columns 4 and 5 will define a terminal node as the younger node. If columns 2-3 are filled with a species and columns 4-5 are filled with another species, then all edges below the MRCA of the two species will be set as candidates. If the four columns are filled with the same species, the PUT will be bound as sister to this species. |
rand.type |
"random" or "polytomy". Default is "random". |
forceultrametric |
Whether or not to force the backbone tree to be ultrametric (in case it is detected as non-ultrametric). Default is FALSE. |
prob |
Whether or not the probability for selecting edges must be proportional to their length. If FALSE (default is TRUE), all edges have equal probability. |
An expanded phylogeny.
Ignacio Ramos-Gutierrez, Rafael Molina-Venegas, Herlander Lima
#Create a 'edges' dataframe
cats.edges <- data.frame(
"PUT"= "Felis_catus",
"parent1"= "Felis_silvestris",
"parent2"= "Felis_silvestris",
"child1"= "Felis_silvestris",
"child2"= "Felis_silvestris")
#Bind the PUT to any of the candidate edges as defined in cats.edges
cats.expanded <- custom_branch(tree=cats,
edges=cats.edges, forceultrametric=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.