Closed LiNk-NY closed 5 years ago
This can sometimes be desirable when you only want a single assay from a MultiAssayExperiment
object. In the context of curatedTCGAData
I was able to achieve this with the following (not so elegant) code.
BRCA <- curatedTCGAData::curatedTCGAData(diseaseCode = "BRCA", assays = "RNASeq2GeneNorm", dry.run = FALSE)
colData <- MultiAssayExperiment::colData(BRCA)
sampleMap <- MultiAssayExperiment::sampleMap(BRCA)
colData <- colData[sampleMap$primary, ]
S4Vectors::rownames(colData) <- as.character(sampleMap$colname)
BRCA <- BRCA[[1]]
SummarizedExperiment::assayNames(BRCA) <- as.character("RNASeq2GeneNorm")
SummarizedExperiment::colData(BRCA) <- colData
Agreed with @schifferl. Would actually say that this is a frequent use case, for instance for users querying curatedTCGAData
for a single assay type.
I've named it getWithColData
, you can see it here: 17727a4a1e507a8987b30a8e6bf5f0579dbe043f
Thanks, Marcel!
This could be a standalone function to move the
colData(mae)
into a single experiment during extraction ([[
).(from discussions with Levi @lwaldron)
Samples and Patients should be in agreement in the final extracted dataset.