Skip to contents

Get a collection from the Microbiome Dataset. The collection will be returned as an AbundanceData, phyloseq, or Collection object.

Usage

getCollection(
  object,
  collectionName,
  format = c("AbundanceData", "phyloseq", "Collection"),
  continuousMetadataOnly = c(FALSE, TRUE)
)

# S4 method for MbioDataset
getCollection(
  object,
  collectionName = character(0),
  format = c("AbundanceData", "phyloseq", "Collection"),
  continuousMetadataOnly = c(FALSE, TRUE)
)

Arguments

object

A Microbiome Dataset

collectionName

The name of the collection to return

format

The format of the collection to return. Currently supported options are "AbundanceData", "phyloseq" and "Collection".

continuousMetadataOnly

If TRUE, only continuous metadata will be returned. If FALSE, all metadata will be returned.

Value

An AbundanceData, phyloseq, or Collection object representing the collection and any associated study metadata

Examples

genus <- getCollection(
     microbiomeData::DiabImmune, 
     "16S (V4) Genus (Relative taxonomic abundance analysis)"
)

genus_phyloseq <- getCollection(
     microbiomeData::DiabImmune, 
     "16S (V4) Genus (Relative taxonomic abundance analysis)", 
     format = "phyloseq"
)

## to pass to correlation method, we want only continuous metadata
genus_continuous <- getCollection(
     microbiomeData::DiabImmune, 
     "16S (V4) Genus (Relative taxonomic abundance analysis)", 
     continuousMetadataOnly = TRUE
) 

## with no metadata
genus_collection <- getCollection(
     microbiomeData::DiabImmune, 
     "16S (V4) Genus (Relative taxonomic abundance analysis)", 
     format = "Collection"
)