import_dada2: Convert the output of dada2 into phyloseq object

View source: R/process_import_dada2.R

import_dada2R Documentation

Convert the output of dada2 into phyloseq object

Description

Convert the output of dada2 into phyloseq object.

Usage

import_dada2(
  seq_tab,
  tax_tab = NULL,
  sam_tab = NULL,
  phy_tree = NULL,
  keep_taxa_rows = TRUE
)

Arguments

seq_tab

(Required). matrix-like, ASV table, the output of dada2::removeBimeraDenovo.

tax_tab

(Optional). matrix, taxonomy table, the output of dada2::assignTaxonomy or dada2::addSpecies.

sam_tab

(Optional). data.frame or phyloseq::sample_data, sample data.

phy_tree

(Optional). ape::phylo class or character represents the path of the tree file.

keep_taxa_rows

(Optional). logical. whether keep taxa in rows or not in the otu_table of the returned phyloseq object, default TRUE.

Details

The output of the dada2 pipeline is a feature table of amplicon sequence variants (an ASV table): A matrix with rows corresponding to samples and columns to ASVs, in which the value of each entry is the number of times that ASV was observed in that sample. This table is analogous to the traditional OTU table. Conveniently, taxa names are saved as ASV1, ASV2, ..., in the returned phyloseq object.

Value

phyloseq::phyloseq object hold the taxonomy info, sample metadata, number of reads per ASV.

Author(s)

Created by Yang Cao; modified by Hua Zou (5/14/2022 Shenzhen China)

Examples

## Not run: 
seq_tab <- readRDS(
  system.file("extdata", "dada2_seqtab.rds",
              package = "MicrobiomeAnalysis"))
tax_tab <- readRDS(
  system.file("extdata", "dada2_taxtab.rds",
              package = "MicrobiomeAnalysis"))
sam_tab <- read.table(
  system.file("extdata", "dada2_samdata.txt",
              package = "MicrobiomeAnalysis"),
  sep = "\t", header = TRUE, row.names = 1)
ps <- import_dada2(
   seq_tab = seq_tab,
   tax_tab = tax_tab,
   sam_tab = sam_tab)
ps

## End(Not run)


HuaZou/MicrobiomeAnalysis documentation built on Dec. 12, 2023, 10:37 a.m.