For convenience a few functions are available to convert data from a ‘biom’ file or object into a TreeSummarizedExperiment

importBIOM(file, ...)

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

makeTreeSummarizedExperimentFromBiom(x, ...)

Arguments

file

biom file location

...

additional arguments

  • patter: character value specifying artifacts to be removed. If patterns = "auto", special characters are removed. (default: pattern = "auto")

x

object of type biom

prefix.rm

TRUE or FALSE: 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 prefix.rm = FALSE)

removeTaxaPrefixes

Deprecated. Use prefix.rm instead.

rank.from.prefix

TRUE or FALSE: If file does not have taxonomic ranks on feature table, should they be scraped from prefixes? (default rank.from.prefix = FALSE)

rankFromPrefix

Deprecated.Use rank.from.prefix instead.

artifact.rm

TRUE or FALSE: If file have some taxonomic character naming artifacts, should they be removed. (default artifact.rm = FALSE)

remove.artifacts

Deprecated. Use artifact.rm instead.

Value

An object of class TreeSummarizedExperiment

Examples

# Load biom file
library(biomformat)
biom_file <- system.file("extdata", "rich_dense_otu_table.biom",
                         package = "biomformat")

# Make TreeSE from biom file
tse <- importBIOM(biom_file)

# Make TreeSE from biom object
biom_object <- biomformat::read_biom(biom_file)
tse <- makeTreeSEFromBiom(biom_object)

# Get taxonomyRanks from prefixes and remove prefixes
tse <- importBIOM(biom_file,
                    rank.from.prefix = TRUE,
                    prefix.rm = TRUE)

# Load another biom file
biom_file <- system.file("extdata/testdata", "Aggregated_humanization2.biom",
                         package = "mia")

# Clean artifacts from taxonomic data
tse <- importBIOM(biom_file,
                    artifact.rm = TRUE)