Phyloseq conversion to a ggplot-formatted table

Description

Convert the OTU table (+ metadata) to a format that can be easily plotted with phyloseq

Usage

1
2
phyloseq2table(physeq, include_sample_data = FALSE, sample_col_keep = NULL,
  include_tax_table = FALSE, tax_col_keep = NULL, control_expr = NULL)

Arguments

physeq

Phyloseq object

include_sample_data

Include sample_table information?

sample_col_keep

Which columns in the sample_data table to keep? Use NULL to keep all columns.

include_tax_table

Include tax_table information?

tax_col_keep

A vector for column names to keep. Use NULL to keep all columns.

control_expr

An expression for identifying which samples are controls. Control/non-control identification will be in the 'IS_CONTROL' column of the returned data.frame object.

Value

data.frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(physeq_S2D1)
# Including some columns from sample metadata
df_OTU = phyloseq2table(physeq_S2D1,
                        include_sample_data=TRUE,
                        sample_col_keep=c('Buoyant_density', 'Substrate', 'Day'))
head(df_OTU)

# Including some columns from sample metadata & taxonomy
df_OTU = phyloseq2table(physeq_S2D1,
                        include_sample_data=TRUE,
                        sample_col_keep=c('Buoyant_density', 'Substrate', 'Day'),
                        include_tax_table=TRUE)
head(df_OTU)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.