Is it possible to subset and assign in the same command? For example, I would like to reduce an assay to 1000 features for illustrative purposes. But, it causes an error.
melanomaData[, , 2] <- melanomaData[1:1000, , 2]
Error in .nextMethod(value = value, x = x) :
'value' must be a ExperimentList object (or coercible to a ExperimentList object)
What's the correct way to subset one assay and reassign it to the same variable?
> library(MulitAssayExperiment)
> data(miniACC)
> miniACC
A MultiAssayExperiment object of 5 listed
experiments with user-defined names and respective classes.
Containing an ExperimentList class object of length 5:
[1] RNASeq2GeneNorm: SummarizedExperiment with 198 rows and 79 columns
[2] gistict: SummarizedExperiment with 198 rows and 90 columns
[3] RPPAArray: SummarizedExperiment with 33 rows and 46 columns
[4] Mutations: matrix with 97 rows and 90 columns
[5] miRNASeqGene: SummarizedExperiment with 471 rows and 80 columns
Functionality:
experiments() - obtain the ExperimentList instance
colData() - the primary/phenotype DataFrame
sampleMap() - the sample coordination DataFrame
`$`, `[`, `[[` - extract colData columns, subset, or experiment
*Format() - convert into a long or wide DataFrame
assays() - convert ExperimentList to a SimpleList of matrices
exportClass() - save data to flat files
> miniACC[[2]] <- miniACC[[2]][1:10,]
> miniACC
A MultiAssayExperiment object of 5 listed
experiments with user-defined names and respective classes.
Containing an ExperimentList class object of length 5:
[1] RNASeq2GeneNorm: SummarizedExperiment with 198 rows and 79 columns
[2] gistict: SummarizedExperiment with 10 rows and 90 columns
[3] RPPAArray: SummarizedExperiment with 33 rows and 46 columns
[4] Mutations: matrix with 97 rows and 90 columns
[5] miRNASeqGene: SummarizedExperiment with 471 rows and 80 columns
Functionality:
experiments() - obtain the ExperimentList instance
colData() - the primary/phenotype DataFrame
sampleMap() - the sample coordination DataFrame
`$`, `[`, `[[` - extract colData columns, subset, or experiment
*Format() - convert into a long or wide DataFrame
assays() - convert ExperimentList to a SimpleList of matrices
exportClass() - save data to flat files
Any other iteration appears to generate an invalid object, if it works at all.
Thank you Jim!
I will look into it and see what can be done. I've created an issue here:
https://github.com/waldronlab/MultiAssayExperiment/issues/319
Best,
Marcel
Upon further review, it looks like this is the desired behavior. Single bracket replacements should be either a list or ExperimentList.
Something like this is expected:
I've updated the method to include the use of the names on the right-hand side.
Best,
Marcel