read_pq: Read phyloseq object from multiple csv tables and a...

View source: R/dada_phyloseq.R

read_pqR Documentation

Read phyloseq object from multiple csv tables and a phylogenetic tree in Newick format.

Description

lifecycle-maturing

This is the reverse function of write_pq().

Usage

read_pq(
  path = NULL,
  taxa_are_rows = FALSE,
  sam_names = NULL,
  sep_csv = "\t",
  ...
)

Arguments

path

(required) a path to the folder to read the phyloseq object

taxa_are_rows

(default to FALSE) see ?phyloseq for details

sam_names

The name of the variable (column) in sam_data.csv to rename samples. Note that if you use write_phyloseq() function to save your physeq object, you may use sam_names = "X" to rename the samples names as before.

sep_csv

(default tabulation) separator for column

...

Other arguments passed on to utils::write.table() function.

Value

One to four csv tables (refseq.csv, otu_table.csv, tax_table.csv, sam_data.csv) and if present a phy_tree in Newick format. At least the otu_table.csv need to be present.

Examples

write_pq(data_fungi, path = paste0(tempdir(), "/phyloseq"))
read_pq(path = paste0(tempdir(), "/phyloseq"))
unlink(paste0(tempdir(), "/phyloseq"), recursive = TRUE)

adrientaudiere/MiscMetabar documentation built on July 6, 2024, 7:02 p.m.