]> git.donarmstrong.com Git - ape.git/blob - man/MPR.Rd
correcting a bug in write.tree + error in MPR examples
[ape.git] / man / MPR.Rd
1 \name{MPR}
2 \alias{MPR}
3 \title{Most Parsimonious Reconstruction}
4 \description{
5   This function does ancestral character reconstruction by parsimony as
6   described in Hanazawa et al. (1995) and modified by Narushima and
7   Hanazawa (1997).
8 }
9 \usage{
10 MPR(x, phy, outgroup)
11 }
12 \arguments{
13   \item{x}{a vector of integers.}
14   \item{phy}{an object of class \code{"phylo"}; the tree must be
15     unrooted and fully dichotomous.}
16   \item{outgroup}{an integer or a character string giving the tip of
17     \code{phy} used as outgroup.}
18 }
19 \details{
20   Hanazawa et al. (1995) and Narushima and Hanazawa (1997) used Farris's
21   (1970) and Swofford and Maddison's (1987) framework to reconstruct
22   ancestral states using parsimony. The character is assumed to take
23   integer values. The algorithm finds the sets of values for each node
24   as intervals with lower and upper values.
25
26   It is recommended to root the tree with the outgroup before the
27   analysis, so plotting the values with \code{\link{nodelabels}} is
28   simple.
29 }
30 \value{
31   a matrix of integers with two columns named ``lower'' and ``upper''
32   giving the lower and upper values of the reconstructed sets for each
33   node.
34 }
35 \references{
36   Farris, J. M. (1970) Methods for computing Wagner trees.
37   \emph{Systematic Zoology}, \bold{19}, 83--92.
38
39   Hanazawa, M., Narushima, H. and Minaka, N. (1995) Generating most
40   parsimonious reconstructions on a tree: a generalization of the
41   Farris--Swofford--Maddison method. \emph{Discrete Applied
42     Mathematics}, \bold{56}, 245--265.
43
44   Narushima, H. and Hanazawa, M. (1997) A more efficient algorithm for
45   MPR problems in phylogeny. \emph{Discrete Applied Mathematics},
46   \bold{80}, 231--238.
47
48   Swofford, D. L. and Maddison, W. P. (1987) Reconstructing ancestral
49   character states under Wagner parsimony. \emph{Mathematical
50     Biosciences}, \bold{87}, 199--229.
51 }\author{Emmanuel Paradis}
52 \seealso{
53   \code{\link{ace}}, \code{\link{root}}, \code{\link{nodelabels}}
54 }
55 \examples{
56 ## the example in Narushima and Hanazawa (1997):
57 tr <- read.tree(text = "(((i,j)c,(k,l)b)a,(h,g)e,f)d;")
58 x <- c(1, 3, 0, 6, 5, 2, 4)
59 names(x) <- letters[6:12]
60 (o <- MPR(x, tr, "f"))
61 plot(tr)
62 nodelabels(paste("[", o[, 1], ",", o[, 2], "]", sep = ""))
63 tiplabels(x[tr$tip.label], adj = -2)
64 ## some random data:
65 x <- rpois(30, 1)
66 tr <- rtree(30, rooted = FALSE)
67 MPR(x, tr, "t1")
68 }
69 \keyword{models}