R/AllGenerics.R
, R/ELAccessors.R
, R/ELApply.R
, and 1 more
ExperimentList-methods.Rd
The ExperimentList
class provides a family of
methods to manage and process data from multiple experiments.
nexp(x, ...)
experiments(x, ...)
experimentNames(x, ...)
experimentNames(x, ...) <- value
experimentData(x, ...)
experimentData(x, ...) <- value
elapply(x, ...)
# S4 method for ExperimentList
experimentData(x)
# S4 method for ExperimentList
experimentData(x) <- value
# S4 method for ExperimentList
nexp(x)
# S4 method for ExperimentList
experimentNames(x)
# S4 method for ExperimentList
experimentNames(x) <- value
# S4 method for SummarizedExperimentList,ANY,ANY,ANY
[(x, i, j, ..., exp, drop = TRUE)
# S4 method for RangedSummarizedExperimentList,ANY,ANY,ANY
[(x, i, j, ..., exp, drop = TRUE)
# S4 method for SingleCellExperimentList,ANY,ANY,ANY
[(x, i, j, ..., exp, drop = TRUE)
# S4 method for SpatialExperimentList,ANY,ANY,ANY
[(x, i, j, ..., exp, drop = TRUE)
# S4 method for ExperimentList
experiments(x, change.names = TRUE)
# S4 method for ExperimentList
elapply(x, FUN, ..., check.names = TRUE, change.names = TRUE)
# S4 method for SummarizedExperimentList
show(object)
# S4 method for RangedSummarizedExperimentList
show(object)
# S4 method for SingleCellExperimentList
show(object)
# S4 method for SpatialExperimentList
show(object)
A SummarizedExperimentList
,
RangedSummarizedExperimentList
,
SingleCellExperimentList
, or
SpatialExperimentList
object.
Further arguments to be passed to or from other methods.
Replacement value for replacement methods.
A subscript that can act to subset the rows of x
.
A subscript that can act to subset the columns of x
.
A subscript that can act to subset experiments from x
.
A logical(1)
, ignored by these methods.
a logical indicating whether column names of columns in each individual experiment object should be concatenated with experiment names to ensure unique column names (default is TRUE).
The function to be applied to each element of x
: see
‘Details’.
a logical specifying whether names of experiments
should be checked against row names of experimentData
(default is
TRUE).
A SummarizedExperimentList
,
RangedSummarizedExperimentList
,
SingleCellExperimentList
, or
SpatialExperimentList
object.
Return value varies depending on method, as described below.
Additional details for each type of data attribute are provided below.
experimentData(x), experimentData(x) <-
value
: Get or set the experiment data. value
is a
DataFrame
object. Row names of value must be NULL
or
consistent with the existing experiment names of x.
colWithExperimentData(x)
: Get the column data merged with experiment data.
nexp(x)
: Get the number of experiments in
the ExperimentList
object.
experimentNames(x),
experimentNames(x) <- value
: Get or set the names of experiments.
experiments(x)
: Get a list of the experiments (for example,
a list of SummarizedExperiments
).
x[i, j, exp]
: Create or replace a
subset of x. i, j, exp
can be numeric
, logical
,
character
, or missing
.
subset(x, subset, select,
experiment)
: Create a subset of x
using an expression subset
referring to columns of rowData(x)
and / or select referring to
column names of colData(x)
and / or experiment referring to column
names of experimentData(x)
.
elapply(x, FUN, ..., simplify = TRUE,
check.names = TRUE, change.names = TRUE)
: Apply functions to each
experiment within an ExperimentList
and potentially simplify the
results.
ExperimentList
, SummarizedExperiment
,
RangedSummarizedExperiment
,
SingleCellExperiment
, SpatialExperiment
example(ExperimentList)
#>
#> ExprmL> nrows <- 200; ncols <- 6
#>
#> ExprmL> #Experiment 1
#> ExprmL> counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
#>
#> ExprmL> colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
#> ExprmL+ row.names=LETTERS[1:6])
#>
#> ExprmL> se1 <- SummarizedExperiment(assays=SimpleList(counts=counts),
#> ExprmL+ colData=colData)
#>
#> ExprmL> #Experiment 2
#> ExprmL> counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
#>
#> ExprmL> colData <- DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
#> ExprmL+ row.names=LETTERS[1:6])
#>
#> ExprmL> se2 <- SummarizedExperiment(assays=SimpleList(counts=counts),
#> ExprmL+ colData=colData)
#>
#> ExprmL> #Experiment annotation
#> ExprmL> experimentData <- DataFrame(age = c(36, 72),
#> ExprmL+ sex = c("F", "M"),
#> ExprmL+ row.names = c("PatientA", "PatientB"))
#>
#> ExprmL> #Create ExperimentList
#> ExprmL> experiments = SimpleList("PatientA" = se1, "PatientB" = se2)
#>
#> ExprmL> el = ExperimentList(experiments = experiments,
#> ExprmL+ experimentData = experimentData)
#>
#> ExprmL> el
#> ExperimentList with 2 SummarizedExperiments
#> class: SummarizedExperimentList
#> dim: 200 12
#> metadata(0):
#> assays(1): counts
#> rownames: NULL
#> rowData names(0):
#> colnames(12): PatientA.A PatientA.B ... PatientB.E PatientB.F
#> colData names(1): Treatment
#> experiments: 2
#> experimentNames (2): PatientA PatientB
#> experimentData names (2): age sex
nexp(el)
#> [1] 2
experimentData(el)
#> DataFrame with 2 rows and 2 columns
#> age sex
#> <numeric> <character>
#> PatientA 36 F
#> PatientB 72 M
colData(el, experimentData = TRUE)
#> DataFrame with 12 rows and 3 columns
#> Treatment age sex
#> <character> <numeric> <character>
#> PatientA.A ChIP 36 F
#> PatientA.B Input 36 F
#> PatientA.C ChIP 36 F
#> PatientA.D Input 36 F
#> PatientA.E ChIP 36 F
#> ... ... ... ...
#> PatientB.B Input 72 M
#> PatientB.C ChIP 72 M
#> PatientB.D Input 72 M
#> PatientB.E ChIP 72 M
#> PatientB.F Input 72 M
experimentNames(el)
#> [1] "PatientA" "PatientB"
el[1:5, 1:5]
#> ExperimentList with 2 SummarizedExperiments
#> class: SummarizedExperimentList
#> dim: 5 5
#> metadata(0):
#> assays(1): counts
#> rownames: NULL
#> rowData names(0):
#> colnames(5): PatientA.A PatientA.B PatientA.C PatientA.D PatientA.E
#> colData names(1): Treatment
#> experiments: 2
#> experimentNames (2): PatientA PatientB
#> experimentData names (2): age sex
el[, exp = 'PatientA']
#> ExperimentList with 1 SummarizedExperiments
#> class: SummarizedExperimentList
#> dim: 200 6
#> metadata(0):
#> assays(1): counts
#> rownames: NULL
#> rowData names(0):
#> colnames(6): PatientA.A PatientA.B ... PatientA.E PatientA.F
#> colData names(1): Treatment
#> experiments: 1
#> experimentNames (1): PatientA
#> experimentData names (2): age sex
elapply(el, dim)
#> $PatientA
#> [1] 200 6
#>
#> $PatientB
#> [1] 200 6
#>