read_tree_greengenes: Read GreenGenes tree released in annotated newick format

Description Usage Arguments Value Examples

View source: R/IO-methods.R

Description

In principal, this is a standard newick format, that can be imported into R using read_tree, which in-turn utilizes read.tree. However, read.tree has failed to import recent (October 2012 and later) releases of the GreenGenes tree, and this problem has been traced to the additional annotations added to some internal nodes that specify taxonomic classification between single-quotes. To solve this problem and create a clear container for fixing future problems with the format of GreenGenes-released trees, this function is available in phyloseq and exported for users. It is also referenced in the documentation of the import functions for QIIME legacy and BIOM format importers – import_qiime and import_biom, respectively. However, since the precise format of the tree is not restricted to GreenGenes trees by QIIME or for the biom-format, this function is not called automatically by those aforementioned import functions. If your tree is formatted like, or is one of, the official GreenGenes release trees, then you should use this function and provide its output to your relevant import function.

Usage

1

Arguments

treefile

(Required). A character string implying a file connection (like a path or URL), or an actual connection. Must be a Newick–formatted tree released by GreenGenes in October 2012 or later. The similarity threshold of the OTUs should not matter, except that it should match your OTU table.

Value

A tree, represented as a phylo object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Read the May 2013, 73% similarity official tree,
# included as extra data in phyloseq.
treefile = system.file("extdata", "gg13-5-73.tree.gz", package="phyloseq")
x = read_tree_greengenes(treefile)
x
class(x)
y = read_tree(treefile)
y
class(y)
## Not run, causes an error:
# library("ape")
# read.tree(treefile)

Example output

Phylogenetic tree with 267 tips and 266 internal nodes.

Tip labels:
	4366536, 4312504, 256207, 3761685, 593456, 201206, ...
Node labels:
	, 'k__Bacteria', , 'p__GN02', , , ...

Rooted; includes branch lengths.
[1] "phylo"
NULL
[1] "NULL"
Warning message:
system call failed: Cannot allocate memory 

phyloseq documentation built on Nov. 8, 2020, 6:41 p.m.