perSampleDominantTaxa {mia} | R Documentation |
These functions return information about the most dominant taxa in a
SummarizedExperiment
object.
perSampleDominantTaxa(x, abund_values = "counts", rank = NULL, ...) ## S4 method for signature 'SummarizedExperiment' perSampleDominantTaxa(x, abund_values = "counts", rank = NULL, ...) addPerSampleDominantTaxa(x, name = "dominant_taxa", ...) ## S4 method for signature 'SummarizedExperiment' addPerSampleDominantTaxa(x, name = "dominant_taxa", ...)
x |
A
|
abund_values |
A single character value for selecting the
|
rank |
A single character defining a taxonomic rank. Must be a value of
the output of |
... |
Additional arguments passed on to |
name |
A name for the column of the |
addPerSampleDominantTaxa
extracts the most abundant taxa in a
SummarizedExperiment
object, and stores the information in the colData
. It is a wrapper for
perSampleDominantTaxa
.
With rank
parameter, it is possible to agglomerate taxa based on taxonomic
ranks. E.g. if 'Genus' rank is used, all abundances of same Genus are added
together, and those families are returned. See agglomerateByRank()
for
additional arguments to deal with missing values or special characters.
perSampleDominantTaxa
returns a named character vector x
while addPerSampleDominantTaxa
returns
SummarizedExperiment
with additional column in colData
named *name*
.
Leo Lahti, Tuomas Borman and Sudarshan A. Shetty.
data(GlobalPatterns) x <- GlobalPatterns # Finds the dominant taxa. sim.dom <- perSampleDominantTaxa(x, rank="Genus") # Add information to colData x <- addPerSampleDominantTaxa(x, rank = "Genus", name="dominant_genera") colData(x)