For convenience, a few functions are available to convert BIOM, DADA2 and phyloseq objects to TreeSummarizedExperiment objects, and TreeSummarizedExperiment objects to phyloseq objects.

convertFromBIOM(
  x,
  prefix.rm = removeTaxaPrefixes,
  removeTaxaPrefixes = FALSE,
  rank.from.prefix = rankFromPrefix,
  rankFromPrefix = FALSE,
  artifact.rm = remove.artifacts,
  remove.artifacts = FALSE,
  ...
)

convertToBIOM(x, assay.type = "counts", ...)

# S4 method for class 'SummarizedExperiment'
convertToBIOM(x, assay.type = "counts", ...)

Arguments

x

TreeSummarizedExperiment

prefix.rm

Logical scalar. Should taxonomic prefixes be removed? The prefixes is removed only from detected taxa columns meaning that rank.from.prefix should be enabled in the most cases. (Default: FALSE)

removeTaxaPrefixes

Deprecated. Use prefix.rm instead.

rank.from.prefix

Logical scalar. If file does not have taxonomic ranks on feature table, should they be scraped from prefixes? (Default: FALSE)

rankFromPrefix

Deprecated.Use rank.from.prefix instead.

artifact.rm

Logical scalar. If file have some taxonomic character naming artifacts, should they be removed. (default (Default: FALSE)

remove.artifacts

Deprecated. Use artifact.rm instead.

...

Additional arguments. Not used currently.

assay.type

Character scaler. The name of assay. (Default: "counts")

Value

convertFromBIOM returns an object of class TreeSummarizedExperiment

Details

convertFromBIOM coerces a biom object to a TreeSummarizedExperiment object.

convertToBIOM coerces a TreeSummarizedExperiment object to a biom object.

Examples


# Convert BIOM results to a TreeSE
# Load biom file
library(biomformat)
biom_file <- system.file("extdata", "rich_dense_otu_table.biom",
                         package = "biomformat")

# Make TreeSE from BIOM object
biom_object <- biomformat::read_biom(biom_file)
tse <- convertFromBIOM(biom_object)

# Convert TreeSE object to BIOM
biom <- convertToBIOM(tse)