forked from microbiome/mia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsummary.Rd
166 lines (135 loc) · 5.33 KB
/
summary.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/summaries.R
\name{summarizeDominance}
\alias{summarizeDominance}
\alias{getUnique}
\alias{getTop}
\alias{summary}
\alias{getTop,SummarizedExperiment-method}
\alias{getUnique,SummarizedExperiment-method}
\alias{summarizeDominance,SummarizedExperiment-method}
\alias{summary,SummarizedExperiment-method}
\title{Summarizing microbiome data}
\usage{
summarizeDominance(x, group = NULL, name = "dominant_taxa", ...)
getUnique(x, ...)
getTop(
x,
top = 5L,
method = c("mean", "sum", "median"),
assay.type = assay_name,
assay_name = "counts",
na.rm = TRUE,
...
)
\S4method{getTop}{SummarizedExperiment}(
x,
top = 5L,
method = c("mean", "sum", "median", "prevalence"),
assay.type = assay_name,
assay_name = "counts",
na.rm = TRUE,
...
)
\S4method{getUnique}{SummarizedExperiment}(x, rank = NULL, ...)
\S4method{summarizeDominance}{SummarizedExperiment}(x, group = NULL, name = "dominant_taxa", ...)
\S4method{summary}{SummarizedExperiment}(object, assay.type = assay_name, assay_name = "counts")
}
\arguments{
\item{x}{\code{\link[TreeSummarizedExperiment:TreeSummarizedExperiment-class]{TreeSummarizedExperiment}}.}
\item{group}{With group, it is possible to group the observations in an
overview. Must be one of the column names of \code{colData}.}
\item{name}{\code{Character scalar}. A name for the column of the
\code{colData} where results will be stored.
(Default: \code{"dominant_taxa"})}
\item{...}{Additional arguments passed on to \code{agglomerateByRank()} when
\code{rank} is specified for \code{summarizeDominance}.}
\item{top}{\code{Numeric scalar}. Determines how many top taxa to return.
Default is to return top five taxa. (Default: \code{5})}
\item{method}{\code{Character scalar}. Specify the method to determine top
taxa. Either sum, mean, median or prevalence. (Default: \code{"mean"})}
\item{assay.type}{\code{Character scalar}. Specifies the name of the
assay used in calculation. (Default: \code{"counts"})}
\item{assay_name}{Deprecated. Use \code{assay.type} instead.}
\item{na.rm}{\code{Logical scalar}. Should NA values be omitted?
(Default: \code{TRUE})}
\item{rank}{\code{Character scalar}. Defines a taxonomic rank. Must be a
value of the output of \code{taxonomyRanks()}. (Default: \code{NULl})}
\item{object}{A
\code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
object.}
}
\value{
The \code{getTop} returns a vector of the most \code{top} abundant
\dQuote{FeatureID}s
The \code{getUnique} returns a vector of unique taxa present at a
particular rank
The \code{summarizeDominance} returns an overview in a tibble. It contains
dominant taxa in a column named \code{*name*} and its abundance in the data
set.
The \code{summary} returns a list with two \code{tibble}s
}
\description{
To query a \code{SummarizedExperiment} for interesting features, several
functions are available.
}
\details{
The \code{getTop} extracts the most \code{top} abundant \dQuote{FeatureID}s
in a
\code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
object.
The \code{getUnique} is a basic function to access different taxa at a
particular taxonomic rank.
\code{summarizeDominance} returns information about most dominant
taxa in a tibble. Information includes their absolute and relative
abundances in whole data set.
The \code{summary} will return a summary of counts for all samples and
features in
\code{\link[SummarizedExperiment:SummarizedExperiment-class]{SummarizedExperiment}}
object.
}
\examples{
data(GlobalPatterns)
top_taxa <- getTop(GlobalPatterns,
method = "mean",
top = 5,
assay.type = "counts")
top_taxa
# Use 'detection' to select detection threshold when using prevalence method
top_taxa <- getTop(GlobalPatterns,
method = "prevalence",
top = 5,
assay_name = "counts",
detection = 100)
top_taxa
# Top taxa os specific rank
getTop(agglomerateByRank(GlobalPatterns,
rank = "Genus",
na.rm = TRUE))
# Gets the overview of dominant taxa
dominant_taxa <- summarizeDominance(GlobalPatterns,
rank = "Genus")
dominant_taxa
# With group, it is possible to group observations based on specified groups
# Gets the overview of dominant taxa
dominant_taxa <- summarizeDominance(GlobalPatterns,
rank = "Genus",
group = "SampleType",
na.rm = TRUE)
dominant_taxa
# Get an overview of sample and taxa counts
summary(GlobalPatterns, assay.type= "counts")
# Get unique taxa at a particular taxonomic rank
# sort = TRUE means that output is sorted in alphabetical order
# With na.rm = TRUE, it is possible to remove NAs
# sort and na.rm can also be used in function getTop
getUnique(GlobalPatterns, "Phylum", sort = TRUE)
}
\seealso{
\code{\link[=getPrevalence]{getPrevalent}}
\code{\link[scuttle:perCellQCMetrics]{perCellQCMetrics}},
\code{\link[scuttle:perFeatureQCMetrics]{perFeatureQCMetrics}},
\code{\link[scuttle:addPerCellQC]{addPerCellQC}},
\code{\link[scuttle:addPerFeatureQC]{addPerFeatureQC}},
\code{\link[scuttle:quickPerCellQC]{quickPerCellQC}}
}