File: as.bitsplits.Rd

package info (click to toggle)
r-cran-ape 5.8-1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,676 kB
  • sloc: ansic: 7,676; cpp: 116; sh: 17; makefile: 2
file content (75 lines) | stat: -rw-r--r-- 2,820 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
\name{as.bitsplits}
\alias{as.bitsplits}
\alias{as.bitsplits.prop.part}
\alias{print.bitsplits}
\alias{sort.bitsplits}
\alias{bitsplits}
\alias{countBipartitions}
\alias{as.prop.part}
\alias{as.prop.part.bitsplits}
\title{Split Frequencies and Conversion Among Split Classes}
\description{
  \code{bitsplits} returns the bipartitions (aka splits) for a single
  tree or a list of trees. If at least one tree is rooted, an error is
  returned.

  \code{countBipartitions} returns the frequencies of the bipartitions
  from a reference tree (phy) observed in a list of trees (X), all unrooted.

  \code{as.bitsplits} and \code{as.prop.part} are generic functions for
  converting between the \code{"bitsplits"} and \code{"prop.part"}
  classes.
}
\usage{
bitsplits(x)
countBipartitions(phy, X)
as.bitsplits(x)
\method{as.bitsplits}{prop.part}(x)
\method{print}{bitsplits}(x, ...)
\method{sort}{bitsplits}(x, decreasing = FALSE, ...)
as.prop.part(x, ...)
\method{as.prop.part}{bitsplits}(x, include.trivial = FALSE, ...)
}
\arguments{
  \item{x}{an object of the appropriate class.}
  \item{phy}{an object of class \code{"phylo"}.}
  \item{X}{an object of class \code{"multiPhylo"}.}
  \item{decreasing}{a logical value to sort the bipartitions in
    increasing (the default) or decreasing order of their frequency.}
  \item{include.trivial}{a logical value specifying whether to include
    the trivial split with all tips in the returned object.}
  \item{\dots}{further arguments passed to or from other methods.}
}
\details{
  These functions count bipartitions as defined by internal branches, so
  they work only with unrooted trees. The structure of the class
  \code{"bitsplits"} is described in a separate document on ape's web
  site.

  This data structure has a memory requirement proportional to
  \eqn{n^2}, so it can be inefficient with large trees (> 1000 tips),
  particularly if they are very different (i.e., with few shared
  splits). In any case, an error occurs if the product of the number of
  tips by the number of nodes is greater than \eqn{2^{31}-1} (~2.1
  billion). A warning message is given if the tree(s) has(ve) more than
  46,341 tips. It may happen that the search for splits is interrupted
  if the data structure is full (with a warning message).
}
\value{
  \code{bitsplits}, \code{as.bitsplits}, and \code{sort} return an object
  of class \code{"bitsplits"}.

  \code{countBipartitions} returns a vector of integers.

  \code{as.prop.part} returns an object of class \code{"prop.part"}.
}
\author{Emmanuel Paradis}
\seealso{\code{\link{prop.part}}, \code{\link{is.compatible}}}
\examples{
tr <- rtree(20)
pp <- prop.part(tr)
as.bitsplits(pp)
## works only with unrooted trees (ape 5.5):
countBipartitions(rtree(10, rooted = FALSE), rmtree(100, 10, rooted = FALSE))
}
\keyword{manip}