Closed epurdom closed 4 years ago
Woah, why so formal, Liz?
Anyway, the problem is likely because of as(object, "SingleCellExperiment")
, which coerces the object into the latest SCE format but leaves the object version as something that's pre-1.7.1. This then means that it goes into the the wrong path within updateObject,SingleCellExperiment-method
, leading to the observed problem.
We can add a check to the SCE's updateObject
method, but the real solution for you is to call callNextMethod()
within the ClusterExperiment
method to do the updating of the SCE components. (Might have to use S4Vectors::disableValidity()
here.) Currently, if you have any reduced dimensions, these get discarded outright by as()
when it converts to the SCE parent of your CE class.
Yours truly,
Aaron Lun, PhD.
Well, I'm always rather formal on my issues requests....
But you're absolutely right, my code was a mess there. Thanks, using callNextMethod
instead appears to have solved the problem.
Hello,
My package,
clusterExperiment
(epurdom/clusterExperiment) creates a classClusterExperiment
that inherits from SingleCellExperiment. I am running into a problem withupdateObject
. In particular, I can no longer runupdateObject
for out-of-date objects of my class.Calling
updateObject
appears to do callupdateObject
onas(x,"SingleCellExperiment")
. But callingas(x,"SingleCellExperiment")
creates an SingleCellExperiment object that doesn't allow the@reducedDims
option, so I think it's choking onreducedDims(object) <- object@reducedDims
in theupdateObject
function. (the internal storage of the package version is preserved withas(x,"SingleCellExperiment")
so it is triggering the update).I thought I could just put this code (
reducedDims(object) <- object@reducedDims
) in myupdateObject
for theclusterExperiment
class, though that seems a very inelegant solution to the problem, and seems to defeat the purpose of the inheritance (i.e. not having to recode everything). But it also doesn't workBased on the traceback, it appears to get into an infinite loop of
updateObject
, becausereducedDims<-
first callsupdateObject
. The first few steps of that infinite loop (from traceback) are:Thanks for any help with this problem.
All of the best, Elizabeth Purdom