]> git.donarmstrong.com Git - ape.git/blob - man/read.nexus.Rd
new code for reading FASTA files
[ape.git] / man / read.nexus.Rd
1 \name{read.nexus}
2 \alias{read.nexus}
3 \title{Read Tree File in Nexus Format}
4 \usage{
5 read.nexus(file, tree.names = NULL)
6 }
7 \arguments{
8   \item{file}{a file name specified by either a variable of mode character,
9     or a double-quoted string.}
10   \item{tree.names}{if there are several trees to be read, a vector of
11     mode character giving names to the individual trees (by default,
12     this uses the labels in the NEXUS file if these are present).}
13 }
14 \description{
15   This function reads one or several trees in a NEXUS file.
16 }
17 \details{
18   The present implementation tries to follow as much as possible the
19   NEXUS standard (but see the restriction below on TRANSLATION
20   tables). Only the block ``TREES'' is read; the other data can be read
21   with other functions (e.g., \code{\link{read.dna}},
22   \code{\link[utils]{read.table}}, \dots).
23
24   If a TRANSLATION table is present it is assumed that only the tip
25   labels are translated and they are all translated with integers
26   without gap. Consequently, if nodes have labels in the tree(s) they
27   are read as they are and not looked for in the translation table. The
28   logic behind this is that in the vast majority of cases, node labels
29   will be support values rather than proper taxa names. This is
30   consistent with \code{\link{write.nexus}} which translates only the
31   tip labels.
32
33   `read.nexus' tries to represent correctly trees with a badly
34   represented root edge (i.e. with an extra pair of parentheses). For
35   instance, the tree "((A:1,B:1):10);" will be read like "(A:1,B:1):10;"
36   but a warning message will be issued in the former case as this is
37   apparently not a valid Newick format. If there are two root edges
38   (e.g., "(((A:1,B:1):10):10);"), then the tree is not read and an error
39   message is issued.
40 }
41 \value{
42   an object of class \code{"phylo"} or of class \code{"multiPhylo"}.
43 }
44 \references{
45   Maddison, D. R., Swofford, D. L. and Maddison, W. P. (1997) NEXUS: an
46   extensible file format for systematic information. \emph{Systematic
47     Biology}, \bold{46}, 590--621.
48 }
49 \author{Emmanuel Paradis}
50 \seealso{
51   \code{\link{read.tree}}, \code{\link{write.nexus}},
52   \code{\link{write.tree}}, \code{\link{read.nexus.data}},
53   \code{\link{write.nexus.data}}
54 }
55 \keyword{manip}
56 \keyword{IO}