Tempora icon indicating copy to clipboard operation
Tempora copied to clipboard

getMD from SingleCellExperiment object

Open baj12 opened this issue 4 years ago • 1 comments

I am working with SingleCellExperiment objects. It seems that SingleCellExperiment::colData returns a "DFrame" and that reshape2::dcast in CreateTemporaObject requires a data.frame.

suppressMessages(
  setMethod("getMD","SingleCellExperiment",
            function(x) SingleCellExperiment::colData(x))
)

baj12 avatar Feb 11 '21 11:02 baj12

Otherwise, I get an error message:

dcast Error in FUN(X[[i]], ...) : envir must be either NULL, a list, or an environment.

Replacing the above code in dataAccess.R with

suppressMessages(
  setMethod("getMD","SingleCellExperiment",
            function(x) data.frame(SingleCellExperiment::colData(x)))
)

resolves this issue.

baj12 avatar Apr 06 '21 11:04 baj12