Learn R Programming

metagenomeFeatures (version 1.2.2)

select: Querying MgDb objects

Description

Function for querying MgDb class objects, user defines the taxonomic levels (keytype) and a vector of taxonomic names (keys) being selected. If specific database ids are being selected for use keytype="Keys". Additionally, users can specify whether they want only the taxonomic and sequence data, or both.

Usage

select(mgdb, type, ...)

## S3 method for class 'MgDb': select(mgdb, type, keys = NULL, keytype = NULL, columns = "all")

Arguments

mgdb
MgDb class object
type
either "taxa", "seq", "tree", "all" or a character vector of types. "taxa", "seq", and "tree" only query the reference taxonomy, sequences, and phylogenetic tree respectively. "all" queries the reference taxonomy, sequence, and phylogenetic tree.
...
additional arguments passed to select function
keys
specific taxonomic groups to select for
keytype
taxonomic level of keys
columns
keytypes in taxonomy databse to return, all by default

Value

  • returned object depends on type, for 'taxa' -dataframe with taxa information, 'seq' a DNAStringSet with seqeunce data, 'tree' a phylogenetic tree of class phylo, 'all' a list with the dataframe, DNAStringSet, and phylo.

Examples

Run this code
demoMgDb <- get_demoMgDb()
# select taxa only
select(demoMgDb, type = "taxa",
     keys = c("Vibrio", "Salmonella"),
     keytype = "Genus")

# select seq only
 select(demoMgDb, type = "seq",
      keys = c("Vibrio", "Salmonella"),
      keytype = "Genus")

# select all taxa, seq, and tree
select(demoMgDb, type = "all",
       keys = c("Vibrio", "Salmonella"),
       keytype = "Genus")

Run the code above in your browser using DataLab