View source: R/MultiAssayExperiment-class.R
MultiAssayExperiment | R Documentation |
MultiAssayExperiment
The constructor function for the MultiAssayExperiment-class combines
multiple data elements from the different hierarchies of data
(study, experiments, and samples). It can create instances where neither
a sampleMap
or a colData
set is provided. Please see the
MultiAssayExperiment API documentation for more information.
MultiAssayExperiment(
experiments = ExperimentList(),
colData = S4Vectors::DataFrame(),
sampleMap = S4Vectors::DataFrame(assay = factor(), primary = character(), colname =
character()),
metadata = list(),
drops = list()
)
experiments |
A |
colData |
A |
sampleMap |
A |
metadata |
An optional argument of "ANY" class (usually list) for content describing the experiments |
drops |
A |
A MultiAssayExperiment
object that can store
experiment and phenotype data
The 'colData' input can be either 'DataFrame' or 'data.frame' with subsequent coercion to DataFrame. The rownames in the 'colData' must match the colnames in the experiments if no sampleMap is provided.
The 'experiments' input can be of class SimpleList or 'list'.
This input becomes the ExperimentList
. Each element of the
input 'list' or 'List' must be named, rectangular with two dimensions, and
have 'dimnames'.
The sampleMap
can either be input as 'DataFrame' or
'data.frame' with eventual coercion to 'DataFrame'. The 'sampleMap' relates
biological units and biological measurements within each assay. Each row in
the 'sampleMap' is a single such link. The standard column names of the
'sampleMap' are "assay", "primary", and "colname". Note that the "assay"
column is a factor corresponding to the names of each experiment in the
'ExperimentList'. In the case where these names do not match between the
'sampleMap' and the experiments, the documented experiments in the
'sampleMap' take precedence and experiments are dropped by the harmonization
procedure. The constructor function will generate a 'sampleMap' in the case
where it is not provided and this method may be a 'safer' alternative for
creating the 'MultiAssayExperiment' (so long as the rownames are identical
in the 'colData', if provided). An empty 'sampleMap' may produce empty
experiments if the levels of the "assay" factor in the 'sampleMap' do not
match the names in the 'ExperimentList'.
MultiAssayExperiment-class
## Run the example ExperimentList
example("ExperimentList")
## Create sample maps for each experiment
exprmap <- data.frame(
primary = c("Jack", "Jill", "Barbara", "Bob"),
colname = c("array1", "array2", "array3", "array4"),
stringsAsFactors = FALSE)
methylmap <- data.frame(
primary = c("Jack", "Jack", "Jill", "Barbara", "Bob"),
colname = c("methyl1", "methyl2", "methyl3", "methyl4", "methyl5"),
stringsAsFactors = FALSE)
rnamap <- data.frame(
primary = c("Jack", "Jill", "Bob", "Barbara"),
colname = c("samparray1", "samparray2", "samparray3", "samparray4"),
stringsAsFactors = FALSE)
gistmap <- data.frame(
primary = c("Jack", "Bob", "Jill"),
colname = c("samp0", "samp1", "samp2"),
stringsAsFactors = FALSE)
## Combine as a named list and convert to a DataFrame
maplist <- list(Affy = exprmap, Methyl450k = methylmap,
RNASeqGene = rnamap, GISTIC = gistmap)
## Create a sampleMap
sampMap <- listToMap(maplist)
## Create an example phenotype data
colDat <- data.frame(sex = c("M", "F", "M", "F"), age = 38:41,
row.names = c("Jack", "Jill", "Bob", "Barbara"))
## Create a MultiAssayExperiment instance
mae <- MultiAssayExperiment(experiments = ExpList, colData = colDat,
sampleMap = sampMap)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.