read.tree
(Newick-format) and
read.nexus
(Nexus-format) importers provided by
the ape-package
. This function attempts to return a valid
tree if possible using either format importer. If it fails, it silently
returns NULL
by default, rather than throwing a show-stopping error.read_tree(treefile, errorIfNULL=FALSE, ...)
connection
(like a path or URL), or an actual connection
.
Must be a Newick- or Nexus-formatted tree.FALSE
, indicating that NULL
will be
SILENTLY returned, rather than an error.
Be cautious about this behavior. Useful for phyloseq internals, but might
be hard to track in your own code if you're not aware of this
``no error by default'' setting. If this is a problem, change this value
to TRUE
, and you can still use the function.phylo
-class object as defined
in the ape-package
. Returns NULL if neither tree-reading function worked.read_tree_greengenes
read_tree(system.file("extdata", "esophagus.tree.gz", package="phyloseq"))
read_tree(system.file("extdata", "GP_tree_rand_short.newick.gz", package="phyloseq"))
Run the code above in your browser using DataLab