featAssayPlotDefaults does not work for SummarizedExperiment object
1
1
Entering edit mode
rishi.dasroy ▴ 20
@rishidasroy-7142
Last seen 8 months ago
Finland

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

iSEE SummarizedExperiment • 1.5k views
ADD COMMENT
3
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 7 minutes ago
The city by the bay

Short answer: just coerce your SE to a SingleCellExperiment instead.

Long answer: the next release of iSEE (2.0.0) provides a much smoother way of setting up the app:

iSEE(se, initial=list(
     FeatureAssayPlot(),
     ColumnDataPlot(),
     RowDataTable()
))

These functions will replace the old *Defaults(), and should avoid running into the error above.

ADD COMMENT
0
Entering edit mode

On the contrary, the documentation of featAssayPlotDefaults says it will process SummarizedExperiment, that is the reason for my confusion.

ADD REPLY
0
Entering edit mode

To clarify:

SummarizedExperiment are indeed the core class supported by iSEE(), which means that derived classes such as SingleCellExperiment are implicitly supported.

As a derived class, the SingleCellExperiment class inherits from all the features of the parent SummarizedExperiment class, while adding new slots and methods specific to the SingleCellExperiment. One such new method is int_metadata(). In other words, int_metadata() is defined for the derived SingleCellExperiment class, but not for the parent SummarizedExperiment.

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, including int_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.

ADD REPLY
0
Entering edit mode

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" .

library(airway)
data(airway)

airway_sce <- SingleCellExperiment(airway)
iSEE::iSEE(airway_sce)

The warnings in the console are

Listening on http://127.0.0.1:5613 'Reduced dimension plot 1' in 'initialPanels' is not available (maximum ID is 0) 'Column data plot 1' in 'initialPanels' is not available (maximum ID is 0) 'Feature assay plot 1' in 'initialPanels' is not available (maximum ID is 0) 'Row data plot 1' in 'initialPanels' is not available (maximum ID is 0) 'Sample assay plot 1' in 'initialPanels' is not available (maximum ID is 0) 'Custom data plot 1' in 'initialPanels' is not available (maximum ID is 0) 'Custom statistics table 1' in 'initialPanels' is not available (maximum ID is 0) 'Heat map 1' in 'initialPanels' is not available (maximum ID is 0)

ADD REPLY
1
Entering edit mode

The correct command is

airway_sce <- as(airway, "SingleCellExperiment")

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.

ADD REPLY
0
Entering edit mode

It has worked finally. Many thanks to both of you.

ADD REPLY
0
Entering edit mode

Good news! Can I please ask you to 'accept' this answer to mark this question as resolved? Thank you !

ADD REPLY

Login before adding your answer.

Traffic: 568 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6