General function for importing mothur data files into phyloseq.
Technically all parameters are optional,
but if you don't provide any file connections, then nothing will be returned.
While the list
and group
files are the first two arguments
for legacy-compatibility reasons, we don't recommend that you use these
file types with modern (large) datasets. They are comically inefficient, as
they store the name of every sequencing read in both files. The mothur
package provides conversions utilities to create other more-efficient formats,
which we recommend, like
the shared file for an OTU table.
Alternatively, mothur also provides a utility to create a biom-format file
that is independent of OTU clustering platform. Biom-format files
should be imported not with this function, but with import_biom
.
The resulting objects after import should be identical
in R.
import_mothur(mothur_list_file = NULL, mothur_group_file = NULL, mothur_tree_file = NULL, cutoff = NULL, mothur_shared_file = NULL, mothur_constaxonomy_file = NULL, parseFunction = parse_taxonomy_default)
mothur_list_file |
(Optional). The list file name / location produced by mothur. |
mothur_group_file |
(Optional). The name/location of the group file produced
by mothur's |
mothur_tree_file |
(Optional).
A tree file, presumably produced by mothur,
and readable by |
cutoff |
(Optional). A character string indicating the cutoff value, (or |
mothur_shared_file |
(Optional). A shared file produced by mothur. |
mothur_constaxonomy_file |
(Optional). A consensus taxonomy file produced by mothur. |
parseFunction |
(Optional). A specific function used for parsing the taxonomy string.
See |
The object class depends on the provided arguments. A phyloseq object is returned if enough data types are provided. If only one data component can be created from the data, it is returned.
FASTER (recommended for larger data sizes):
If only a mothur_constaxonomy_file
is provided,
then a taxonomyTable-class
object is returned.
If only a mothur_shared_file
is provided,
then an otu_table
object is returned.
SLOWER (but fine for small file sizes):
The list and group file formats are extremely inefficient for large datasets,
and they are not recommended. The mothur software provides tools for
converting to other file formats, such as a so-called “shared” file.
You should provide a shared file, or group/list files, but not
both at the same time.
If only a list and group file are provided,
then an otu_table
object is returned.
Similarly, if only a list and tree file are provided,
then only a tree is returned (phylo
-class).
Schloss, P.D., et al., Introducing mothur: Open-source, platform-independent, community-supported software for describing and comparing microbial communities. Appl Environ Microbiol, 2009. 75(23):7537-41.
# # The following example assumes you have downloaded the esophagus example # # dataset from the mothur wiki: # # "http://www.mothur.org/wiki/Esophageal_community_analysis" # # "http://www.mothur.org/w/images/5/55/Esophagus.zip" # # The path on your machine may (probably will) vary # mothur_list_file <- "~/Downloads/mothur/Esophagus/esophagus.an.list" # mothur_group_file <- "~/Downloads/mothur/Esophagus/esophagus.good.groups" # mothur_tree_file <- "~/Downloads/mothur/Esophagus/esophagus.tree" # # # Actual examples follow: # show_mothur_cutoffs(mothur_list_file) # test1 <- import_mothur(mothur_list_file, mothur_group_file, mothur_tree_file) # test2 <- import_mothur(mothur_list_file, mothur_group_file, mothur_tree_file, cutoff="0.02") # # Returns just a tree # import_mothur(mothur_list_file, mothur_tree_file=mothur_tree_file) # # Returns just an otu_table # import_mothur(mothur_list_file, mothur_group_file=mothur_group_file) # # Returns an error # import_mothur(mothur_list_file) # # Should return an "OMG, you must provide the list file" error # import_mothur()
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.