Split Frequencies and Conversion Among Split Classes

Share:

Description

bitsplits returns the bipartitions (aka splits) for a single tree or a list of trees.

countBipartitions returns the frequencies of the bipartitions from a reference tree (phy) observed in a list of trees (X).

as.bitsplits and as.prop.part are generic functions for converting between the "bitsplits" and "prop.part" classes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
bitsplits(x)
countBipartitions(phy, X)
as.bitsplits(x)
## S3 method for class 'prop.part'
as.bitsplits(x)
## S3 method for class 'bitsplits'
print(x, ...)
## S3 method for class 'bitsplits'
sort(x, decreasing = FALSE, ...)
as.prop.part(x)
## S3 method for class 'bitsplits'
as.prop.part(x)

Arguments

x

an object of the appropriate class.

phy

an object of class "phylo".

X

an object of class "multiPhylo".

decreasing

a logical value to sort the bipartitions in increasing (the default) or decreasing order of their frequency.

...

further arguments passed to or from other methods.

Details

These functions count bipartitions as defined by internal branches, so they do not work with rooted trees (see examples). The structure of the class "bitsplits" is described in a separate document on ape's web site.

Value

bitsplits, as.bitsplits, and sort return an object of class "bitsplits".

countBipartitions returns a vector of integers.

as.prop.part returns an object of class "prop.part".

Author(s)

Emmanuel Paradis

See Also

prop.part

Examples

1
2
3
4
5
6
7
tr <- rtree(20)
pp <- prop.part(tr)
as.bitsplits(pp)
## doesn't work for rooted trees...:
countBipartitions(rtree(10), rmtree(100, 10))
## ... but OK with unrooted trees:
countBipartitions(rtree(10, rooted = FALSE), rmtree(100, 10, rooted = FALSE))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.