Skip to contents

The `mStat_import_dada2_as_data_obj` function acts as a bridge between DADA2 output and MicrobiomeStat, effectively enabling smooth data transition between the two. It accepts essential DADA2 outputs and converts them into a MicrobiomeStat compatible format for subsequent microbiome data analysis.

Usage

mStat_import_dada2_as_data_obj(
  seq_tab,
  tax_tab = NULL,
  sam_tab = NULL,
  phy_tree = NULL
)

Arguments

seq_tab

A sequence table from DADA2, where rows represent samples, and columns represent sequences (features). This table is crucial for subsequent MicrobiomeStat analyses.

tax_tab

(Optional) A taxonomy assignment table derived from DADA2. Each row corresponds to a feature (sequence), and each column corresponds to a different taxonomic rank. This table enriches the feature information.

sam_tab

(Optional) A sample metadata table. Each row corresponds to a sample, and each column provides different metadata attributes. This table enriches the sample information.

phy_tree

(Optional) A phylogenetic tree of class 'phylo'. This tree represents the phylogenetic relationships between features (sequences) and can be incorporated into certain analyses.

Value

A MicrobiomeStat data object, containing the following elements:

  • feature.tab: A matrix of the feature (sequence) table.

  • meta.dat: A data frame of the sample metadata.

  • feature.ann: A matrix of the feature (sequence) taxonomy annotations.

  • tree: A phylogenetic tree, if provided.

This object is readily accepted by MicrobiomeStat's downstream analysis functions.

Examples

if (FALSE) { # \dontrun{
 # library(Biostrings)
 # seq_tab <- readRDS(
 #   system.file(
 #       "extdata", "dada2_seqtab.rds",
 #       package = "microbiomeMarker"
 #   )
 # )
 # tax_tab <- readRDS(
 #   system.file(
 #       "extdata", "dada2_taxtab.rds",
 #       package = "microbiomeMarker"
 #   )
 # )
 # sam_tab <- read.table(
 #   system.file(
 #       "extdata", "dada2_samdata.txt",
 #       package = "microbiomeMarker"
 #   ),
 #   sep = "\t",
 #   header = TRUE,
 #   row.names = 1
 # )
 # data_obj <- mStat_import_dada2_as_data_obj(seq_tab = seq_tab,
 # tax_tab = tax_tab, sam_tab = sam_tab)

} # }