Skip to contents

Import a BIOM Table as a microbiome_dataset

Usage

import_biom(file, sample_info = NULL, variable_info = NULL, ...)

Arguments

file

A BIOM file path or a biomformat::biom object.

sample_info

Optional sample metadata table.

variable_info

Optional feature metadata table.

...

Passed to create_microbiome_dataset().

Value

A microbiome_dataset object.

Examples

if (requireNamespace("biomformat", quietly = TRUE)) {
  counts <- matrix(
    c(10, 0, 3, 8),
    nrow = 2,
    dimnames = list(c("OTU1", "OTU2"), c("Sample1", "Sample2"))
  )
  biom <- biomformat::make_biom(data = counts)
  x <- import_biom(biom)
  dim(x@expression_data)
}
#> [1] 2 2