-
Notifications
You must be signed in to change notification settings - Fork 32
/
MultiAssayExperiment-class.Rd
254 lines (196 loc) · 8.65 KB
/
MultiAssayExperiment-class.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MultiAssayExperiment-class.R,
% R/MultiAssayExperiment-methods.R, R/assay-methods.R
\docType{class}
\name{MultiAssayExperiment-class}
\alias{MultiAssayExperiment-class}
\alias{show,MultiAssayExperiment-method}
\alias{length,MultiAssayExperiment-method}
\alias{names,MultiAssayExperiment-method}
\alias{updateObject,MultiAssayExperiment-method}
\alias{coerce-MultiAssayExperiment}
\alias{coerce,list,MultiAssayExperiment-method}
\alias{coerce,List,MultiAssayExperiment-method}
\alias{dimnames,MultiAssayExperiment-method}
\alias{c,MultiAssayExperiment-method}
\alias{exportClass,MultiAssayExperiment-method}
\alias{exportClass}
\alias{assays,MultiAssayExperiment-method}
\alias{assay,MultiAssayExperiment,missing-method}
\alias{assay,MultiAssayExperiment,numeric-method}
\alias{assay,MultiAssayExperiment,character-method}
\title{MultiAssayExperiment - An integrative multi-assay class for experiment data}
\usage{
\S4method{show}{MultiAssayExperiment}(object)
\S4method{length}{MultiAssayExperiment}(x)
\S4method{names}{MultiAssayExperiment}(x)
\S4method{updateObject}{MultiAssayExperiment}(object, ..., verbose = FALSE)
\S4method{dimnames}{MultiAssayExperiment}(x)
\S4method{c}{MultiAssayExperiment}(x, ..., sampleMap = NULL, mapFrom = NULL)
\S4method{exportClass}{MultiAssayExperiment}(
object,
dir = tempdir(),
fmt,
ext,
match = FALSE,
verbose = TRUE,
...
)
\S4method{assays}{MultiAssayExperiment}(x, withDimnames = TRUE, ...)
\S4method{assay}{MultiAssayExperiment,missing}(x, i, withDimnames = TRUE, ...)
\S4method{assay}{MultiAssayExperiment,numeric}(x, i, withDimnames = TRUE, ...)
\S4method{assay}{MultiAssayExperiment,character}(x, i, withDimnames = TRUE, ...)
}
\arguments{
\item{object, x}{A \code{MultiAssayExperiment} object}
\item{...}{Additional arguments for supporting functions. See details.}
\item{verbose}{logical(1) Whether to print additional information (default
TRUE)}
\item{sampleMap}{\code{c} method: a \code{sampleMap} \code{list} or
\code{DataFrame} to guide merge}
\item{mapFrom}{Either a \code{logical}, \code{character}, or \code{integer}
vector indicating the experiment(s) that have an identical colname order as
the experiment input(s). If using a character input, the name must match
exactly.}
\item{dir}{character(1) A directory for saving exported data (default:
`tempdir()`)}
\item{fmt}{character(1) or function() Either a format character atomic as
supported by `write.table` either ('csv', or 'tsv') or a function whose
first two arguments are 'object to save' and 'file location'}
\item{ext}{character(1) A file extension supported by the format argument}
\item{match}{logical(1) Whether to coerce the current object to a
'MatchedAssayExperiment' object (default: FALSE)}
\item{withDimnames}{logical (default TRUE) whether to return dimension names
included in the object}
\item{i}{An integer or character scalar indicating the assay to return}
}
\value{
A \code{MultiAssayExperiment} object
}
\description{
The \code{MultiAssayExperiment} class can be used to manage results of
diverse assays on a collection of specimen. Currently, the class can handle
assays that are organized instances of
\code{\linkS4class{SummarizedExperiment}},
\code{\linkS4class{ExpressionSet}}, \code{matrix},
\code{\link[RaggedExperiment:RaggedExperiment-class]{RaggedExperiment}}
(inherits from \code{\linkS4class{GRangesList}}), and \code{RangedVcfStack}.
Create new \code{MultiAssayExperiment} instances with the homonymous
constructor, minimally with the argument \code{\link{ExperimentList}},
potentially also with the arguments \code{colData} (see section below) and
\code{\link{sampleMap}}.
}
\details{
The dots (\code{\ldots}) argument allows the user to specify additional
arguments in several instances.
\itemize{
\item subsetting \strong{[}: additional arguments sent to
\link[GenomicRanges:findOverlaps-methods]{findOverlaps}.
\item mergeReplicates: used to specify arguments for the \code{simplify}
functional argument
\item assay: may contain withDimnames, which is forwarded to assays
\item combining \strong{c}: compatible \code{MultiAssayExperiment} classes
passed on to the \code{\linkS4class{ExperimentList}} constructor,
can be a \code{list}, \code{\linkS4class{List}}, or a series of
named arguments. See the examples below.
}
}
\section{Methods (by generic)}{
\itemize{
\item \code{show(MultiAssayExperiment)}: Show method for a
\code{MultiAssayExperiment}
\item \code{length(MultiAssayExperiment)}: Get the length of ExperimentList
\item \code{names(MultiAssayExperiment)}: Get the names of the ExperimentList
\item \code{updateObject(MultiAssayExperiment)}: Update old serialized MultiAssayExperiment
objects to new API
\item \code{dimnames(MultiAssayExperiment)}: Get the dimension names
for a \code{MultiAssayExperiment} object
\item \code{c(MultiAssayExperiment)}: Add a supported data class to the
\code{ExperimentList}
\item \code{exportClass(MultiAssayExperiment)}: Export data from class to a series
of text files
\item \code{assays(MultiAssayExperiment)}: Obtain a \code{\link{SimpleList}} of assay
data for all available experiments in the object
\item \code{assay(x = MultiAssayExperiment, i = missing)}: Convenience function for extracting the
assay of the first element (default) in the \code{ExperimentList}. A
\code{numeric} or \code{character} index can also be provided
}}
\section{Slots}{
\describe{
\item{\code{ExperimentList}}{A \code{\link{ExperimentList}} class object for
each assay dataset}
\item{\code{colData}}{A \code{DataFrame} of all clinical/specimen data available
across experiments}
\item{\code{sampleMap}}{A \code{DataFrame} of translatable identifiers
of samples and participants}
\item{\code{metadata}}{Additional data describing the
\code{MultiAssayExperiment} object}
\item{\code{drops}}{A metadata \code{list} of dropped information}
}}
\section{colData}{
The \code{colData} slot is a collection of primary specimen data valid
across all experiments. This slot is strictly of class
\code{\linkS4class{DataFrame}} but arguments for the constructor function
allow arguments to be of class \code{data.frame} and subsequently coerced.
}
\section{ExperimentList}{
The \code{\link{ExperimentList}} slot is designed to contain results from
each experiment/assay. It contains a \linkS4class{SimpleList}.
}
\section{sampleMap}{
The \code{\link{sampleMap}} contains a \code{DataFrame} of translatable
identifiers of samples and participants or biological units. The standard
column names of the \code{sampleMap} are "assay", "primary", and "colname".
Note that the "assay" column is a factor corresponding to the names of each
experiment in the \code{ExperimentList}. In the case where these names do
not match between the \code{sampleMap} and the experiments, the documented
experiments in the \code{sampleMap} take precedence and experiments are
dropped by the harmonization procedure. The constructor function will
generate a \code{sampleMap} in the case where it is not provided and this
method may be a 'safer' alternative for creating the \code{MultiAssayExperiment}
(so long as the rownames are identical in the \code{colData}, if provided).
An empty \code{sampleMap} may produce empty experiments if the levels of the
"assay" factor in the \code{sampleMap} do not match the names in the
\code{ExperimentList}.
}
\section{coercion}{
Convert a \code{list} or S4 \code{List} to a MultiAssayExperiment object using the
\link[methods]{as} function.
In the following example, \code{x} is either a \code{list} or \linkS4class{List}:
\code{as(x, "MultiAssayExperiment")}
Convert a \code{MultiAssayExperiment} to \code{MAF} class object using the
\link[methods]{as} function.
In the following example, \code{x} is a \linkS4class{MultiAssayExperiment}:
\code{MultiAssayExperimentToMAF(x)}
}
\examples{
example("MultiAssayExperiment")
## Subsetting
# Rows (i) Rows/Features in each experiment
mae[1, , ]
mae[c(TRUE, FALSE), , ]
# Columns (j) Rows in colData
mae[, rownames(colData(mae))[3:2], ]
# Assays (k)
mae[, , "Affy"]
## Complete cases (returns logical vector)
completes <- complete.cases(mae)
compMAE <- mae[, completes, ]
compMAE
colData(compMAE)
example("MultiAssayExperiment")
## Add an experiment
test1 <- mae[[1L]]
colnames(test1) <- rownames(colData(mae))
## Combine current MultiAssayExperiment with additional experiment
## (no sampleMap)
c(mae, newExperiment = test1)
test2 <- mae[[3L]]
c(mae, newExp = test2, mapFrom = 3L)
## Add experiment using experiment name in mapFrom
c(mae, RNASeqGeneV2 = test2, mapFrom = "RNASeqGene")
}
\seealso{
\link{MultiAssayExperiment-methods} for slot modifying methods,
\href{https://github.com/waldronlab/MultiAssayExperiment/wiki/MultiAssayExperiment-API}{MultiAssayExperiment API}
}