waldronlab / MultiAssayExperiment

Bioconductor package for management of multi-assay data
https://waldronlab.io/MultiAssayExperiment/
69 stars 32 forks source link

sampleMap(mae)$assay required to be factor #206

Closed lwaldron closed 7 years ago

lwaldron commented 7 years ago

Previously, sampleMap(mae)$assay was a character but now it must be a factor, otherwise any subsetting removes all data. See the attached example.

> load("~/Downloads/miniconquerMAE.rda")
> mae <- updateObject(mae)
> mae[, 1:10, ]
harmonizing input:
  removing 36 sampleMap rows not in names(experiments)
  removing 18 colData rownames not in sampleMap 'primary'
A MultiAssayExperiment object of 0 listed
 experiments with no user-defined names and respective classes. 
 Containing an ExperimentList class object of length 0:  
Features: 
 experiments() - obtain the ExperimentList instance 
 colData() - the primary/phenotype DataFrame 
 sampleMap() - the sample availability DataFrame 
 `$`, `[`, `[[` - extract colData columns, subset, or experiment 
 *Format() - convert into a long or wide DataFrame 
 assays() - convert ExperimentList to a SimpleList of matrices
> mae@sampleMap$assay <- factor(mae@sampleMap$assay)
> mae[, 1:10, ]
harmonizing input:
  removing 16 sampleMap rows with 'colname' not in colnames of experiments
  removing 8 colData rownames not in sampleMap 'primary'
A MultiAssayExperiment object of 2 listed
 experiments with user-defined names and respective classes. 
 Containing an ExperimentList class object of length 2: 
 [1] gene: RangedSummarizedExperiment with 10 rows and 10 columns 
 [2] tx: RangedSummarizedExperiment with 10 rows and 10 columns 
Features: 
 experiments() - obtain the ExperimentList instance 
 colData() - the primary/phenotype DataFrame 
 sampleMap() - the sample availability DataFrame 
 `$`, `[`, `[[` - extract colData columns, subset, or experiment 
 *Format() - convert into a long or wide DataFrame 
 assays() - convert ExperimentList to a SimpleList of matrices
> 

miniconquerMAE.rda.zip

lwaldron commented 7 years ago

If the assay column is required to be a factor then this needs a validity check, and updateObject() should include this correction.

BTW, this came up with Charlotte Soneson's nice page of MultiAssayExperiments containing gene and transcript-level RangedSummarizedExperiments for matched single-cell RNA-seq: http://imlspenticton.uzh.ch:3838/conquer/

LiNk-NY commented 7 years ago

Thanks for reporting this. Fixed.