Description Usage Arguments Value Checks Examples
The purpose of this helper function is to faciltate the creation of a
MultiAssayExperiment
object by detecting any inconsistencies
with all types of names in either the ExperimentList
,
the colData
, or sampleMap
.
1 | prepMultiAssay(ExperimentList, colData, sampleMap, ...)
|
ExperimentList |
A |
colData |
A DataFrame of the phenotype data for all participants |
sampleMap |
A DataFrame of sample identifiers, assay samples, and assay names |
... |
Optional arguments for the |
A list
containing all the essential components of a
MultiAssayExperiment
as well as a "drops" metadata element that
indicates non-matched names. The names of the resulting list correspond to
the arguments of the MultiAssayExperiment
constructor function.
The prepMultiAssay
function checks that all columns in the sampleMap
are character
.
It checks that all names and lengths match in both the
ExperimentList
and in the unique assay names of the
sampleMap
.
If ExperimentList
names and assay names only differ by case
and are not duplicated, the function will standardize all names to
lowercase.
If names cannot be matched between the colname column of the
sampleMap
and the colnames of the ExperimentList
, those
unmatched will be dropped and found in the "drops" element of the
resulting list
.
Names in the "primary" column of the sampleMap
, will be
matched to those in the colData
. Unmatched "primary" column rows will
be dropped from the sampleMap
. Suggestions for name fixes in
either the ExperimentList
or colnames will be made when
necessary.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Run example
example("MultiAssayExperiment")
## Check if there are any inconsistencies within the different names
preparedMAE <- prepMultiAssay(ExpList, colDat, mySampleMap)
## Results in a list of components for the MultiAssayExperiment constructor
## function
MultiAssayExperiment(preparedMAE$experiments, preparedMAE$colData,
preparedMAE$sampleMap)
## Alternatively, use the do.call function
do.call(MultiAssayExperiment, preparedMAE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.