read_nwka_nexus.Rd
This function reads a file containing one or more trees in NEXUS format. Each tree is parsed according to the Newick-with-Attributes (NWKA) format.
read_nwka_nexus(file, tree.names = NULL, force.multi = FALSE, debug = FALSE)
file | A file name. |
---|---|
tree.names | A vector of mode character containing names for the trees that are read from the file;
if |
force.multi | If |
debug | A logical value indicating whether to enable verbose debug output while parsing the tree. If this is |
An object of class "phylo"
or "multiPhylo"
, compatible with the ape
package.
In addition to the elements described in the documentation for the read.tree
function of the ape
package, a "phylo"
object produced by this function
will also have the following components:
tip.attributes
A named list of attributes for the tips of the tree. Each element of this list is a vector of mode character or numeric (depending on the attribute).
node.attributes
A named list of attributes for the internal nodes of the tree. Each element of this list is a vector of mode character or numeric (depending on the attribute).
Only the Trees
block of the NEXUS file is parsed.
Node attributes (e.g. support values, rates, ages...) are parsed by this function and returned in the
tip.attributes
and node.attributes
elements of the returned "phylo"
objects. If the nodes
contain a prob
attribute, its value will also be copied to the Support
attribute.
The translation table (if any) of the Trees
block is used to translate the names of both tips and internal
nodes. However, if the untranslated names of internal nodes are numbers, these may be interpreted as support
values (and thus, not translated).
Attribute names may appear in any kind of casing (e.g. Name
, name
or NAME
), but they
should be treated using case-insensitive comparisons.
Setting the debug
argument to TRUE
can be useful when analysing malformed trees (to understand
at which point in the tree the problem lies).
https://github.com/arklumpus/TreeNode/blob/master/NWKA.md
Other functions to read trees:
read_binary_trees()
,
read_nwka_tree()
,
read_one_binary_tree()