I was trying to follow the vignett for customizing iSEE interface and then I encountered following error with reproducible code.
Construct a SummarizedExperiment object
nrows <- 200
ncols <- 6
counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
se <- SummarizedExperiment(assays=list(counts=counts))
Now try a function from ISEE package meant for SummarizedExperiment objects
fexArg <- featAssayPlotDefaults(se, 1)
which produces following error
Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'int_metadata' for signature '"SummarizedExperiment"'
How to fix this? I am using iSEE version 1.6.1
Many thanks
On the contrary, the documentation of featAssayPlotDefaults says it will process SummarizedExperiment, that is the reason for my confusion.
To clarify:
SummarizedExperiment
are indeed the core class supported byiSEE()
, which means that derived classes such asSingleCellExperiment
are implicitly supported.As a derived class, the
SingleCellExperiment
class inherits from all the features of the parentSummarizedExperiment
class, while adding new slots and methods specific to theSingleCellExperiment
. One such new method isint_metadata()
. In other words,int_metadata()
is defined for the derivedSingleCellExperiment
class, but not for the parentSummarizedExperiment
.To conclude, Aaron's advice to coerce your SE to a SingleCellExperiment will add
SingleCellExperiment
-specific slots to your object, which will then enable the associated methods, includingint_metadata()
.Please follow that advice. We'll have a closer look at the documentation, to see if we can make it clearer for new users.
Thanks, Aron and Kevin for replying. However, with the below code, I have tried to coerced to SingleCellExperiment which have not produced "Feature assay plot 1" .
The warnings in the console are
The correct command is
In versions
≤1.6.1
,iSEE
requires assays to be named, which is your issue in this instance.Please use R 4.0.0 with Bioconductor release 3.11 and iSEE 2.0.0, available today, which brings a new simpler syntax and new features.
It has worked finally. Many thanks to both of you.
Good news! Can I please ask you to 'accept' this answer to mark this question as resolved? Thank you !