Create a phyloseq object using a biom file, phylogenetic tree file, and a metadata file. Alternatively, an .Rdata file can be used. For now this function takes output from Qiime. The data provided by this package was processed by the NIH's Nephele pipeline.

create_phyloseq(biom_file = NULL, tree_file = NULL,
  metadata_file = NULL, treatment_group = NULL, parse_func = NULL,
  rdata_file = NULL, save_rooted_tree = FALSE,
  recursive_save = FALSE)

Arguments

biom_file

A file in the BIOM format. Default: NULL

tree_file

A phylogenetic tree file. This function will generate a rooted tree file if your phylogenetic tree isn't already rooted. Default: NULL

metadata_file

Sample metadata in tab delimited format. It's very important that you make sure that you have a sample_id and TreatmentGroup column in your metadata file. You might otherwise run into problems. Default: NULL

treatment_group

The column number or name in the metadata file that contains the treatment group names. Default: NULL

parse_func

The parse function used to parse taxonomy strings from Greengenes or SILVA database. Default: NULL

rdata_file

A .Rdata file. Default: NULL

save_rooted_tree

A logical that determines weather or not the rooted tree is saved. Default: FALSE

recursive_save

If the directory doesn't exists create the parent directories that don't exist as well. Default: FALSE

Value

A phyloseq object, and a phylogenetic tree file if one does not already exist.

Details

This function heavily relies on the phyloseq package to import data into R. It also requires you to use an absolute or relative path to your data files or for your data files to be in the working directory.

It's very important that you make sure that you have a sample_id and TreatmentGroup column in your metadata file.

See also

Examples

# NOT RUN {
if(interactive()){
library(MicrobiomeR)
# Get the datafiles from the package
biom_file <- system.file("extdata", "silva_OTU.biom", package = "MicrobiomeR")
tree_file <- system.file("extdata", "silva.tre", package = "MicrobiomeR")
md_file <- system.file("extdata", "nephele_metadata2.txt", package = "MicrobiomeR")
parse_func <- parse_parse_taxonomy_silva_128
}
# Create a phyloseq object from the data files.
phy_obj <- create_phyloseq(biom_file = biom_file,
                           tree_file = tree_file,
                           metadata_file = md_file,
                           parse_func = parse_func)
# }