File: subsetBy.Rd

package info (click to toggle)
r-bioc-multiassayexperiment 1.16.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 924 kB
  • sloc: sh: 13; makefile: 2
file content (161 lines) | stat: -rw-r--r-- 5,182 bytes parent folder | download
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/subsetBy-methods.R,
%   R/MultiAssayExperiment-subset.R
\name{subsetBy}
\alias{subsetBy}
\alias{[,MultiAssayExperiment,ANY-method}
\alias{subsetByColData}
\alias{subsetByRow}
\alias{subsetByColumn}
\alias{subsetByAssay}
\alias{subset}
\alias{subsetByRow,ExperimentList,ANY-method}
\alias{subsetByRow,ExperimentList,list-method}
\alias{subsetByRow,ExperimentList,List-method}
\alias{subsetByRow,ExperimentList,logical-method}
\alias{subsetByColumn,ExperimentList,list-method}
\alias{subsetByColumn,ExperimentList,List-method}
\alias{subsetByColumn,ExperimentList,logical-method}
\alias{subsetByAssay,ExperimentList-method}
\alias{subsetByColData,MultiAssayExperiment,ANY-method}
\alias{subsetByColData,MultiAssayExperiment,character-method}
\alias{subsetByRow,MultiAssayExperiment,ANY-method}
\alias{subsetByColumn,MultiAssayExperiment,ANY-method}
\alias{subsetByAssay,MultiAssayExperiment-method}
\alias{[,MultiAssayExperiment,ANY,ANY,ANY-method}
\alias{[[,MultiAssayExperiment,ANY,ANY-method}
\alias{[[<-,MultiAssayExperiment,ANY,ANY-method}
\alias{[<-,MultiAssayExperiment,ANY,ANY,ANY-method}
\title{Subsetting a MultiAssayExperiment object}
\usage{
subsetByRow(x, y, ...)

subsetByColData(x, y)

subsetByColumn(x, y)

subsetByAssay(x, y)

\S4method{subsetByRow}{ExperimentList,ANY}(x, y, ...)

\S4method{subsetByRow}{ExperimentList,list}(x, y)

\S4method{subsetByRow}{ExperimentList,List}(x, y)

\S4method{subsetByRow}{ExperimentList,logical}(x, y)

\S4method{subsetByColumn}{ExperimentList,list}(x, y)

\S4method{subsetByColumn}{ExperimentList,List}(x, y)

\S4method{subsetByColumn}{ExperimentList,logical}(x, y)

\S4method{subsetByAssay}{ExperimentList}(x, y)

\S4method{subsetByColData}{MultiAssayExperiment,ANY}(x, y)

\S4method{subsetByColData}{MultiAssayExperiment,character}(x, y)

\S4method{subsetByRow}{MultiAssayExperiment,ANY}(x, y, ...)

\S4method{subsetByColumn}{MultiAssayExperiment,ANY}(x, y)

\S4method{subsetByAssay}{MultiAssayExperiment}(x, y)

\S4method{[}{MultiAssayExperiment,ANY,ANY,ANY}(x, i, j, k, ..., drop = TRUE)

\S4method{[[}{MultiAssayExperiment,ANY,ANY}(x, i, j, ...)

\S4method{[[}{MultiAssayExperiment,ANY,ANY}(x, i, j, ...) <- value

\S4method{[}{MultiAssayExperiment,ANY,ANY,ANY}(x, i, j, ...) <- value
}
\arguments{
\item{x}{A \code{MultiAssayExperiment} or \code{ExperimentList}}

\item{y}{Any argument used for subsetting, can be a \code{character},
\code{logical}, \code{integer}, \code{list} or \code{List} vector}

\item{...}{Additional arguments passed on to lower level functions.}

\item{i}{Either a \code{character}, \code{integer}, \code{logical} or
\code{GRanges} object for subsetting by rows}

\item{j}{Either a \code{character}, \code{logical}, or \code{numeric} vector
for subsetting by \code{colData} rows. See details for more information.}

\item{k}{Either a \code{character}, \code{logical}, or \code{numeric} vector
for subsetting by assays}

\item{drop}{logical (default TRUE) whether to drop empty assay elements
in the \code{ExperimentList}}

\item{value}{An assay compatible with the MultiAssayExperiment API}
}
\value{
\code{subsetBy*} operations are endomorphic and return either
\code{MultiAssayExperiment} or \code{ExperimentList} depending on the
input.
}
\description{
A set of functions for extracting and dividing a
\code{MultiAssayExperiment}
}
\details{
Subsetting a MultiAssayExperiment by the \strong{j} index can yield a call
to either \code{subsetByColData} or \code{subsetByColumn}. For vector inputs,
the subset will be applied to the \code{colData} rows. For \code{List}-type
inputs, the List will be applied to each of the elements in the
\code{ExperimentList}.
The order of the subsetting elements in the
\code{List} must match that of the \code{ExperimentList} in the
\code{MultiAssayExperiment}.

\itemize{
\item subsetBycolData: Select biological units by vector input types
\item subsetByColumn: Select observations by assay or for each assay
\item subsetByRow: Select rows by assay or for each assay
\item subsetByAssay: Select experiments
}
}
\examples{
## Load the example MultiAssayExperiment
example("MultiAssayExperiment")

## Using experiment names
subsetByAssay(mae, "Affy")

## Using numeric indices
subsetByAssay(mae, 1:2)

## Using a logical vector
subsetByAssay(mae, c(TRUE, FALSE, TRUE))

## Subset by character vector (Jack)
subsetByColData(mae, "Jack")

## Subset by numeric index of colData rows (Jack and Bob)
subsetByColData(mae, c(1, 3))

## Subset by logical indicator of colData rows (Jack and Jill)
subsetByColData(mae, c(TRUE, TRUE, FALSE, FALSE))

subsetByColumn(mae, list(Affy = 1:2,
    Methyl450k = c(3,5,2), RNASeqGene = 2:4, GISTIC = 1))

subsetWith <- S4Vectors::mendoapply(`[`, colnames(mae),
    MoreArgs = list(1:2))
subsetByColumn(mae, subsetWith)

## Use a GRanges object to subset rows where ranged data present
egr <- GenomicRanges::GRanges(seqnames = "chr2",
    IRanges::IRanges(start = 11, end = 13), strand = "-")
subsetByRow(mae, egr)

## Use a logical vector (recycling used)
subsetByRow(mae, c(TRUE, FALSE))

## Use a character vector
subsetByRow(mae, "ENST00000355076")

}