parse_phyloseq: Convert a phyloseq to taxmap

Description Usage Arguments Value See Also Examples

View source: R/parsers.R

Description

Converts a phyloseq object to a taxmap object.

Usage

1
parse_phyloseq(obj, class_regex = "(.*)", class_key = "taxon_name")

Arguments

obj

A phyloseq object

class_regex

A regular expression used to parse data in the taxon names. There must be a capture group (a pair of parentheses) for each item in class_key. See parse_tax_data for examples of how this works.

class_key

(character of length 1) The identity of the capturing groups defined using class_regex. The length of class_key must be equal to the number of capturing groups specified in class_regex. Any names added to the terms will be used as column names in the output. At least one "taxon_name" must be specified. Only "info" can be used multiple times. Each term must be one of those described below:

  • taxon_name: The name of a taxon. Not necessarily unique, but are interpretable by a particular database. Requires an internet connection.

  • taxon_rank: The rank of the taxon. This will be used to add rank info into the output object that can be accessed by out$taxon_ranks().

  • info: Arbitrary taxon info you want included in the output. Can be used more than once.

Value

A taxmap object

See Also

Other parsers: parse_edge_list, parse_greengenes, parse_mothur_tax_summary, parse_mothur_taxonomy, parse_newick, parse_phylo, parse_qiime_biom, parse_rdp, parse_silva_fasta, parse_ubiome, parse_unite_general

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 

# Install phyloseq to get example data
# source('http://bioconductor.org/biocLite.R')
# biocLite('phyloseq')

# Parse example dataset
library(phyloseq)
data(GlobalPatterns)
x <- parse_phyloseq(GlobalPatterns)

# Plot data
heat_tree(x,
          node_size = n_obs,
          node_color = n_obs,
          node_label = taxon_names,
          tree_label = taxon_names)


## End(Not run)

grunwaldlab/metacoder documentation built on Nov. 30, 2018, 7:53 p.m.