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

Wolfgang Huber whuber at embl.de
Wed Mar 12 23:02:37 CET 2014

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]


More information about the Bioc-devel mailing list