waldronlab / MultiAssayExperiment

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

wideFormat() on SummarizedExperiment #278

Closed mherberg closed 3 years ago

mherberg commented 4 years ago

I noticed calling wideFormat on a SummarizedExperiment fails.

> wideFormat(se, c("days_to_death"))
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘experiments’ for signature ‘"SummarizedExperiment"’

However I noticed that longFormat() can be called on a SummarizedExperiment object and works (looking through the source code it looks like it calls .longFormatANY().

Is there any plan to implement the same behavior for wideFormat(). I noticed that .wideFormatANY() was implemented and handles SummarizedExperiment, however it does not appear to be called from wideFormat(). I think adding this would be very useful and it looks like some work was done on it.

LiNk-NY commented 3 years ago

Hi @mherberg,

This helper function is a vestige of the refactoring of wideFormat. I think that it was easier and faster to implement wideFormat through longFormat using tidyr::spread. I may have to change this soon since tidyr::spread is in retired status.

An implementation of wideFormat for SummarizedExperiment is outside the scope of MultiAssayExperiment and would be a question for the SummarizedExperiment package, though I doubt that such functionality would be supported.

Best, Marcel