Skip to content
Prev 5343 / 21312 Next

[Bioc-devel] 'droplevels' argument in `[` method for SummarizedExperiment?

Hi Martin, Mike

a DESeq2 user brought up the observation that when he subsets a ?DESeqDataSet? object (the class inherits from ?SummarizedExperiment?) by samples, he often ends up with unused factor levels in the colData. (Esp. since the subsetting is often to select certain subgroups). Would either of the following two make sense:

- a ?droplevels? method for ?SummarizedExperiment? that efficiently and conveniently removes unused levels, i.e.
     x = x[, x$tissue %in% c(?guts?, ?brains?)]
     x = droplevels(x)
- a ?droplevels? argument (default: FALSE)
     x = x[, x$tissue %in% c(?guts?, ?brains?), droplevels=TRUE]

Wolfgang