]> git.donarmstrong.com Git - ape.git/blob - man/as.matching.Rd
new code for reading FASTA files
[ape.git] / man / as.matching.Rd
1 \name{as.matching}
2 \alias{as.matching}
3 \alias{matching}
4 \alias{as.matching.phylo}
5 \alias{as.phylo.matching}
6 \title{Conversion Between Phylo and Matching Objects}
7 \description{
8   These functions convert objects between the classes \code{"phylo"} and
9   \code{"matching"}.
10 }
11 \usage{
12 as.matching(x, ...)
13 \method{as.matching}{phylo}(x, labels = TRUE, ...)
14 \method{as.phylo}{matching}(x, ...)
15 }
16 \arguments{
17   \item{x}{an object to convert as an object of class \code{"matching"}
18     or of class \code{"phylo"}.}
19   \item{labels}{a logical specifying whether the tip and node labels
20     should be included in the returned matching.}
21   \item{\dots}{further arguments to be passed to or from other methods.}
22 }
23 \details{
24   A matching is a representation where each tip and each node are given
25   a number, and sibling groups are grouped in a ``matching pair'' (see
26   Diaconis and Holmes 1998, for details). This coding system can be used
27   only for binary (fully dichotomous) trees.
28
29   Diaconis and Holmes (1998) gave some conventions to insure that a
30   given tree has a unique representation as a matching. I have tried to
31   follow them in the present functions.
32 }
33 \value{
34   \code{as.matching} returns an object of class \code{"matching"} with
35   the following component:
36
37   \item{matching}{a two-column numeric matrix where the columns
38     represent the sibling pairs.}
39   \item{tip.label}{(optional) a character vector giving the tip labels
40     where the ith element is the label of the tip numbered i in
41     \code{matching}.}
42   \item{node.label}{(optional) a character vector giving the node
43     labels in the same order than in \code{matching} (i.e. the ith
44     element is the label of the node numbered i + n in \code{matching},
45     with n the number of tips).}
46
47   \code{as.phylo.matching} returns an object of class \code{"phylo"}.
48 }
49 \note{
50   Branch lengths are not supported in the present version.
51 }
52 \author{Emmanuel Paradis}
53 \references{
54   Diaconis, P. W. and Holmes, S. P. (1998) Matchings and phylogenetic
55   trees. \emph{Proceedings of the National Academy of Sciences USA},
56   \bold{95}, 14600--14602.
57 }
58 \seealso{\code{\link{as.phylo}}}
59 \examples{
60 data(bird.orders)
61 m <- as.matching(bird.orders)
62 str(m)
63 m
64 tr <- as.phylo(m)
65 all.equal(tr, bird.orders, use.edge.length = FALSE)
66 }
67 \keyword{manip}