Importing Data from Mothur into MicrobiomeStat
Steps for importing Mothur-generated data into the MicrobiomeStat framework.
# Make sure the plyr package is installed
if (!require(plyr)) {
install.packages("plyr")
library(plyr)
} else {
library(plyr)
}
# Specify the paths to your Mothur files
path_to_list_file <- "/path_to_your_files/esophagus.fn.list.gz"
path_to_group_file <- "/path_to_your_files/esophagus.good.groups.gz"
path_to_tree_file <- "/path_to_your_files/esophagus.tree.gz"
path_to_shared_file <- "/path_to_your_files/esophagus.fn.shared.gz"
# Import Mothur data into a MicrobiomeStat data object
data_obj <- mStat_import_mothur_as_data_obj(
mothur_list_file = path_to_list_file,
mothur_group_file = path_to_group_file,
mothur_tree_file = path_to_tree_file,
mothur_shared_file = path_to_shared_file
)
# After constructing data_obj, detach the plyr package to avoid conflicts with dplyr
if ("package:plyr" %in% search()) {
detach("package:plyr", unload = TRUE)
message("Detached plyr package to avoid potential conflicts with dplyr.")
}
Last updated