Skip to contents

The `mStat_import_biom_as_data_obj` function facilitates the conversion of a BIOM (Biological Observation Matrix) file to an mStat data object. This includes importing and parsing the relevant metadata, taxonomic information, and optionally a phylogenetic tree.

Usage

mStat_import_biom_as_data_obj(
  BIOMfilename,
  treefilename = NULL,
  parseFunction = parse_taxonomy_default,
  ...
)

Arguments

BIOMfilename

A character string specifying the path to the BIOM file, or a 'biom-class' object. This file contains the essential biological observation matrix and related metadata.

treefilename

(Optional) A character string specifying the path to the phylogenetic tree file, or a 'phylo' object. This file represents the phylogenetic tree associated with the biological observation. If not provided, the function continues without incorporating a phylogenetic tree.

parseFunction

A user-specified function for parsing the taxonomy from the metadata in the BIOM file. Default function is 'parse_taxonomy_default'.

...

Additional arguments passed to 'read_tree' function when reading the phylogenetic tree file.

Value

A list representing an mStat data object. The list includes the following elements:

  • feature.tab: A matrix that contains the biological observations (OTU table).

  • feature.ann: A matrix that contains parsed taxonomic annotations for each feature.

  • meta.dat: A data frame that contains metadata for each sample.

  • tree: A phylogenetic tree, if provided.

Details

This function reads a BIOM file, which typically contains a biological observation matrix and its related metadata. It also optionally accepts a phylogenetic tree file. It creates a list object that follows the mStat data object structure for subsequent analysis. If any of the required elements are missing in the BIOM file, warnings will be issued, but the function will continue to run. Please ensure the BIOM file and optional phylogenetic tree file are properly formatted for successful conversion.

References

The Biological Observation Matrix (BIOM) format or: how I learned to stop worrying and love the ome-ome. Daniel McDonald et al. GigaScience 2012.

Examples

if (FALSE) { # \dontrun{
  #library(biomformat)
  #rich_dense_biom <- system.file("extdata", "rich_dense_otu_table.biom",  package="phyloseq")
  #treefilename <- system.file("extdata", "biom-tree.phy",  package="phyloseq")
  #data.obj <- mStat_import_biom_as_data_obj(rich_dense_biom,
  #treefilename)
} # }