Learn R Programming

phyloTop (version 1.1.1)

configurations: Configurations in Trees

Description

A collection of functions for examining configurations in trees. A configuration of size n is a subtree with n tips. So a cherry (for example) is a 2-configuration. Note that not all of these functions return tolological properties of the trees. For example, configFind can give very different results for two trees with the same topology.

Usage

nConfig(tree,configSize)
configFind(tree,configSize)
configTop(tree)
classifyConfigFour(tree)
classifyConfigFive(tree)

Arguments

tree
An object of class phylo4
configSize
An integer specifying the size of configuration for which to search

Value

  • nConfigAn integer - the number of configurations of the specified size in the tree.
  • configSizeAn integer vector of length given by the number of configuratios of the specified size.
  • configTopAn integer vector of length given by the number of tips of the tree.
  • classifyConfigFourA data frame with one row and two columns with headers specifying which type is which.
  • classifyConfigFiveA data frame with one row and three columns with headers specifying which type is which.

Details

nConfig (number of configurations) finds the number of configurations of the specified size in the tree. This function (and many of those listed below) use nTipDescendants. configFind returns a vector with each element being the nodeId of the root of a configuration of the specified size. That is, it gives all the nodes which have the specified number of tip descendants. configTop returns a vector giving the number of n-congigurations for each n for which one could exist. If there are t tips then there is always one configuration of size t (the whole tree) and t configurations of size one (the tips). So the vector is length t. Note that this is a topological property and is very useful for distinguishing trees with many tips. classifyConfigFour gives the number of each of the different types of configurations of size four. There are two such types one called laddType and the other branchType. There are many ways in which they are topologically different - this function uses the number of tip children of the root. laddType has only one while the other has none. classifyConfigFour works similarly but except it looks at configurations size 5. Here there are three types. It first seperates by number of tip children of the root (one has none and is called branchType) and then by size of ladder from the root (the type with a longer ladder is laddType and the other is fourType as there is a 4-1 split at the top).

See Also

configShow for a function which plots the tree highlighting configurations of a given size. treeAnalysis for more functions examining topological properties of trees. nTipDescendants.

Examples

Run this code
## Creates a random tree of class phylo4 and plots it with nodes labelled by ID
tree <- rtree4(50)
tree <- idNodeLabel(tree)
plot(tree,show.tip.label=FALSE,show.node.label=TRUE)

## Finds the number of cherries (also called 2-configurations) in the tree
nConfig(tree,2)

## Gives you the nodeId of the roots of the cherries
configFind(tree,2)

## Finds the complete configuration profile of the tree
configTop(tree)

## Classifies the configurations of size four...
classifyConfigFour(tree)

##...and the configurations of size five
classifyConfigFive(tree)

Run the code above in your browser using DataLab