Closed lwaldron closed 6 years ago
Here's an example of where the "align columns of each experiment with each other and with pData" would come in handy. I just want to use the RNA-seq and clinical data for prostate cancer, and it is ugly. The line I object to the user having to do here is sampleMap(maeo.rnaseq) <- sampleMap(maeo.rnaseq)[match(rownames(pData(maeo.rnaseq)), sampleMap(maeo.rnaseq)$primary), ]
> download.file("http://s3.amazonaws.com/multiassayexperiments/pradMAEO.rds", destfile="pradMAEO.rds")
> maeo <- readRDS("pradMAEO.rds")
> maeo.rnaseq <- maeo[, , "RNASeq2GeneNorm"]
> maeo.rnaseq <- maeo.rnaseq[, complete.cases(maeo.rnaseq), ]
> sampleMap(maeo.rnaseq) <- sampleMap(maeo.rnaseq)[match(rownames(pData(maeo.rnaseq)), sampleMap(maeo.rnaseq)$primary), ]
> all.equal(rownames(pData(maeo.rnaseq)), sampleMap(maeo.rnaseq)$primary)
[1] TRUE
> eset.rnaseq <- experiments(maeo.rnaseq)[[1]]
> pData(eset.rnaseq) <- data.frame(pData(maeo.rnaseq))
> eset.rnaseq
ExpressionSet (storageMode: lockedEnvironment)
assayData: 20501 features, 550 samples
element names: exprs
protocolData: none
phenoData
sampleNames: TCGA-2A-A8VL TCGA-2A-A8VO ... TCGA-ZG-A9NI (497 total)
varLabels: Composite.Element.REF years_to_birth ... ethnicity (21 total)
varMetadata: labelDescription
featureData: none
experimentData: use 'experimentData(object)'
Annotation:
>
@lwaldron
I'm working on getting a clean check. I will run this example with the latest revision of reduce
@lwaldron
These objects were built before the updates to the constructor function. The updates would take care of any ordering and tidying of the inputs. See: https://github.com/vjcitn/MultiAssayExperiment/blob/master/R/MultiAssayExperiment.R#L26
If anything has to change, it would be there. We could also export the harmonize
function and use that to tie loose-ends and/or update an old MultiAssayExperiment
.
reduce
should do less and be endomorphic.
Handled in RaggedExperiment
Relates to "reduce" discussion earlier with @mtmorgan