Convert abundances to phyloseq object

toPhyloseq(
  abundances,
  metadata = NULL,
  lineages = NULL,
  assignSampleNames = FALSE,
  dummyMetadata = FALSE,
  dummyLineages = FALSE,
  lineageSource = NULL
)

Arguments

abundances

a matrix with taxa as rows and samples as columns

metadata

an optional data frame with metadata items as columns, where samples are in the same order as in abundances

lineages

an optional lineage matrix where row names match row names of taxa; taxa must be provided in the same order as in x; first column gives kingdom, following columns give phylum, class, order, family, genus and species

assignSampleNames

assign random sample names

dummyMetadata

create a dummy metadata object with a single numeric item from a normal distribution; only if no metadata are provided

dummyLineages

assign dummy lineages; only if no lineages are provided and a lineageSource is given

lineageSource

a phyloseq object with known lineages, e.g. GlobalPatterns (phyloseq preloaded data that can be loaded with data(GlobalPatterns)), to be used for random lineage assignment

Value

phyloseq object

Examples

data(ibd_taxa) data(ibd_metadata) data(ibd_lineages) phyloseq.obj=toPhyloseq(ibd_taxa,metadata=ibd_metadata,lineages=ibd_lineages) phyloseq.obj
#> phyloseq-class experiment-level object #> otu_table() OTU Table: [ 201 taxa and 155 samples ] #> sample_data() Sample Data: [ 155 samples by 8 sample variables ] #> tax_table() Taxonomy Table: [ 201 taxa by 7 taxonomic ranks ]