Bioconductor / SummarizedExperiment

A container (S4 class) for matrix-like assays
https://bioconductor.org/packages/SummarizedExperiment
33 stars 9 forks source link

Should `rowData` be merged with `mcols(gr)`? #30

Open LiNk-NY opened 5 years ago

LiNk-NY commented 5 years ago

Hi Hervé, @hpages I have an example here:

library(GenomicRanges)
library(SummarizedExperiment)
example(GRanges)
example(SummarizedExperiment)
ss <- se[1:10, ]
rowData(ss)
rowRanges(ss) <- gr
rowData(ss)
## equivalently
mcols(ss) 

Shouldn't rowData(ss) be a combination of the previous object's rowData and the mcols of the merged GRanges, i.e., DataFrame(rowData(ss), mcols(gr))?

Thank you, Marcel

LiNk-NY commented 5 years ago

This would require the merging in this line: https://github.com/Bioconductor/SummarizedExperiment/blob/7df70dc87fe2dce6f8716b199d0a7163c856ef5d/R/RangedSummarizedExperiment-class.R#L230

lawremi commented 5 years ago

I ran into this issue recently and it did surprise me.