Tree Bipartition and Bootstrapping Phylogenies
These functions analyse bipartitions found in a series of trees.
prop.part counts the number of bipartitions found in a series
of trees given as
.... If a single tree is passed, the
returned object is a list of vectors with the tips descending from
each node (i.e., clade compositions indexed by node number).
prop.clades counts the number of times the bipartitions present
phy are present in a series of trees given as
in the list previously computed and given with
boot.phylo performs a bootstrap analysis.
boot.phylo(phy, x, FUN, B = 100, block = 1, trees = FALSE, quiet = FALSE) prop.part(..., check.labels = TRUE) prop.clades(phy, ..., part = NULL) ## S3 method for class 'prop.part': print(x, ...) ## S3 method for class 'prop.part': summary(object, ...) ## S3 method for class 'prop.part': plot(x, barcol = "blue", leftmar = 4, ...)
- an object of class
- in the case of
boot.phylo: a taxa (rows) by characters (columns) matrix; this may be presented as a list; in the case of
plot: an object of class
- the function used to estimate
- the number of bootstrap replicates.
- the number of columns in
xthat will be resampled together (see details).
- a logical specifying whether to return the bootstraped
- a logical: a progress bar is displayed by default.
- either (i) a single object of class
"phylo", (ii) a series of such objects separated by commas, or (iii) a list containing such objects. In the case of
plotfurther arguments for the plot (see details).
- a logical specifying whether to check the labels
of each tree. If
FALSE, it is assumed that all trees have the same tip labels, and that they are in the same order (see details).
- a list of partitions as returned by
prop.part; if this is used then
- an object of class
- the colour used for the bars displaying the number of partitions in the upper panel.
- the size of the margin on the left to display the tip labels.
boot.phylo must be the function used
to estimate the tree from the original data matrix. Thus, if the tree
was estimated with neighbor-joining (see
nj), one maybe wants
FUN = function(xx) nj(dist.dna(xx)).
boot.phylo specifies the number of columns to
be resampled altogether. For instance, if one wants to resample at the
block = 3 must be used.
check.labels = FALSE in
computing times. This requires that (i) all trees have the same tip
labels, and (ii) these labels are ordered similarly in all
trees (in other words, the element
tip.label are identical in
The plot function represents a contingency table of the different
partitions (on the x-axis) in the lower panel, and their observed
numbers in the upper panel. Any further arguments (...) are used to
change the aspects of the points in the lower panel: these may be
cex, etc. This function
works only if there is an attribute
labels in the object.
The print method displays the partitions and their numbers. The summary method extracts the numbers only.
prop.partreturns an object of class
"prop.part"which is a list with an attribute
"number". The elements of this list are the observed clades, and the attribute their respective numbers. If the default
check.labels = FALSEis used, an attribute
"labels"is added, and the vectors of the returned object contains the indices of these labels instead of the labels themselves.
boot.phyloreturn a numeric vector which ith element is the number associated to the ith node of
trees = TRUE,
boot.phyloreturns a list whose first element (named
"BP") is like before, and the second element (
"trees") is a list with the bootstraped trees.
summaryreturns a numeric vector.
prop.clades calls internally
prop.part with the option
check.labels = TRUE, which may be very slow. If the trees
... fulfills conditions (i) and (ii) above, then it
might be faster to first call, e.g.,
pp <- prop.part(...), then
use the option
prop.clades(phy, part = pp).
Efron, B., Halloran, E. and Holmes, S. (1996) Bootstrap confidence levels for phylogenetic trees. Proceedings of the National Academy of Sciences USA, 93, 13429--13434.
Felsenstein, J. (1985) Confidence limits on phylogenies: an approach using the bootstrap. Evolution, 39, 783--791.
data(woodmouse) f <- function(x) nj(dist.dna(x)) tr <- f(woodmouse) ### Are bootstrap values stable? for (i in 1:5) print(boot.phylo(tr, woodmouse, f, quiet = TRUE)) ### How many partitions in 100 random trees of 10 labels?... TR <- replicate(100, rtree(10), FALSE) pp10 <- prop.part(TR) length(pp10) ### ... and in 100 random trees of 20 labels? TR <- replicate(100, rtree(20), FALSE) pp20 <- prop.part(TR) length(pp20) plot(pp10, pch = "x", col = 2) plot(pp20, pch = "x", col = 2)