Closed LiNk-NY closed 6 years ago
"bumping" this issue. Perhaps start with a addExperiment
function, that takes two required arguments (a MAE and an object of a supported class), plus optional arguments to resolve potential ambiguity in the sampleMap. A "sampleMap" argument could specify the sampleMap for the additional samples, and a "sampleMapFrom" argument could specify an existing experiment as a template. With neither specified, existing sampleMap rows could be used if the column names of the new assay can be unambiguously mapped. There is no ambiguity if:
@lwaldron: add a warning to mapFrom
argument use
This was added in b62037c7.
The documentation on this isn't clear to me, from ?MultiAssayExperiment-class
:
The dots (...) argument allows the user to specify additional arguments in several instances. When subsetting ([) a MultiAssayExperiment, the dots allow for additional arguments to be sent to findOverlaps. When using the mergeReplicates method, the dots are used to specify arguments for the supplied simplify argument and function. When using the assay method. When using c method to add experiments to a MultiAssayExperiment, the dots allow extra data classes compatible with the MultiAssayExperiment API. See the MultiAssayExperiment API
A couple things that seem possible from this documentation don't work:
library(MultiAssayExperiment)
library(SummarizedExperiment)
example("MultiAssayExperiment")
se <- myMultiAssayExperiment[["Affy"]]
assay(se) <- log2(assay(se))
c(myMultiAssayExperiment, ExperimentList(log2affy=se))
c(myMultiAssayExperiment, se)
first gives Error in .generateMap(colData(x), newExperiments): no way to map colData to ExperimentList
and second gives Error in validObject(.Object): invalid class “ExperimentList” object: ExperimentList elements must be named
.
(side note: When using the assay method. in above documentation is truncated)
When introducing a new experiment, you would have to provide the sampleMap
since
there is no way to know how the experiment maps to the colData
. I have provided the
convenience argument mapFrom
which will work as:
c(myMultiAssayExperiment, ExperimentList(log2affy=se), mapFrom = "Affy")
You can also do:
c(myMultiAssayExperiment, log2affy = se, mapFrom = 1L)
Regards, Marcel
What about the above comment?
There is no ambiguity if:
- you subset the existing sampleMap to rows where the assay column matches column names in the new assay
- take unique rows of this subsetted sampleMap
- there are no duplicates in the assay column of the subsetted sampleMap
This sounds good. I'll work on this soon. Thanks!
A "concatenate" or "combine" method for the
MultiAssayExperiment
class. It should modifysampleMap
andpData
on the fly